Skip to content

Commit 0e5a179

Browse files
committed
rename authn list to session list
1 parent c3c070e commit 0e5a179

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed

nexus/auth/src/authz/api_resources.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -672,9 +672,9 @@ impl AuthorizedResource for SiloUserList {
672672

673673
/// Synthetic resource for managing a user's sessions
674674
#[derive(Clone, Debug, Eq, PartialEq)]
675-
pub struct SiloUserAuthnList(SiloUser);
675+
pub struct SiloUserSessionList(SiloUser);
676676

677-
impl SiloUserAuthnList {
677+
impl SiloUserSessionList {
678678
pub fn new(silo_user: SiloUser) -> Self {
679679
Self(silo_user)
680680
}
@@ -688,18 +688,18 @@ impl SiloUserAuthnList {
688688
}
689689
}
690690

691-
impl oso::PolarClass for SiloUserAuthnList {
691+
impl oso::PolarClass for SiloUserSessionList {
692692
fn get_polar_class_builder() -> oso::ClassBuilder<Self> {
693693
oso::Class::builder().with_equality_check().add_attribute_getter(
694694
"silo_user",
695-
|user_sessions: &SiloUserAuthnList| {
695+
|user_sessions: &SiloUserSessionList| {
696696
user_sessions.silo_user().clone()
697697
},
698698
)
699699
}
700700
}
701701

702-
impl AuthorizedResource for SiloUserAuthnList {
702+
impl AuthorizedResource for SiloUserSessionList {
703703
fn load_roles<'fut>(
704704
&'fut self,
705705
opctx: &'fut OpContext,

nexus/auth/src/authz/omicron.polar

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -450,24 +450,24 @@ resource ConsoleSessionList {
450450
has_relation(fleet: Fleet, "parent_fleet", collection: ConsoleSessionList)
451451
if collection.fleet = fleet;
452452

453-
# Allow silo admins to delete user sessions and list user tokens
454-
resource SiloUserAuthnList {
453+
# Allow silo admins to delete and list user sessions
454+
resource SiloUserSessionList {
455455
permissions = [ "modify", "list_children" ];
456456
relations = { parent_silo: Silo };
457457

458458
# A silo admin can modify (e.g., delete) a user's sessions.
459459
"modify" if "admin" on "parent_silo";
460460

461-
# A silo admin can list a user's tokens and sessions.
461+
# A silo admin can list a user's sessions.
462462
"list_children" if "admin" on "parent_silo";
463463
}
464-
has_relation(silo: Silo, "parent_silo", authn_list: SiloUserAuthnList)
464+
has_relation(silo: Silo, "parent_silo", authn_list: SiloUserSessionList)
465465
if authn_list.silo_user.silo = silo;
466466

467-
# give users 'modify' and 'list_children' on their own tokens and sessions
468-
has_permission(actor: AuthenticatedActor, "modify", authn_list: SiloUserAuthnList)
467+
# give users 'modify' and 'list_children' on their own sessions
468+
has_permission(actor: AuthenticatedActor, "modify", authn_list: SiloUserSessionList)
469469
if actor.equals_silo_user(authn_list.silo_user);
470-
has_permission(actor: AuthenticatedActor, "list_children", authn_list: SiloUserAuthnList)
470+
has_permission(actor: AuthenticatedActor, "list_children", authn_list: SiloUserSessionList)
471471
if actor.equals_silo_user(authn_list.silo_user);
472472

473473
# Allow silo admins to delete and list user access tokens

nexus/auth/src/authz/oso_generic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ pub fn make_omicron_oso(log: &slog::Logger) -> Result<OsoInit, anyhow::Error> {
113113
DeviceAuthRequestList::get_polar_class(),
114114
SiloCertificateList::get_polar_class(),
115115
SiloIdentityProviderList::get_polar_class(),
116-
SiloUserAuthnList::get_polar_class(),
117116
SiloUserList::get_polar_class(),
117+
SiloUserSessionList::get_polar_class(),
118118
SiloUserTokenList::get_polar_class(),
119119
UpdateTrustRootList::get_polar_class(),
120120
TargetReleaseConfig::get_polar_class(),

nexus/db-queries/src/db/datastore/console_session.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl DataStore {
165165
pub async fn silo_user_session_list(
166166
&self,
167167
opctx: &OpContext,
168-
authn_list: authz::SiloUserAuthnList,
168+
authn_list: authz::SiloUserSessionList,
169169
pagparams: &DataPageParams<'_, Uuid>,
170170
) -> ListResultVec<ConsoleSession> {
171171
opctx.authorize(authz::Action::ListChildren, &authn_list).await?;
@@ -192,7 +192,7 @@ impl DataStore {
192192
pub async fn silo_user_sessions_delete(
193193
&self,
194194
opctx: &OpContext,
195-
authn_list: &authz::SiloUserAuthnList,
195+
authn_list: &authz::SiloUserSessionList,
196196
) -> Result<(), Error> {
197197
// authz policy enforces that the opctx actor is a silo admin on the
198198
// target user's own silo in particular

nexus/db-queries/src/policy_test/resource_builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl DynAuthorizedResource for authz::SiloUserList {
346346
}
347347
}
348348

349-
impl DynAuthorizedResource for authz::SiloUserAuthnList {
349+
impl DynAuthorizedResource for authz::SiloUserSessionList {
350350
fn do_authorize<'a, 'b>(
351351
&'a self,
352352
opctx: &'b OpContext,
@@ -359,7 +359,7 @@ impl DynAuthorizedResource for authz::SiloUserAuthnList {
359359
}
360360

361361
fn resource_name(&self) -> String {
362-
format!("{}: authn list", self.silo_user().resource_name())
362+
format!("{}: session list", self.silo_user().resource_name())
363363
}
364364
}
365365

nexus/db-queries/src/policy_test/resources.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ async fn make_silo(
281281
silo_image_id,
282282
LookupType::ByName(format!("{}-silo-image", silo_name)),
283283
));
284-
builder.new_resource(authz::SiloUserAuthnList::new(silo_user.clone()));
284+
builder.new_resource(authz::SiloUserSessionList::new(silo_user.clone()));
285285
builder.new_resource(authz::SiloUserTokenList::new(silo_user));
286286

287287
// Image is a special case in that this resource is technically just a

nexus/db-queries/tests/output/authz-roles.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ resource: SiloImage "silo1-silo-image"
306306
silo1-proj1-viewer ✘ ✘ ✘ ✘ ✘ ✘ ✘ ✘
307307
unauthenticated ! ! ! ! ! ! ! !
308308

309-
resource: SiloUser "silo1-user": authn list
309+
resource: SiloUser "silo1-user": session list
310310

311311
USER Q R LC RP M MP CC D
312312
fleet-admin ✘ ✘ ✘ ✘ ✘ ✘ ✘ ✘
@@ -894,7 +894,7 @@ resource: SiloImage "silo2-silo-image"
894894
silo1-proj1-viewer ✘ ✘ ✘ ✘ ✘ ✘ ✘ ✘
895895
unauthenticated ! ! ! ! ! ! ! !
896896

897-
resource: SiloUser "silo2-user": authn list
897+
resource: SiloUser "silo2-user": session list
898898

899899
USER Q R LC RP M MP CC D
900900
fleet-admin ✘ ✘ ✘ ✘ ✘ ✘ ✘ ✘

nexus/src/app/silo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ impl super::Nexus {
331331
.await?;
332332

333333
let authz_authn_list =
334-
authz::SiloUserAuthnList::new(authz_silo_user.clone());
334+
authz::SiloUserSessionList::new(authz_silo_user.clone());
335335
self.datastore()
336336
.silo_user_sessions_delete(opctx, &authz_authn_list)
337337
.await?;
@@ -387,7 +387,7 @@ impl super::Nexus {
387387
.fetch()
388388
.await?;
389389

390-
let user_authn_list = authz::SiloUserAuthnList::new(authz_silo_user);
390+
let user_authn_list = authz::SiloUserSessionList::new(authz_silo_user);
391391

392392
self.datastore()
393393
.silo_user_session_list(opctx, user_authn_list, pagparams)

0 commit comments

Comments
 (0)