-
Notifications
You must be signed in to change notification settings - Fork 20
[ENG-5769] Oauth 1.0a integration #78
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
18f491f
added oauth1 implementation comatioble with zotero
opaduchak d84a2c1
added e2e test for oauth1
opaduchak 271cba0
cleaned up migrations
opaduchak f9ec901
fixed tests, made cleanup
opaduchak 8552be5
Update addon_service/authorized_storage_account/models.py
opaduchak 7db1040
fixed simpler comments
opaduchak 5375b52
fixed nitpicks
opaduchak 7c17719
fixed more nitpicks
opaduchak 6d2200f
Apply suggestions from code review
opaduchak 1ebf5d4
fixed comments
opaduchak da9b7e3
fixed tests
opaduchak 08f8d9a
more fixes to tests
opaduchak 05b1873
fixed one more naming nit
opaduchak 63d76db
fixed ExpiredTokenAccess for OAuth1.0a
opaduchak 2541c24
move zotero-specific logic to the zotero imp
aaxelb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| from addon_toolkit.interfaces.storage import StorageAddonImp | ||
|
|
||
|
|
||
| class ZoteroOrgCitationImp(StorageAddonImp): | ||
| async def get_external_account_id(self, auth_result_extras: dict[str, str]) -> str: | ||
| return auth_result_extras["userID"] | ||
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| from addon_service.addon_imp.instantiation import get_storage_addon_instance | ||
| from addon_service.authorized_storage_account.models import AuthorizedStorageAccount | ||
|
|
||
|
|
||
| async def after_successful_auth( | ||
| account: AuthorizedStorageAccount, | ||
| auth_result_extras: dict[str, str] | None = None, | ||
| ): | ||
| _imp = await get_storage_addon_instance( | ||
| account.imp_cls, # type: ignore[arg-type] | ||
| account, | ||
| account.storage_imp_config(), | ||
| ) | ||
| account.external_account_id = await _imp.get_external_account_id( | ||
| auth_result_extras or {} | ||
| ) | ||
| await account.asave() |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.