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
17 changes: 17 additions & 0 deletions src/auth/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,23 @@ mod tests {
assert!(!ro.contains(&"logs_write_pipelines"));
}

#[test]
fn test_default_scopes_excludes_workload_identity_federation() {
let scopes = default_scopes();
// workload_identity_federation_read/write are only ever granted to
// admins, so they're opt-in only (see 'pup cloud-auth' AUTHENTICATION
// doc) rather than requested by default.
assert!(!scopes.contains(&"workload_identity_federation_read"));
assert!(!scopes.contains(&"workload_identity_federation_write"));
}

#[test]
fn test_read_only_scopes_excludes_workload_identity_federation() {
let ro = read_only_scopes();
assert!(!ro.contains(&"workload_identity_federation_read"));
assert!(!ro.contains(&"workload_identity_federation_write"));
}

#[test]
fn test_read_only_scopes_subset_of_default() {
let default: std::collections::HashSet<&str> = default_scopes().into_iter().collect();
Expand Down
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7902,7 +7902,13 @@ enum IntegrationActions {
#[derive(Subcommand)]
enum IntegrationAwsActions {
/// Manage AWS cloud authentication
#[command(name = "cloud-auth")]
///
/// AUTHENTICATION:
/// Requires OAuth2 (via 'pup auth login') or API + Application keys.
/// OAuth2 requires the workload_identity_federation_read/write scopes,
/// which are not requested by default -- opt in with:
/// pup auth login --extra-scopes workload_identity_federation_read,workload_identity_federation_write
#[command(name = "cloud-auth", verbatim_doc_comment)]
CloudAuth {
#[command(subcommand)]
action: CloudAuthActions,
Expand Down