Skip to content

Conversation

@sfc-gh-ext-simba-jy
Copy link
Collaborator

@sfc-gh-ext-simba-jy sfc-gh-ext-simba-jy commented Nov 1, 2025

  • Added OAuth 2.0 authentication (authorization code and client credential)
  • Added Wiremock testing
  • added the java upgrade shell scripts.

@sfc-gh-ext-simba-jy sfc-gh-ext-simba-jy requested a review from a team as a code owner November 1, 2025 11:45

if (sf->client_store_temporary_credential && getAuthenticatorType(sf->authenticator) == AUTH_EXTERNALBROWSER)
AuthenticatorType authtype = getAuthenticatorType(sf->authenticator);
if (sf->client_store_temporary_credential)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please provide a list of supported authentication types that allow for secure credential storage. Then, check if the specified authtype is on this list. This check is necessary to prevent initializing secure storage when an unsupported authenticator is used.


sf->sso_token = secure_storage_get_credential(sf->token_cache, sf->host, sf->user, ID_TOKEN);

if (authtype == AUTH_EXTERNALBROWSER) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you rewrite it to use switch?

if (json_copy_string(&auth_token, data, "idToken") == SF_JSON_ERROR_NONE && sf->token_cache) {
secure_storage_save_credential(sf->token_cache, sf->host, sf->user, ID_TOKEN, auth_token);
if (sf->token_cache) {
if (json_copy_string(&auth_token, data, "idToken") == SF_JSON_ERROR_NONE) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we have switch here?

alloc_buffer_and_copy(&sf->oauth_scope, value);
break;
case SF_CON_SINGLE_USE_REFRESH_TOKEN:
alloc_buffer_and_copy(&sf->oauth_scope, value);
Copy link
Collaborator

Choose a reason for hiding this comment

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

oauth_scope -> single_use_refresh_token

*value = sf->oauth_scope;
break;
case SF_CON_SINGLE_USE_REFRESH_TOKEN:
*value = &sf->client_store_temporary_credential;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems that it's incorrect. Shouldn't it update single_use_refresh_token?

@@ -0,0 +1,72 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rename the file to snowflake_oauth_login_successful.json

{
"mappings": [
{
"scenarioName": "Refresh expired access token",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Scenario name seems to be detached from the mapping itself. Can we have it renamed? Same for the file, can we use e.g. snowflake_oauth_login_failed_expired_token?

void startWebBrowser(const std::string& url) override
{

CXX_LOG_TRACE("sf::AuthenticationWebBrowserTestRunner::running curl to open a browser::%s", url.c_str());
Copy link
Collaborator

Choose a reason for hiding this comment

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

running curl to open a browser -> running curl instead opening a browser?

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.

4 participants