Require project IDs for CLI request scoping - #218
Open
IlyaasK wants to merge 1 commit into
Open
Conversation
Document the global project selector truthfully and use the SDK's canonical project option so request scoping continues to match the ID-only API header contract.
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
--projectflag as accepting project IDs onlyoption.WithProjectIDclient optionKERNEL_PROJECTexamples with the merged API contractWhy
X-Kernel-Project-Idis an ID selector on the merged API. Advertising project names here can scope a command incorrectly or produce a confusing not-found response. The typed SDK option also keeps client configuration aligned with generated SDK behavior.Implementation
The request still carries the same
X-Kernel-Project-Idheader. This changes the public CLI guidance and replaces the manually named header option with the SDK's first-class project option.Verification
go test -short -timeout=2m ./...go vet ./...gofmt -l cmdgit diff --checkresolveProjectSelectionCRAP 2.0; rootinitCRAP 5.8Note
Low Risk
Docs and a typed SDK client option with the same header behavior; no new resolution logic beyond existing flag/env selection.
Overview
Clarifies that global
--projectandKERNEL_PROJECTmust be project IDs, not names, so CLI guidance matches the API’sX-Kernel-Project-Idcontract and avoids misleading “name or ID” wording.When a project is selected, the authenticated client is configured with the Go SDK’s
option.WithProjectIDinstead of manually setting the project header. README andapi-keys create --project-iddocs are updated to distinguish request scoping from project-scoped API key creation; tests use*-project-idexample values.Reviewed by Cursor Bugbot for commit 666951e. Bugbot is set up for automated code reviews on this repo. Configure here.