Repository navigation
feat(api): support project API key scope updates #4082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jbeckwith-oai
wants to merge
1
commit into
main
Choose a base branch
from
castiron/promotions/pr-251
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+120
−33
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| schema_version: 1 | ||
| generation_id: 37557256-538a-4089-92c7-6f39d87dca31 | ||
| openapi_spec_hash: b6c325f19993092615621b2fa55ace03 | ||
| openapi_transformed_spec_hash: 3dae5e7c6a7cc3df593c09d61bc62634 | ||
| generation_id: 5db14cf2-9ae8-425c-9adc-367863b168c1 | ||
| openapi_spec_hash: 474a22aec52c2f891cc87351f0026848 | ||
| openapi_transformed_spec_hash: 859d8a9b3cd9a44e73c8240fbcf371e8 | ||
| config_hash: 47b922b06d16fe0e7595c5eacbbb5495 | ||
| codegen_sha: 4385b339c0a495b9fcc22b913b174478a699d891 | ||
| codegen_hash: 58038e1d56dbd392400609695a51879d4434626f20175b12c5d93d6f77f06388 | ||
| public_codegen_sha: 63c09929569758367e2d413b5fa67c005171f861 | ||
| codegen_sha: 082683eb0d9ef5eea11546327118139cd7f65e29 | ||
| codegen_hash: f4645293de1b8dc17969ad8d0bade011436e1612b19999801b3c53035eadd6cd | ||
| public_codegen_sha: dc64d4377b79cb45c27d9728c9a5cd23d2502e66 |
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With both properties optional and no object-level constraint, this schema accepts
{}, so the generated clients exposeupdate(api_key_id=..., project_id=...)and the new tests incorrectly treat that request as successful. This contradicts the endpoint contract that at least one ofscopesorexpires_in_secondsmust be supplied and causes such calls to send an invalid no-op request that the real API rejects; encode the at-least-one constraint or validate it in both client methods.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed: this SDK currently permits an update with neither field and dispatches a request that the server rejects. The generated mock test does not establish that the real API accepts an empty update. The CLI's local guard does not fix this SDK.
The at-least-one schema/compiler constraint remains deferred while we preserve existing public request types. The smallest proposed behavioral correction is an endpoint-specific check of the effective request body before dispatch, with tests for an empty request and the valid expiry-only, scope-only, combined, and empty-scope-list cases. That proposal must also preserve supported request-body overrides; checking only named arguments would be insufficient.
No correction has been made to this SDK yet. Leaving this finding open and holding this PR from the merge queue pending agreement on that additional runtime validation versus an explicitly accepted server-validation disposition.