Skip to content
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

Add access_token authentication scheme to Nexus config #1359

Merged
merged 1 commit into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nexus/examples/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ session_absolute_timeout_minutes = 480
# working on authentication or authorization.
[authn]
# TODO(https://github.com/oxidecomputer/omicron/issues/372): Remove "spoof".
schemes_external = ["spoof", "session_cookie", "client_token"]
schemes_external = ["spoof", "session_cookie", "access_token"]

[log]
# Show log messages of this level and more severe
Expand Down
6 changes: 3 additions & 3 deletions nexus/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl Config {
pub enum SchemeName {
Spoof,
SessionCookie,
ClientToken,
AccessToken,
}

impl std::str::FromStr for SchemeName {
Expand All @@ -190,7 +190,7 @@ impl std::str::FromStr for SchemeName {
match s {
"spoof" => Ok(SchemeName::Spoof),
"session_cookie" => Ok(SchemeName::SessionCookie),
"client_token" => Ok(SchemeName::ClientToken),
"access_token" => Ok(SchemeName::AccessToken),
_ => Err(anyhow!("unsupported authn scheme: {:?}", s)),
}
}
Expand All @@ -201,7 +201,7 @@ impl std::fmt::Display for SchemeName {
f.write_str(match self {
SchemeName::Spoof => "spoof",
SchemeName::SessionCookie => "session_cookie",
SchemeName::ClientToken => "client_token",
SchemeName::AccessToken => "access_token",
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion nexus/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl ServerContext {
config::SchemeName::SessionCookie => {
Box::new(HttpAuthnSessionCookie)
}
config::SchemeName::ClientToken => Box::new(HttpAuthnToken),
config::SchemeName::AccessToken => Box::new(HttpAuthnToken),
}
})
.collect();
Expand Down
2 changes: 1 addition & 1 deletion smf/nexus/config-partial.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ session_absolute_timeout_minutes = 480

[authn]
# TODO(https://github.com/oxidecomputer/omicron/issues/372): Remove "spoof".
schemes_external = ["spoof", "session_cookie"]
schemes_external = ["spoof", "session_cookie", "access_token"]

[log]
# Show log messages of this level and more severe
Expand Down