Skip to content
Open
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
11 changes: 10 additions & 1 deletion src/auth/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ pub fn read_only_scopes() -> Vec<&'static str> {
"metrics_read",
"monitors_read",
"notebooks_read",
"observability_pipelines_read",
"oci_configuration_read",
"on_call_read",
"reference_tables_read",
Expand Down Expand Up @@ -179,6 +180,10 @@ pub fn default_scopes() -> Vec<&'static str> {
// Notebooks
"notebooks_read",
"notebooks_write",
// Observability Pipelines
"observability_pipelines_read",
"observability_pipelines_deploy",
"observability_pipelines_delete",
Comment on lines +184 to +186
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate new scopes until the OAuth server accepts them

When this binary is deployed before the server-side OAuth scope rollout reaches every supported site, a plain pup auth login resolves to default_scopes() and puts these new scopes in the authorization URL; the OAuth issuer rejects unknown scopes with invalid_scope before any token is issued. That blocks all users from logging in or refreshing an expired session, not just users of obs-pipelines, so these scopes need to remain opt-in/configured or be gated until the issuer accepts them everywhere.

Useful? React with 👍 / 👎.

// OCI
"oci_configuration_edit",
"oci_configuration_read",
Expand Down Expand Up @@ -271,7 +276,7 @@ mod tests {
#[test]
fn test_default_scopes() {
let scopes = default_scopes();
assert_eq!(scopes.len(), 85);
assert_eq!(scopes.len(), 88);
assert!(scopes.contains(&"dashboards_read"));
assert!(scopes.contains(&"monitors_read"));
assert!(scopes.contains(&"logs_read_data"));
Expand All @@ -290,6 +295,10 @@ mod tests {
assert!(scopes.contains(&"on_call_write"));
assert!(scopes.contains(&"aws_configuration_read"));
assert!(scopes.contains(&"gcp_configuration_read"));
// Observability Pipelines
assert!(scopes.contains(&"observability_pipelines_read"));
assert!(scopes.contains(&"observability_pipelines_deploy"));
assert!(scopes.contains(&"observability_pipelines_delete"));
}

#[test]
Expand Down
3 changes: 1 addition & 2 deletions src/commands/obs_pipelines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ use crate::formatter;
use crate::util;

fn make_api(cfg: &Config) -> ObservabilityPipelinesAPI {
// Observability Pipelines does not support OAuth — API key auth only.
crate::make_api_no_auth!(ObservabilityPipelinesAPI, cfg)
crate::make_api!(ObservabilityPipelinesAPI, cfg)
}

pub async fn list(cfg: &Config, limit: i64) -> Result<()> {
Expand Down
Loading