-
Notifications
You must be signed in to change notification settings - Fork 22
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
Switch Nutanix Client to use Session Auth instead of Basic Auth #398
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #398 +/- ##
==========================================
+ Coverage 25.07% 25.18% +0.11%
==========================================
Files 19 19
Lines 1332 1326 -6
==========================================
Hits 334 334
+ Misses 998 992 -6 ☔ View full report in Codecov by Sentry. |
it makes sense to have sessionAuth set when we create the first connection by getting the cookies thru /users/me call here https://github.com/nutanix-cloud-native/prism-go-client/blob/main/internal/client.go#L276 |
we need to add a test case somehow to test this as well |
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.
lets add a test case in this or thru other PR
Can you elaborate what you expect out of a test case? |
we can start with following tests:
|
a3244ff
to
e4bde64
Compare
/hold |
@thunderboltsid can we get this patch in and then add tests separately? we need to start the testing with scale test setup as well. |
any testing can be done using an image built from the branch. Merging this change alone won't fix anything. |
e4bde64
to
8fa36b1
Compare
751638d
8fa36b1
to
751638d
Compare
/retest |
751638d
to
3d7abe2
Compare
/retest |
1 similar comment
/retest |
/retest |
/retest |
1 similar comment
/retest |
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adiantum, dkoshkin, thunderboltsid The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This will ensure we make fewer basic auth requests to Prism Central IAM Services.
This will ensure we make fewer basic auth requests to Prism Central IAM Services.
This will ensure we make fewer basic auth requests to Prism Central IAM Services.
* fix: improve error handling for Prism Client (#354) * fix: use wrapper errors to clearly denote issues in client building * fix: adds a function to properly sanitize the address * fix: adds tests for ip address case given * fix: uses a defined type for port error * fix: clean up variable naming * fix: remove validation here to be moved into prism-client * refactor: task status file (#355) * test: add unit tests for pkg/client/state * refactor: use wait.Poll function waiting for task state * refactor: use consistent task status names * fixup! test: add unit tests for pkg/client/state * fix: revert to previous behaviod polling forever The ctx passed into WaitForTaskToSucceed is only used to cancel HTTP reqests and not to cancel the wait. * chore: add license headers * fix: better function name * refactor: client.go file helper methods (#360) * refactor: client.go file helper methods Refactored the existing methods and functions to be unit testable. Also made some methods that do not use the struct as generic functions. The changes were primarily an effort to add unit test coverage. * refactor: more testable read file function * test: new nutanixcluster types unit tests * test: additional test cases for errors * fixup! refactor: client.go file helper methods * fixup! refactor: client.go file helper methods * fixup! refactor: more testable read file function * fixup! refactor: client.go file helper methods * Switch Nutanix Client to using Session Auth (#398) This will ensure we make fewer basic auth requests to Prism Central IAM Services. --------- Co-authored-by: Faiq <faiq.raza@nutanix.com> Co-authored-by: Dimitri Koshkin <dimitri.koshkin@nutanix.com>
This will ensure we make fewer basic auth requests to Prism Central IAM Services.
This will ensure we make fewer basic auth requests to Prism Central IAM Services. For now this will reduce calls in a single reconcile cycle to session auth. #415 will help further optimize this by using a cache.