Closed buger closed 1 month ago
API Changes
no api changes detected
β±οΈ Estimated effort to review [1-5] | 3 |
π§ͺ Relevant tests | Yes |
π Security concerns | No |
β‘ Key issues to review |
Possible Bug: The new method deleteRawKeysWithAllowanceScope checks if store or session is nil and returns immediately without any error handling or logging. This could potentially hide issues where these parameters are unexpectedly nil . |
Code Clarity: The method deleteRawKeysWithAllowanceScope could benefit from some comments explaining the logic, especially why it's necessary to check for an empty AllowanceScope and skip deletion. |
Category | Suggestion | Score |
Possible bug |
Add a nil check for
___
**To avoid potential nil pointer dereference, add a nil check for | 10 |
Add a check for an empty
___
**Consider checking for an empty | 9 | |
Best practice |
Add error handling for
___
**It's recommended to handle potential errors from | 8 |
Enhancement |
Modify the loop to break after processing the first non-empty
___
**To enhance the efficiency of the loop that checks | 4 |
Failed conditions
31.5% Coverage on New Code (required β₯ 80%)
C Reliability Rating on New Code (required β₯ A)
See analysis details on SonarCloud
Catch issues before they fail your Quality Gate with our IDE extension
SonarLint
User description
fix unnecessary call to DeleteRawKey if no allowance scope is defined (#6373)
User description
This PR fixes an issue where
DeleteRawKey
is called multiple times for AllowanceScopes that are non-existent.Types of changes
PR Type
Bug fix, Tests
Description
deleteRawKeysWithAllowanceScope
inDefaultSessionManager
to handle deletion of raw keys with allowance scopes.ResetQuota
to use the new method for better handling of raw key deletions.Changes walkthrough π
auth_manager.go
Add method to handle raw key deletion with allowance scopes
gateway/auth_manager.go
deleteRawKeysWithAllowanceScope
to handle deletionof raw keys with allowance scopes.
ResetQuota
to use the new method.auth_manager_test.go
Add unit tests for deleteRawKeysWithAllowanceScope method
gateway/auth_manager_test.go
deleteRawKeysWithAllowanceScope
method.countingStorageHandler
to count delete operations.and sessions with/without allowance scopes.
PR Type
Bug fix, Tests
Description
deleteRawKeysWithAllowanceScope
inDefaultSessionManager
to handle deletion of raw keys with allowance scopes.ResetQuota
to use the new method for better handling of raw key deletions.Changes walkthrough π
auth_manager.go
Add method to handle raw key deletion with allowance scopes
gateway/auth_manager.go
deleteRawKeysWithAllowanceScope
method to handle raw keydeletion with allowance scopes.
ResetQuota
to use the new method.auth_manager_test.go
Add unit tests for deleteRawKeysWithAllowanceScope method
gateway/auth_manager_test.go
deleteRawKeysWithAllowanceScope
method.countingStorageHandler
for test purposes.