Repository navigation
Conversation
`devsy login <gateway-url>` prompts for email and password (no echo on a terminal), signs in with POST /v1/auth/login, picks the org (only org, --org, or a numbered prompt), creates a read/write API key named devsy-cli, and stores the key, key IDs, org and gateway URL under `gateway:` in config.yaml (mode 0600). The password and session token are never stored or printed, and the key is never printed. Failures before the key is saved leave the config untouched; a key that cannot be saved is revoked. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…eway Add `devsy workspace sleep|wake NAME` and route `devsy workspace delete NAME...` to the gateway when logged in (--skip-platform keeps the local delete). Each call must be answered 202, otherwise the command exits non-zero with the gateway's message. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
A 403 from the platform gateway now reads "permission denied: the stored API key lacks write scope", naming read for GET calls and write for everything else, and the command exits non-zero. Adds the tuistory check for a read-only key creating a workspace (VAL-CLI-009). Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
`devsy logout` calls DELETE /v1/orgs/{org}/api-keys/{id} with the stored key
as bearer. On 204 or 404 it clears the key, key ID and org from the config and
keeps the gateway URL. Any other error exits non-zero and keeps the key.
Because the URL stays, `devsy workspace list` now fails with an authentication
error after logout instead of falling back to local workspaces; --skip-platform
still lists local ones.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
cross-lifecycle.sh runs workspace create, sleep, wake and delete as an org A user and requires kubectl, GET /v1/workspaces and `devsy workspace list` to agree at every step (VAL-CROSS-001). cross-org-delete.sh checks that an org A CLI session cannot delete an org B workspace (VAL-CROSS-002). Both are run by the new cli:test:e2e:platform mise task. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…key revoke
access-revocation.sh logs a user in with devsy, removes them through
DELETE /v1/orgs/{org}/members/{user} (204) and requires the next
`devsy workspace list` to exit non-zero with an authentication error
(VAL-CROSS-003). A second login's key is revoked through
DELETE /v1/orgs/{org}/api-keys/{id} (204) and the next list must exit
non-zero with the `devsy login` hint (VAL-CROSS-004). Both run in the
cli:test:e2e:platform mise task.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…cally runPlatform returned handled=false for a logged-out config (gateway URL set, key cleared), so `devsy workspace delete NAME` fell through to the local delete path. Return the authentication error, as list and create already do. --skip-platform still deletes locally. The logged-out message now says "work with local workspaces" since it is shared by delete. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
✅ Deploy Preview for devsydev canceled.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
✅ Deploy Preview for images-devsy-sh canceled.
|
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.
Summary
CLI integration with the managed platform gateway.
devsy login/devsy logout: email/password login mints an org-scoped API key stored in the config (0600, no password or session token stored). Logout revokes the key and keeps the gateway URL as a logged-out marker.devsy workspace list|create|sleep|wake|deleteagainst the platform. Read-only keys are denied on writes. After logout, commands fail with an authentication error and adevsy loginhint.--skip-platformkeeps local behavior.hack/platform-e2e(mise run cli:test:e2e:platform) covering lifecycle, cross-org delete refusal, member removal and key revocation.Testing
Scoped
go test -p 1,go vetandgolangci-linton the changed packages pass; live e2e scripts pass against the platform stack (14/14 client assertions).Known pre-existing failures, unrelated and not fixed:
hack/sign_committest and 8 cyclop/funlen lint findings in untouched files (cmd/workspace/up/*,pkg/devcontainer/*).Companion PR: devsy-org/platform
mission/beta-hardening.