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-1799839: Authenticated Snowflake Rest API requests via JWT generation in SDK. #956

Open
mbrimmer83 opened this issue Nov 12, 2024 · 3 comments
Assignees
Labels
enhancement The issue is a request for improvement or a new feature status-triage_done Initial triage done, will be further handled by the driver team

Comments

@mbrimmer83
Copy link

What is the current behavior?

The current sdk can use JWT to secure connections to Snowflake, but provides no way to reuse this authentication for utilizing rest-api services provided by Snowflake even though the authentication is the same for rest-api's.

I haven't found a way to utilize the SDK to authenticate rest-api requests and have resorted to generating my own tokens the same way the SDK generates tokens.

What is the desired behavior?

Expose Authentication functions for generating JWT for use in querying Snowflake rest-api services. Another option would be to expose an authenticated "fetch" function that handles generating the token and placing it in the headers.

How would this improve snowflake-connector-nodejs?

Extends The SDK and allows the use of additional services provided by Snowflake.

References, Other Background

@github-actions github-actions bot changed the title Authenticated Snowflake Rest API requests via JWT generation in SDK. SNOW-1799839: Authenticated Snowflake Rest API requests via JWT generation in SDK. Nov 12, 2024
@sfc-gh-dszmolka sfc-gh-dszmolka self-assigned this Nov 12, 2024
@sfc-gh-dszmolka sfc-gh-dszmolka added the status-triage_done Initial triage done, will be further handled by the driver team label Nov 12, 2024
@sfc-gh-dszmolka
Copy link
Collaborator

sfc-gh-dszmolka commented Nov 12, 2024

hi - thanks for raising this. While i fully understand how this would be beneficial, and is generally a good idea, i'm not entirely sure it's related to this very library in which the request is raised. I mean, wouldn't that be analogous to authenticating with

  • Snowflake Go driver
  • Snowflake JDBC driver
  • Snowflake Python driver
  • Snowflake .NET driver
  • etc...
    then using the respective programming language's http-speaking library to talk to Snowflake's REST API, using the same authentication token which was acquired from the driver ?

I think this request might not be at the best place with the node.js driver, because it is not really related to one specific programming language or driver. More likely, a use-case instead.

Do I understand this requirement correctly? If so, I would request you to please raise it with your account team, who can then coordinate the work necessary between the teams to have this implemented across all Snowflake drivers.

edit: for the 'generating JWT with the SDK' part - I think what you're doing now, generating your own JWT, is the intended and documented way of authenticating into Snowflake's REST API's. Please see examples at Using key-pair authentication (Python, Java, Node.js and for whom the CLI is more convenient; SnowSQL)

@sfc-gh-dszmolka sfc-gh-dszmolka added enhancement The issue is a request for improvement or a new feature status-information_needed Additional information is required from the reporter labels Nov 12, 2024
@mbrimmer83
Copy link
Author

Thank you for the explanation. I understand the point about this being a broader use case across multiple drivers. However, as a developer, I don’t interact with account representatives, so I don’t have a direct line to raise these types of requests.

Would it be possible for you to forward this feedback to the appropriate team internally? That way is can be discussed internally as to whether this functionality would benefit Snowflake users.

@sfc-gh-dszmolka
Copy link
Collaborator

sfc-gh-dszmolka commented Nov 13, 2024

The request is already with the respective team. The sole reason i suggested reaching out to your Snowflake Account Team is because they have a deeper voice ;) and have data at their disposal which can help certain requests getting prioritized, if that's the goal here. I understand this is not applicable in your situation.

Otherwise, we'll get to this, eventually.

@sfc-gh-dszmolka sfc-gh-dszmolka removed the status-information_needed Additional information is required from the reporter label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is a request for improvement or a new feature status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

3 participants