Skip to content

fix(quota): detect project from auth token and guard empty project ID#131

Merged
larkly merged 1 commit intomainfrom
fix/quota-project-detection
Apr 1, 2026
Merged

fix(quota): detect project from auth token and guard empty project ID#131
larkly merged 1 commit intomainfrom
fix/quota-project-detection

Conversation

@larkly
Copy link
Copy Markdown
Owner

@larkly larkly commented Apr 1, 2026

Summary

  • Extract the scoped project ID from the auth token on startup via ExtractProject(), so application credentials (which are always project-scoped) get their project pre-selected without manual picker interaction
  • Guard fetchQuotas() against empty project ID to show a clear "no project selected" message instead of a confusing 403 from a malformed API URL (/os-quota-sets//detail)

Test plan

  • Connect with application credentials — verify project is auto-detected and shown in status bar
  • Press Q immediately after connect — verify quotas load without 403
  • Connect with unscoped token — verify "no project selected" shown until project is picked

Application credentials are always scoped to a project, but the project
ID was never extracted from the auth token — the stub was left as a
TODO. This caused quota lookups to fail with a 403 because the API URL
contained an empty project ID (/os-quota-sets//detail).

Extract the project from the token via ExtractProject() so it is
pre-selected on startup, and add a guard in fetchQuotas() to return a
clear error instead of making a malformed API call.
@larkly larkly merged commit e327ebe into main Apr 1, 2026
3 checks passed
@larkly larkly deleted the fix/quota-project-detection branch April 1, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant