mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
Support SSO using default browser
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
|
||||
<policyconfig>
|
||||
<vendor>GlobalProtect-openconnect</vendor>
|
||||
<vendor_url>https://github.com/yuezk/GlobalProtect-openconnect</vendor_url>
|
||||
<icon_name>gpgui</icon_name>
|
||||
<action id="com.yuezk.gpservice">
|
||||
<description>Run GPService as root</description>
|
||||
<message>Authentication is required to run the GPService as root</message>
|
||||
<defaults>
|
||||
<allow_any>yes</allow_any>
|
||||
<allow_inactive>yes</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/home/kevin/Documents/repos/gp/target/debug/gpservice</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.argv1">--with-gui</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
</policyconfig>
|
@@ -21,6 +21,13 @@ pub(crate) async fn active_gui(State(ctx): State<Arc<WsServerContext>>) -> impl
|
||||
ctx.send_event(WsEvent::ActiveGui).await;
|
||||
}
|
||||
|
||||
pub(crate) async fn auth_data(
|
||||
State(ctx): State<Arc<WsServerContext>>,
|
||||
body: String,
|
||||
) -> impl IntoResponse {
|
||||
ctx.send_event(WsEvent::AuthData(body)).await;
|
||||
}
|
||||
|
||||
pub(crate) async fn ws_handler(
|
||||
ws: WebSocketUpgrade,
|
||||
State(ctx): State<Arc<WsServerContext>>,
|
||||
|
@@ -8,6 +8,7 @@ pub(crate) fn routes(ctx: Arc<WsServerContext>) -> Router {
|
||||
Router::new()
|
||||
.route("/health", get(handlers::health))
|
||||
.route("/active-gui", post(handlers::active_gui))
|
||||
.route("/auth-data", post(handlers::auth_data))
|
||||
.route("/ws", get(handlers::ws_handler))
|
||||
.with_state(ctx)
|
||||
}
|
||||
|
Reference in New Issue
Block a user