-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authentik #2
Conversation
central/src/auth/config.rs
Outdated
/// Central secret sync | ||
#[derive(Debug, Parser)] | ||
pub struct Config { | ||
/// Address the server should bind to | ||
#[clap(env, long, default_value = "0.0.0.0:8080")] | ||
pub bind_addr: SocketAddr, | ||
|
||
/// Url of the local beam proxy which is required to have sockets enabled | ||
#[clap(env, long, default_value = "http://beam-proxy:8081")] | ||
pub beam_url: Url, | ||
|
||
/// Beam api key | ||
#[clap(env, long)] | ||
pub beam_secret: String, | ||
|
||
/// The app id of this application | ||
#[clap(long, env, value_parser=|id: &str| Ok::<_, Infallible>(AppId::new_unchecked(id)))] | ||
pub beam_id: AppId, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this central/src/config.rs without bind_addr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved central
The two new commits look good to me. I need to take a look at the full changes again then I think its ready to merge |
central/src/auth/authentik/test.rs
Outdated
#[cfg(test)] | ||
// nicht möglich mit authentik | ||
async fn get_access_token_via_admin_login() -> reqwest::Result<String> { | ||
CLIENT | ||
.post(&format!( | ||
"{}/application/o/token/", | ||
if cfg!(test) { | ||
"http://localhost:9000" | ||
} else { | ||
"http://authentik:8080" | ||
} | ||
)) | ||
.form(&json!({ | ||
"client_id": "", | ||
"username": "", | ||
"password": "", | ||
"grant_type": "" | ||
})) | ||
.send() | ||
.await? | ||
.json::<Token>() | ||
.await | ||
.map(|t| t.access_token) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then delete it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete all fn that don’t work in tests
central/src/auth/authentik/test.rs
Outdated
.map(|t| t.access_token) | ||
} | ||
|
||
//#[ignore = "Requires setting up a authentik"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this ignored as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test optimized
Co-authored-by: Jan <[email protected]>
central/src/auth/authentik/test.rs
Outdated
assert!(!t.access_token.is_empty()); | ||
} | ||
|
||
//#[ignore = "Requires setting up a authentik"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test still needs to be ignored again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test fixed
Provider and app can be created.
static flow and property is missing