Skip to content
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

SNOW-1917265: Add OAUTH_TYPE for authorization flow #2174

Open
wants to merge 20 commits into
base: mkeller/SNOW-1825621/oauth-code-flow-support
Choose a base branch
from

Conversation

sfc-gh-pbulawa
Copy link

Please answer these questions before submitting your pull requests. Thanks!

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-1917265

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am modifying authorization mechanisms
    • I am adding new credentials
    • I am modifying OCSP code
    • I am adding a new dependency
  3. Please describe how your code solves the related issue.

    Add login body parameter with the type of OAuth used.

  4. (Optional) PR for stored-proc connector:

@@ -436,3 +436,4 @@ class IterUnit(Enum):
)

_OAUTH_DEFAULT_SCOPE = "session:role:{role}"
_OAUTH_TYPE_AUTHORIZATION_CODE = "authorization_code"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general a single leading underscore by conventions means 'internal' or 'protected', so we shouldn't use it here as we import it in another module

@@ -19,3 +19,4 @@ def test_auth_oauth():
auth.update_body(body)
assert body["data"]["TOKEN"] == token, body
assert body["data"]["AUTHENTICATOR"] == "OAUTH", body
assert body["data"]["OAUTH_TYPE"] == "authorization_code", body

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is for the existing OAuth implementation, i.e. for authentication with a pre-obtained access token

@sfc-gh-mmishchenko sfc-gh-mmishchenko force-pushed the mkeller/SNOW-1825621/oauth-code-flow-support branch from f4827ef to a850492 Compare February 12, 2025 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants