Skip to content

remove-apikey-self: stop reading the API key from meshStack, show the client version hint - #65

Merged
grubmeshi merged 5 commits into
mainfrom
feature/remove-apikey-self
Nov 3, 2026
Merged

grubmeshi merged 5 commits into
mainfrom
feature/remove-apikey-self

Conversation

@grubmeshi

@grubmeshi grubmeshi commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

remove-apikey-self

meshStack removes the preview endpoint GET /api/meshobjects/meshapikeys/self (ClickUp). Its only caller was meshstack auth status. meshStack also adds clientVersionHint to every 4xx error body under /api when the meshStack CLI is older than v0.9.0 or the Terraform provider is older than its minimum version. clientVersionHint replaces terraformProviderVersionHint, which no client read.

  • ReadSelf is removed from client.MeshApiKeyClient, and ApiKeyPermissions.Only with it. This changes the public Go client; the Terraform provider only had a mock for ReadSelf.
  • auth status, profile show and profile edit read only the stored credential and its cached token. They no longer show the display name, owning workspace, expiry or permissions of an API key, and profile show no longer waits for meshStack.
  • Error bodies are parsed strictly by their fields. A known body shows its message, errorCode and errorId, and clientVersionHint on its own line. Any other body shows the status and the raw body. The Terraform provider shows errors through this client, so it shows the hint too.

Merge this PR before meshcloud/terraform-provider-meshstack#371, which pins this branch.

Cross-repo PRs

🤖 Generated with Claude Code

meshStack removes the endpoint that let an API key read itself. The status
of a credential now comes from the stored credential and the claims of its
cached token, so it makes no network call. For a new API key it shows that
no token is cached yet.

ReadSelf and the permission grouping that only the status used are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@grubmeshi
grubmeshi marked this pull request as ready for review November 2, 2026 13:14
@grubmeshi
grubmeshi force-pushed the feature/remove-apikey-self branch 3 times, most recently from d654503 to f24f71a Compare November 2, 2026 13:33
…hint

The CLI reads the error body of meshStack strictly. A known body shows its message, errorCode and errorId, and its clientVersionHint on a line of its own. A body in any other format shows the status and the raw body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@grubmeshi
grubmeshi force-pushed the feature/remove-apikey-self branch from f24f71a to d6de970 Compare November 2, 2026 13:34
@grubmeshi grubmeshi changed the title remove-apikey-self: stop reading the API key from meshStack, show the CLI version hint remove-apikey-self: stop reading the API key from meshStack, show the client version hint Nov 2, 2026
@grubmeshi
grubmeshi requested a review from nroi November 2, 2026 19:33
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@meshcloud-gh-actions

meshcloud-gh-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Coverage of the acceptance run against the meshStack backend, on 85863f254cbfa239ad39ad5221284ac29afcc388.

Scope Coverage
Unit tests 77.8%
Acceptance tests 55.3%
Combined 80.5%
Uncovered functions
client/api_key.go:52: meshApiKeyClient.Create 0.0%
client/api_key.go:56: meshApiKeyClient.Read 0.0%
client/api_key.go:60: meshApiKeyClient.Update 0.0%
client/api_key.go:64: meshApiKeyClient.Delete 0.0%
client/api_key_permissions.go:20: ApiKeyPermissions.AllCodes 0.0%
client/api_key_permissions.go:33: ApiKeyPermissions.WorkspaceCodes 0.0%
client/api_key_permissions.go:262: AllApiKeyPermissions 0.0%
client/api_key_permissions.go:266: WorkspacePermissionCodes 0.0%
client/building_block_definition.go:71: MeshBuildingBlockDefinitionApprovalPolicies.NothingRequiresApproval 0.0%
client/building_block_definition.go:82: DisabledSchedule 0.0%
client/building_block_definition.go:89: MeshBuildingBlockDefinitionSchedule.IsDisabled 0.0%
client/building_block_definition.go:93: MeshBuildingBlockDefinitionSpec.HasNeutralPolicies 0.0%
client/building_block_definition.go:97: MeshBuildingBlockDefinitionSpec.WithNeutralPolicies 0.0%
client/building_block_definition.go:166: meshBuildingBlockDefinitionClient.List 0.0%
client/building_block_definition.go:173: meshBuildingBlockDefinitionClient.Read 0.0%
client/building_block_definition.go:177: meshBuildingBlockDefinitionClient.Create 0.0%
client/building_block_definition.go:181: meshBuildingBlockDefinitionClient.Update 0.0%
client/building_block_definition.go:185: meshBuildingBlockDefinitionClient.Delete 0.0%
client/building_block_definition_version.go:100: MeshBuildingBlockType.TagInputTargets 0.0%
client/building_block_definition_version.go:245: meshBuildingBlockDefinitionVersionClient.Create 0.0%
client/building_block_definition_version.go:254: meshBuildingBlockDefinitionVersionClient.Update 0.0%
client/building_block_definition_version_implementation.go:80: MeshBuildingBlockDefinitionImplementation.InferType 0.0%
client/building_block_definition_version_implementation.go:94: MeshBuildingBlockDefinitionImplementation.MarshalJSON 0.0%
client/building_block_definition_version_implementation.go:107: *MeshBuildingBlockDefinitionImplementation.UnmarshalJSON 0.0%
client/building_block_runner.go:87: meshBuildingBlockRunnerClient.Create 0.0%
... and 131 more

covdata func names a method without its receiver, so an entry can belong to an implementation nothing selects rather than to a function the tests never reached. Open the file and line before reading one as a coverage gap.

@nroi nroi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm, just 2 remarks.

Comment thread cmd/api/api.go Resolved
Comment thread internal/http/http_error.go Resolved
grubmeshi and others added 2 commits November 3, 2026 13:26
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

@grubmeshi
grubmeshi merged commit 85863f2 into main Nov 3, 2026
13 checks passed
@grubmeshi
grubmeshi deleted the feature/remove-apikey-self branch November 3, 2026 19:32
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.

2 participants