-
Notifications
You must be signed in to change notification settings - Fork 67
Add ReadKeys
and RotateKeys
methods and extend ConnectionOptions
with TokenEndpointAuthMethod
and TokenEndpointAuthSigningAlg
in ConnectionManager
#559
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
base: main
Are you sure you want to change the base?
Conversation
…ng public keys used in JWT verification. Extended ConnectionOptionsOIDC and ConnectionOptionsOkta with support for TokenEndpointAuthMethod and TokenEndpointAuthSigningAlg.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #559 +/- ##
==========================================
+ Coverage 95.89% 95.92% +0.03%
==========================================
Files 60 60
Lines 11852 11940 +88
==========================================
+ Hits 11366 11454 +88
Misses 366 366
Partials 120 120 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Included requests and responses for creating a connection, retrieving keys, rotating keys, and deleting connections.
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.
Pull Request Overview
Adds support in the Management API client for fetching and rotating a connection’s public keys, and extends OIDC/Okta connection options with token endpoint authentication settings.
- Introduce
ConnectionKey
type andReadKeys
/RotateKeys
methods inConnectionManager
with corresponding client, model, and test code. - Extend
ConnectionOptionsOIDC
andConnectionOptionsOkta
withTokenEndpointAuthMethod
andTokenEndpointAuthSigningAlg
fields, along with getters and tests. - Add HTTP录像 files for
ReadKeys
andRotateKeys
endpoints to exercise integration behavior.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
management/connection.go | Defined ConnectionKey struct; added ReadKeys and RotateKeys . |
management/management.gen.go | Generated getters for ConnectionKey and new token endpoint fields. |
management/management.gen_test.go | Added tests for all new getters (no assertions included). |
management/connection_test.go | Added integration tests for ReadKeys and RotateKeys . |
test/data/recordings/TestConnectionManager_* | Recorded HTTP interactions for the new key-management endpoints. |
Comments suppressed due to low confidence (1)
management/management.gen_test.go:3296
- These getter tests call the method but never assert the returned value. Add assertions for the non-nil, nil, and zero-value cases to verify each getter behaves as expected.
func TestConnectionKey_GetAlgorithm(tt *testing.T) {
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.
Pull Request Overview
This PR introduces two new methods, ReadKeys and RotateKeys, to the ConnectionManager to fetch and rotate public keys for JWT verification. It also extends ConnectionOptionsOIDC and ConnectionOptionsOkta with two new configuration fields: TokenEndpointAuthMethod and TokenEndpointAuthSigningAlg.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
test/data/recordings/TestConnectionManager_RotateKeys.yaml | New recorded interactions for rotating connection keys. |
test/data/recordings/TestConnectionManager_ReadKeys.yaml | New recorded interactions for reading connection keys. |
management/management.gen_test.go | Added unit tests for new getter methods on ConnectionKey and extended connection options. |
management/management.gen.go | Added getter methods for ConnectionKey and new methods for reading and rotating connection keys. |
management/connection_test.go | Updated tests to validate the ReadKeys and RotateKeys methods. |
management/connection.go | Extended connection options with token endpoint configuration fields and implemented ReadKeys/RotateKeys. |
Comments suppressed due to low confidence (2)
management/management.gen_test.go:3302
- Consider adding assertions that verify the expected default return values (e.g., empty string or false) when invoking the getter methods on a nil receiver instead of just calling the methods.
c = nil
c.GetAlgorithm()
management/connection_test.go:1343
- Consider employing more specific assertions to verify key rotation behavior, such as asserting that the rotated key is present in the post-rotation key set, rather than relying solely on a difference in array lengths.
assert.NotEqual(t, len(beforeKeys), len(afterKeys), "Keys should be different after rotation")
🔧 Changes
ReadKeys
andRotateKeys
methods toConnectionManager
to support public key retrieval and rotation for JWT verification.ConnectionOptionsOIDC
andConnectionOptionsOkta
to supportTokenEndpointAuthMethod
andTokenEndpointAuthSigningAlg
configuration.📚 References
🔬 Testing
ReadKeys
implemented using recorded YAML interactions.📝 Checklist