organization/api-keys: fix broken code samples and clarify role pathway#5024
Open
shannonbradshaw wants to merge 2 commits into
Open
organization/api-keys: fix broken code samples and clarify role pathway#5024shannonbradshaw wants to merge 2 commits into
shannonbradshaw wants to merge 2 commits into
Conversation
- Separate scope and role decisions; CLI/UI create Owner only. - Add Operator-key Python example (the only path). - Fix Python list_keys (key.api_key.id, not key.api_key_id). - Fix Go ListKeys field access (key.APIKey.ID, not key.APIKeyID). - Fix Go RotateKey return order (id, key — not key, id). - Fix Go RenameKey return arity (returns (string, string, error)). - Update CLI output blocks to actual format (Key Value, success+warning lines). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for viam-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hey @shannonbradshaw — CI is green and no reviewer is assigned yet. Could you request one when you have a chance? Auto-comment from overwatch. Will not re-nudge for 7 days. |
The Viam app's create-key form has a Role dropdown supporting Owner or Operator (org and location forms both use roleNames = [RoleName.OWNER, RoleName.OPERATOR]), and the Go SDK exposes AuthRoleOperator alongside AuthRoleOwner. Only the CLI is hardcoded to Owner. Replace the "Python SDK is the only path to Operator-role keys" framing with a matrix that names the actual limitation (CLI), and reframe the Operator example as one SDK example among the supported paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Hey @shannonbradshaw — CI is green and no reviewer is assigned yet. Could you request one when you have a chance? Auto-comment from overwatch. Will not re-nudge for 7 days. |
1 similar comment
|
Hey @shannonbradshaw — CI is green and no reviewer is assigned yet. Could you request one when you have a chance? Auto-comment from overwatch. Will not re-nudge for 7 days. |
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
viam organizations api-key create,locations api-key create, andmachines api-key createall hardcode*_owner(no--roleflag), and the Web UI also creates Owner only (TODO comment inapp/ui/src/.../create-api-key.svelte:93). Operator-role keys are reachable only through the Python SDK withAPIKeyAuthorization(role="operator", ...). Split the section into "Choose the right scope" (scope-only table) and "Choose the role" (Owner vs Operator with the limitation called out), and added a concrete Operator-key Python example.list_keys—key.api_key_id/key.namewould AttributeError; correct fields arekey.api_key.id/key.api_key.name(viam-python-sdk:src/viam/app/app_client.py:2556,api/proto/viam/app/v1/app.proto:1884,961).ListKeys—key.APIKeyID/key.Namedoesn't compile;APIKeyWithAuthorizationsexposesAPIKey *APIKey(rdk/app/app_client.go:280-291).RotateKey— variablesnewKey, newKeyIDwere swapped; signature returns(id, key, error)(rdk/app/app_client.go:2868-2876).RenameKey—err :=is a compile error; signature returns(string, string, error)(rdk/app/app_client.go:2848-2857).Key:is wrong; actual field label isKey Value:, plus the prefix and warning lines (rdk/cli/auth.go:330-333,410-413,474-477).Test plan
vale docs/organization/api-keys.mdpasses (0 errors)npx prettier --checkpassesnpx markdownlint-clipassesmake build-prodbuilds clean/organization/overview/,#create-an-operator-role-key,/organization/rbac/,/organization/overview/#cli-authentication)ast.parseclean🤖 Generated with Claude Code