Draft: Implement support for external oauth#46
Open
wseaton wants to merge 7 commits intoandrusha:mainfrom
Open
Draft: Implement support for external oauth#46wseaton wants to merge 7 commits intoandrusha:mainfrom
wseaton wants to merge 7 commits intoandrusha:mainfrom
Conversation
|
Hey, very cool, @wseaton ! |
wseaton
commented
Jun 7, 2024
| schema: args.schema, | ||
| username: args.username, | ||
| role: args.role, | ||
| auth_type: snowflake_api::AuthType::Password(PasswordArgs { |
Contributor
Author
There was a problem hiding this comment.
Instead of having two different internal AuthType enums with slightly different purposes, what if SnowflakeApi was just generic over an AuthType trait, that implements functions for building the login flow? I think that would clean the code up a lot.
Contributor
Author
There was a problem hiding this comment.
SnowflakeApi<OAuth> where OAuth impl AuthType, etc.
wseaton
commented
Jun 7, 2024
| } | ||
| AuthType::OAuth(token) => { | ||
| log::info!("Starting session with oauth authentication"); | ||
| self.create(self.oauth_request_body(token)).await |
Contributor
Author
There was a problem hiding this comment.
Here's where we'd want to use generics on the AuthType trait and implement get_request_body for each auth type.
Contributor
|
This is very cool! Something we were looking into ourselves. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
WIP for #36
Took the liberty of refactoring some of the internal session functions along the way, opening this to discuss how that is best done mostly. Current refactoring is going to potentially result in some API breakage.
External Oauth is tested to work on my account.