-
Notifications
You must be signed in to change notification settings - Fork 13
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
add Baearear token for jwt #407
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe recent changes enhance the authentication mechanism in the client class by prioritizing JWT over basic authentication. The logic updates ensure that when a JWT token is available, the Changes
Poem
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (2)
- cuenca/http/client.py (2 hunks)
- tests/http/test_client.py (1 hunks)
Additional comments not posted (3)
tests/http/test_client.py (1)
39-39
: LGTM! But verify the function usage in the codebase.The change in the assertion aligns with the updated authentication mechanism where JWT takes precedence over basic authentication.
However, ensure that all test cases and functions that rely on
session.auth
are updated accordingly.cuenca/http/client.py (2)
44-48
: LGTM! But verify the function usage in the codebase.The change ensures that JWT authentication takes precedence over basic authentication when both are available.
However, ensure that all function calls to
auth
are updated accordingly.Verification successful
LGTM! But verify the function usage in the codebase.
The change ensures that JWT authentication takes precedence over basic authentication when both are available.
- The
auth
property is defined and used incuenca/http/client.py
.- The behavior of the
auth
property is tested intests/http/test_client.py
.The tests ensure that the
auth
property behaves correctly when both basic authentication and JWT tokens are present.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `auth`. # Test: Search for the usage of `auth`. Expect: Only occurrences that align with the updated authentication mechanism. rg --type python -A 5 $'auth'Length of output: 59
Script:
#!/bin/bash # Description: Verify all function calls to `auth`. # Test: Search for the usage of `auth`. Expect: Only occurrences that align with the updated authentication mechanism. rg -t py -A 5 'auth'Length of output: 5423
116-118
: LGTM! But verify the function usage in the codebase.The change ensures that JWT tokens are included in the request headers, aligning with standard practices for API authentication.
However, ensure that all function calls to
request
are updated accordingly.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #407 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 49 49
Lines 1111 1112 +1
=========================================
+ Hits 1111 1112 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
return self.basic_auth if all(self.basic_auth) else None | ||
return ( | ||
self.basic_auth | ||
if all(self.basic_auth) and not self.jwt_token |
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.
me da la impresión que este método su objetivo era regresar las credenciales
Summary by CodeRabbit
New Features
Bug Fixes