-
Notifications
You must be signed in to change notification settings - Fork 0
implement client for groups #12
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
examples/group_api_example.py
Dismissed
| auth.set_client_secret("<your_client_secret_here>") | ||
| # Checks if token is expired if not return ('x-access-token', <token>) | ||
| # if expired, request a new token from reva | ||
| auth_token = auth.get_token() |
Check warning
Code scanning / CodeQL
Variable defined multiple times Warning
redefined
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 15 hours ago
The best way to fix the problem without changing existing functionality is to make it clear that the two assignment options for auth_token are alternatives, not to be used together. The standard approach is to comment out one option and explain in the comments that the user should choose based on their scenario. To fix this, comment out the first assignment to auth_token on line 30 and add a brief comment to indicate that the user should uncomment the relevant line depending on whether they want to use credentials or an existing reva token. This preserves context and clarifies intent for anyone using or reading the example, ensuring no redundant assignment occurs.
All the changes are made only within the provided code block in examples/group_api_example.py, at and around lines 30 and 36.
-
Copy modified lines R30-R31 -
Copy modified lines R33-R35
| @@ -27,11 +27,12 @@ | ||
| auth.set_client_secret("<your_client_secret_here>") | ||
| # Checks if token is expired if not return ('x-access-token', <token>) | ||
| # if expired, request a new token from reva | ||
| auth_token = auth.get_token() | ||
| # Option 1: Authenticate via configured client id/secret | ||
| # auth_token = auth.get_token() | ||
|
|
||
| # OR if you already have a reva token | ||
| # Checks if token is expired if not return (x-access-token', <token>) | ||
| # if expired, throws an AuthenticationException (so you can refresh your reva token) | ||
| # Option 2: OR if you already have a reva token | ||
| # Checks if token is expired; if not, returns ('x-access-token', <token>) | ||
| # If expired, throws an AuthenticationException (so you can refresh your reva token) | ||
| token = "<your_reva_token>" | ||
| auth_token = Auth.check_token(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.
This is an example, doesn't make sense.
Implements the group functions in the client, along with an example and tests.
Functions