fix(sync): treat cloud API key as opaque credential#75
Merged
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (7 files)
Reviewed by nemotron-3-super-120b-a12b-20230311:free · 70,432 tokens |
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.
Pull Request Checklist
Please ensure your PR meets the following requirements:
Summary
This PR changes Keystone cloud sync authentication so
KEYSTONE_CLOUD_API_KEYis treated as an opaque cloud-issued credential and forwarded directly toAuthService.ExchangeCredentialascredential_base64.Motivation
site_idand secret layout.Changes
Modified Files
README.md- Documents the opaque credential contract forKEYSTONE_CLOUD_API_KEY.docs/designs/cloud-sync-ui-implementation.md- Adds credential handling guidance for cloud sync configuration.internal/config/config.go- Removes API key decoding and derivedSiteID/APISecretfields; validation now only requires a non-empty trimmed API key when sync is enabled.cmd/keystone-edge/main.go- Passes the configured API key directly into the cloud auth client.internal/cloud/auth_client.go- Forwards the opaque API key directly ascredential_base64instead of rebuilding it from parsed components.internal/config/config_test.go- Updates validation tests to accept arbitrary opaque API keys and verify trimming behavior.internal/cloud/auth_client_test.go- Replaces encoding-format tests with opaque credential pass-through tests.Added Files
None.
Deleted Files
None.
Type of Change
Impact Analysis
Breaking Changes
None.
Backward Compatibility
Backward compatible for valid cloud-issued credentials. Keystone no longer rejects credentials based on local assumptions about their internal encoding; invalid credentials are rejected by the cloud AuthService during credential exchange.
Testing
Test Environment
Local Keystone Go test environment.
Test Cases
Manual Testing Steps
Not applicable; this change is covered by Go unit/package tests.
Test Coverage
Commands run:
Screenshots / Recordings
Not applicable.
Performance Impact
Documentation
Related Issues
None.
Additional Notes
The gRPC field name remains
credential_base64because it is part of the existing cloud auth API. Keystone now treats the configured API key as the exact value to send in that field.Reviewers
N/A
Notes for Reviewers
internal/config/config.goandinternal/cloud/auth_client.go.KEYSTONE_CLOUD_API_KEYbefore sending it to cloud auth.Checklist for Reviewers