Repository navigation
Accept the signed-in organization's slug in executor apps commands - #55
Merged
Merged
Conversation
A device-code session saves its organization's ID, but sign-in prints the slug. Naming it with --organization <slug> failed every command, including executor apps call, with a client-made Forbidden (HTTP 403) before any request. The CLI now accepts the session's ID or slug, and sends any other organization to the host, which refuses one the grant does not cover. Adds an E2E scenario that signs the CLI in with a device code and calls a tool as the owner (by slug, by ID, refused for another organization) and as a member (refused until the app is shared with everyone).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Post-cutover backlog, item (a):
executor-v2 apps callreturned 403 on every call for a device-code (kyle@) CLI profile, while the same HTTP requests with that profile's token worked.Cause
The CLI produced the 403 itself; the host never refused anything.
executor apps loginsaves the organization's ID but printsConnected to <host> as @<slug>, so people pass the slug as--organization.access()inpackages/app-management/src/cli.tscompared the flag with the saved ID only. A slug didn't match, so the CLI stopped with "Forbidden (HTTP 403)" without sending a request.executor appscommand given--organization <slug>, not onlycall.--organization, this isn't his cause.Fix
access()accepts the session's own ID or saved slug and sends the stored ID. Any other organization is passed to the host, which refuses it with a realOrganizationForbidden. No authorization is loosened. The--organizationhelp now says "ID or slug", and there's a changeset.Tests
New
appsCliCallDeviceLoginscenario inapps-cli-call.spec.ts(self-host):listandcallwork with--organization <slug>and with the ID;OrganizationForbidden403;It fails before the fix, at the slug step. On self-host, both apps-cli-call scenarios and four device-login scenarios pass.
bun run checkpasses.