Skip to content
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
1 change: 1 addition & 0 deletions nexus/db-model/src/silo_user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ impl From<SiloUser> for views::User {
id: user.id(),
// TODO the use of external_id as display_name is temporary
display_name: user.external_id,
silo_id: user.silo_id,
}
}
}
6 changes: 4 additions & 2 deletions nexus/tests/integration_tests/console_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ async fn test_session_me(cptestctx: &ControlPlaneTestContext) {
priv_user,
views::User {
id: USER_TEST_PRIVILEGED.id(),
display_name: USER_TEST_PRIVILEGED.external_id.clone()
display_name: USER_TEST_PRIVILEGED.external_id.clone(),
silo_id: DEFAULT_SILO.id(),
}
);

Expand All @@ -359,7 +360,8 @@ async fn test_session_me(cptestctx: &ControlPlaneTestContext) {
unpriv_user,
views::User {
id: USER_TEST_UNPRIVILEGED.id(),
display_name: USER_TEST_UNPRIVILEGED.external_id.clone()
display_name: USER_TEST_UNPRIVILEGED.external_id.clone(),
silo_id: DEFAULT_SILO.id(),
}
);
}
Expand Down
14 changes: 10 additions & 4 deletions nexus/tests/integration_tests/silos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -844,11 +844,13 @@ async fn test_silo_users_list(cptestctx: &ControlPlaneTestContext) {
vec![
views::User {
id: USER_TEST_PRIVILEGED.id(),
display_name: USER_TEST_PRIVILEGED.external_id.clone()
display_name: USER_TEST_PRIVILEGED.external_id.clone(),
silo_id: *SILO_ID,
},
views::User {
id: USER_TEST_UNPRIVILEGED.id(),
display_name: USER_TEST_UNPRIVILEGED.external_id.clone()
display_name: USER_TEST_UNPRIVILEGED.external_id.clone(),
silo_id: *SILO_ID,
},
]
);
Expand Down Expand Up @@ -877,15 +879,18 @@ async fn test_silo_users_list(cptestctx: &ControlPlaneTestContext) {
vec![
views::User {
id: USER_TEST_PRIVILEGED.id(),
display_name: USER_TEST_PRIVILEGED.external_id.clone()
display_name: USER_TEST_PRIVILEGED.external_id.clone(),
silo_id: *SILO_ID,
},
views::User {
id: USER_TEST_UNPRIVILEGED.id(),
display_name: USER_TEST_UNPRIVILEGED.external_id.clone()
display_name: USER_TEST_UNPRIVILEGED.external_id.clone(),
silo_id: *SILO_ID,
},
views::User {
id: new_silo_user_id,
display_name: new_silo_user_external_id.into(),
silo_id: *SILO_ID,
},
]
);
Expand Down Expand Up @@ -929,6 +934,7 @@ async fn test_silo_users_list(cptestctx: &ControlPlaneTestContext) {
vec![views::User {
id: new_silo_user_id,
display_name: new_silo_user_name,
silo_id: silo.identity.id,
}]
);

Expand Down
3 changes: 3 additions & 0 deletions nexus/types/src/external_api/views.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ pub struct User {
pub id: Uuid,
/** Human-readable name that can identify the user */
pub display_name: String,

/** Uuid of the silo to which this user belongs */
pub silo_id: Uuid,
}

// BUILT-IN USERS
Expand Down
8 changes: 7 additions & 1 deletion openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -11188,11 +11188,17 @@
"id": {
"type": "string",
"format": "uuid"
},
"silo_id": {
"description": "Uuid of the silo to which this user belongs",
"type": "string",
"format": "uuid"
}
},
"required": [
"display_name",
"id"
"id",
"silo_id"
]
},
"UserBuiltin": {
Expand Down