Skip to content

Commit

Permalink
[spr] initial version
Browse files Browse the repository at this point in the history
Created using spr 1.3.6-beta.1
  • Loading branch information
sunshowers committed Aug 17, 2024
1 parent c86ff79 commit c32a907
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 8 deletions.
15 changes: 15 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ members = [
"nexus-sled-agent-shared",
"nexus/authz-macros",
"nexus/auth",
"nexus/auth-types",
"nexus/db-fixed-data",
"nexus/db-macros",
"nexus/db-model",
Expand Down Expand Up @@ -170,6 +171,7 @@ default-members = [
"nexus-sled-agent-shared",
"nexus/authz-macros",
"nexus/auth",
"nexus/auth-types",
"nexus/db-fixed-data",
"nexus/db-macros",
"nexus/db-model",
Expand Down Expand Up @@ -404,6 +406,7 @@ mg-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "2
ddm-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "220dd026e83142b83bd93123f465a64dd4600201" }
multimap = "0.10.0"
nexus-auth = { path = "nexus/auth" }
nexus-auth-types = { path = "nexus/auth-types" }
nexus-client = { path = "clients/nexus-client" }
nexus-config = { path = "nexus-config" }
nexus-db-fixed-data = { path = "nexus/db-fixed-data" }
Expand Down
1 change: 1 addition & 0 deletions nexus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ tough.workspace = true
uuid.workspace = true

nexus-auth.workspace = true
nexus-auth-types.workspace = true
nexus-defaults.workspace = true
nexus-db-model.workspace = true
nexus-db-queries.workspace = true
Expand Down
17 changes: 17 additions & 0 deletions nexus/auth-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "nexus-auth-types"
version = "0.1.0"
edition = "2021"
license = "MPL-2.0"

[lints]
workspace = true

[dependencies]
anyhow.workspace = true
async-trait.workspace = true
cookie.workspace = true
dropshot.workspace = true
http.workspace = true
newtype_derive.workspace = true
omicron-workspace-hack.workspace = true
File renamed without changes.
7 changes: 7 additions & 0 deletions nexus/auth-types/src/authn/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Authentication types for the Nexus API.
pub mod cookies;
7 changes: 7 additions & 0 deletions nexus/auth-types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

//! Authentication and authorization types for the Nexus API.
pub mod authn;
1 change: 1 addition & 0 deletions nexus/auth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ tokio = { workspace = true, features = ["full"] }
uuid.workspace = true

authz-macros.workspace = true
nexus-auth-types.workspace = true
nexus-db-fixed-data.workspace = true
nexus-db-model.workspace = true
nexus-types.workspace = true
Expand Down
1 change: 0 additions & 1 deletion nexus/auth/src/authn/external/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use slog::trace;
use std::borrow::Borrow;
use uuid::Uuid;

pub mod cookies;
pub mod session_cookie;
pub mod spoof;
pub mod token;
Expand Down
2 changes: 1 addition & 1 deletion nexus/auth/src/authn/external/session_cookie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

//! authn scheme for console that looks up cookie values in a session table
use super::cookies::parse_cookies;
use super::{HttpAuthnScheme, Reason, SchemeResult};
use crate::authn;
use crate::authn::{Actor, Details};
Expand All @@ -13,6 +12,7 @@ use async_trait::async_trait;
use chrono::{DateTime, Duration, Utc};
use dropshot::HttpError;
use http::HeaderValue;
use nexus_auth_types::authn::cookies::parse_cookies;
use slog::debug;
use uuid::Uuid;

Expand Down
10 changes: 4 additions & 6 deletions nexus/src/external_api/console_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,14 @@ use dropshot::{
};
use http::{header, HeaderName, HeaderValue, Response, StatusCode, Uri};
use hyper::Body;
use nexus_auth_types::authn::cookies::Cookies;
use nexus_db_model::AuthenticationMode;
use nexus_db_queries::authn::silos::IdentityProviderType;
use nexus_db_queries::context::OpContext;
use nexus_db_queries::{
authn::external::{
cookies::Cookies,
session_cookie::{
clear_session_cookie_header_value, session_cookie_header_value,
SessionStore, SESSION_COOKIE_COOKIE_NAME,
},
authn::external::session_cookie::{
clear_session_cookie_header_value, session_cookie_header_value,
SessionStore, SESSION_COOKIE_COOKIE_NAME,
},
db::identity::Asset,
};
Expand Down

0 comments on commit c32a907

Please sign in to comment.