Skip to content

Commit

Permalink
Restore the browser auth, related #360
Browse files Browse the repository at this point in the history
  • Loading branch information
yuezk committed May 7, 2024
1 parent 97c3998 commit ddeef46
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ compile-time = "0.2"
serde_urlencoded = "0.7"
md5="0.7"
sha256="1"
open = "5"

# Tauri dependencies
tauri = { version = "1.5" }
Expand Down
7 changes: 5 additions & 2 deletions apps/gpauth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ license.workspace = true
tauri-build = { version = "1.5", features = [] }

[dependencies]
gpapi = { path = "../../crates/gpapi", features = ["tauri", "clap"] }
gpapi = { path = "../../crates/gpapi", features = [
"tauri",
"clap",
"browser-auth",
] }
anyhow.workspace = true
clap.workspace = true
env_logger.workspace = true
Expand All @@ -22,4 +26,3 @@ html-escape = "0.2.13"
webkit2gtk = "0.18.2"
tauri = { workspace = true, features = ["http-all"] }
compile-time.workspace = true
open.workspace = true
6 changes: 2 additions & 4 deletions apps/gpauth/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use gpapi::{
auth::{SamlAuthData, SamlAuthResult},
clap::args::Os,
gp_params::{ClientOs, GpParams},
process::browser_authenticator::BrowserAuthenticator,
utils::{normalize_server, openssl},
GP_USER_AGENT,
};
Expand All @@ -11,10 +12,7 @@ use serde_json::json;
use tauri::{App, AppHandle, RunEvent};
use tempfile::NamedTempFile;

use crate::{
auth_window::{portal_prelogin, AuthWindow},
browser_authenticator::BrowserAuthenticator,
};
use crate::auth_window::{portal_prelogin, AuthWindow};

const VERSION: &str = concat!(env!("CARGO_PKG_VERSION"), " (", compile_time::date_str!(), ")");

Expand Down
1 change: 0 additions & 1 deletion apps/gpauth/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

mod auth_window;
mod browser_authenticator;
mod cli;

#[tokio::main]
Expand Down
2 changes: 2 additions & 0 deletions crates/gpapi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ sha256.workspace = true

tauri = { workspace = true, optional = true }
clap = { workspace = true, optional = true }
open = { version = "5", optional = true }

[features]
tauri = ["dep:tauri"]
clap = ["dep:clap"]
browser-auth = ["dep:open"]
File renamed without changes.
2 changes: 2 additions & 0 deletions crates/gpapi/src/process/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ pub(crate) mod command_traits;
pub(crate) mod gui_helper_launcher;

pub mod auth_launcher;
#[cfg(feature = "browser-auth")]
pub mod browser_authenticator;
pub mod gui_launcher;
pub mod hip_launcher;
pub mod service_launcher;
Expand Down

0 comments on commit ddeef46

Please sign in to comment.