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

[3/6] [nexus-auth] move some types into nexus-types #6369

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
5 changes: 5 additions & 0 deletions 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 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_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 @@ -35,15 +35,13 @@ 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,
};
use nexus_types::authn::cookies::Cookies;
use nexus_types::external_api::params;
use nexus_types::identity::Resource;
use omicron_common::api::external::http_pagination::PaginatedBy;
Expand Down
5 changes: 5 additions & 0 deletions nexus/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ workspace = true

[dependencies]
anyhow.workspace = true
async-trait.workspace = true
chrono.workspace = true
clap.workspace = true
cookie.workspace = true
base64.workspace = true
derive-where.workspace = true
derive_more.workspace = true
dropshot.workspace = true
futures.workspace = true
http.workspace = true
humantime.workspace = true
ipnetwork.workspace = true
newtype_derive.workspace = true
omicron-uuid-kinds.workspace = true
openssl.workspace = true
oxql-types.workspace = true
Expand Down
7 changes: 7 additions & 0 deletions nexus/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;
1 change: 1 addition & 0 deletions nexus/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
//! rules, so our model layer knows about our views. That seems to be a
//! relatively minor offense, so it's the way we leave things for now.

pub mod authn;
pub mod deployment;
pub mod external_api;
pub mod identity;
Expand Down
Loading