This repository was archived by the owner on Sep 8, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 53
feat: add admin bindings (Sourcery refactored) #215
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3000434 to
60d3f7a
Compare
| if not jwt: | ||
| session = self.get_session() | ||
| if session: | ||
| if session := self.get_session(): |
Contributor
Author
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.
Function SyncGoTrueClient.get_user refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression)
Comment on lines
-538
to
-546
| session = self.get_session() | ||
| if not session: | ||
| if session := self.get_session(): | ||
| return self._request( | ||
| "POST", | ||
| f"factors/{params.get('factor_id')}/challenge", | ||
| jwt=session.access_token, | ||
| xform=AuthMFAChallengeResponse.parse_obj, | ||
| ) | ||
| else: | ||
| raise AuthSessionMissingError() | ||
| return self._request( | ||
| "POST", | ||
| f"factors/{params.get('factor_id')}/challenge", | ||
| jwt=session.access_token, | ||
| xform=AuthMFAChallengeResponse.parse_obj, | ||
| ) |
Contributor
Author
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.
Function SyncGoTrueClient._challenge refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression) - Lift code into else after jump in control flow (
reintroduce-else) - Swap if/else branches (
swap-if-else-branches)
Comment on lines
-582
to
-590
| session = self.get_session() | ||
| if not session: | ||
| if session := self.get_session(): | ||
| return self._request( | ||
| "DELETE", | ||
| f"factors/{params.get('factor_id')}", | ||
| jwt=session.access_token, | ||
| xform=AuthMFAUnenrollResponse.parse_obj, | ||
| ) | ||
| else: | ||
| raise AuthSessionMissingError() | ||
| return self._request( | ||
| "DELETE", | ||
| f"factors/{params.get('factor_id')}", | ||
| jwt=session.access_token, | ||
| xform=AuthMFAUnenrollResponse.parse_obj, | ||
| ) |
Contributor
Author
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.
Function SyncGoTrueClient._unenroll refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression) - Lift code into else after jump in control flow (
reintroduce-else) - Swap if/else branches (
swap-if-else-branches)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request #196 refactored by Sourcery.
If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
j0/add_mfa_bindingsbranch, then run:Help us improve this pull request!