Skip to content

feat: add login --service-account and logout --except-current - #109

Merged
leonkenneth merged 3 commits into
mainfrom
feat-add-login-service-account-and-logout-except-current-com
Sep 17, 2026
Merged

leonkenneth merged 3 commits into
mainfrom
feat-add-login-service-account-and-logout-except-current-com

Conversation

@leonkenneth

@leonkenneth leonkenneth commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Add login --service-account and logout --except-current commands to allow permission-restricted workflow.

--service-account replaces the user-base profile a regular login would have resolved to.

altertable login --service-account "CI Bot" --scope analytics:ro
altertable login --service-account  "Reader" --scope ro
altertable logout --except-current # If any other profile was on, to safely retain a single one

@leonkenneth
leonkenneth marked this pull request as ready for review September 16, 2026 15:58

@albert20260301 albert20260301 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Required: this adds a public CLI workflow on a hand-written createEnvironmentServiceAccount endpoint and response envelope that are absent from the generated API spec. Please document the intentional pre-spec contract in the PR description, including its source and the expected migration once the generated operation ships.

The implementation guard is useful, but the release-level rationale needs to be visible with the public change.

Comment thread cli/src/commands/login/index.ts Outdated
Comment thread cli/src/commands/login/index.ts Outdated
}
if (args["replace-profile"]) {
throw new ConfigurationError(
"--service-account cannot be combined with --replace-profile; a service account always gets its own profile.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Curious what use case you had in mind for the --replace-profile option? And wondering if we should instead have some kind of reset command, to then login again?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There is already logout that resets everything. I don't remember the rational for --replace-profile, we can remove it later

Comment thread cli/src/commands/login/index.ts Outdated
Comment thread cli/src/commands/login/index.ts Outdated
Comment thread cli/src/commands/login/index.ts Outdated
@leonkenneth
leonkenneth enabled auto-merge (squash) September 17, 2026 10:45
@leonkenneth
leonkenneth merged commit a6a1d34 into main Sep 17, 2026
14 checks passed
@leonkenneth
leonkenneth deleted the feat-add-login-service-account-and-logout-except-current-com branch September 17, 2026 10:48
leonkenneth pushed a commit that referenced this pull request Sep 17, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.7.0](v1.6.2...v1.7.0)
(2026-09-17)


### Features

* add `login --service-account` and `logout --except-current`
([#109](#109))
([a6a1d34](a6a1d34))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

4 participants