-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-1825471: Port and remove snowflake-common auth related codebase
- Loading branch information
1 parent
a20f2cf
commit 9c728ec
Showing
11 changed files
with
159 additions
and
66 deletions.
There are no files selected for viewing
This file contains 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 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 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
50 changes: 50 additions & 0 deletions
50
src/main/java/net/snowflake/client/core/auth/AuthenticatorType.java
This file contains 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,50 @@ | ||
/* | ||
* Copyright (c) 2024 Snowflake Computing Inc. All right reserved. | ||
*/ | ||
package net.snowflake.client.core.auth; | ||
|
||
import net.snowflake.client.core.SnowflakeJdbcInternalApi; | ||
|
||
@SnowflakeJdbcInternalApi | ||
public enum AuthenticatorType { | ||
/* | ||
* regular login username+password via Snowflake, may or may not have MFA | ||
*/ | ||
SNOWFLAKE, | ||
|
||
/* | ||
* federated authentication, OKTA as IDP | ||
*/ | ||
OKTA, | ||
|
||
/* | ||
* Web browser based authenticator for SAML 2.0 compliant | ||
* service/application | ||
*/ | ||
EXTERNALBROWSER, | ||
|
||
/* | ||
* OAUTH 2.0 flow | ||
*/ | ||
OAUTH, | ||
|
||
/* | ||
* Snowflake local authentication using jwt token as a user credential | ||
*/ | ||
SNOWFLAKE_JWT, | ||
|
||
/* | ||
* Internal authenticator to enable id_token for web browser based authenticator | ||
*/ | ||
ID_TOKEN, | ||
|
||
/* | ||
* Authenticator to enable token for regular login with mfa | ||
*/ | ||
USERNAME_PASSWORD_MFA, | ||
|
||
/* | ||
* Authenticator to support PAT | ||
*/ | ||
PROGRAMMATIC_ACCESS_TOKEN, | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/net/snowflake/client/core/auth/ClientAuthnDTO.java
This file contains 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,27 @@ | ||
/* | ||
* Copyright (c) 2024 Snowflake Computing Inc. All right reserved. | ||
*/ | ||
package net.snowflake.client.core.auth; | ||
|
||
import java.util.Map; | ||
import javax.annotation.Nullable; | ||
import net.snowflake.client.core.SnowflakeJdbcInternalApi; | ||
|
||
@SnowflakeJdbcInternalApi | ||
public class ClientAuthnDTO { | ||
|
||
// contains all the required data for current authn step | ||
public final Map<String, Object> data; | ||
|
||
/* | ||
* current state | ||
* tokenized string with all current parameters and the authn step | ||
*/ | ||
public final String inFlightCtx; | ||
|
||
/** Required by Jackson */ | ||
public ClientAuthnDTO(Map<String, Object> data, @Nullable String inFlightCtx) { | ||
this.data = data; | ||
this.inFlightCtx = inFlightCtx; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/net/snowflake/client/core/auth/ClientAuthnParameter.java
This file contains 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,24 @@ | ||
/* | ||
* Copyright (c) 2024 Snowflake Computing Inc. All right reserved. | ||
*/ | ||
package net.snowflake.client.core.auth; | ||
|
||
import net.snowflake.client.core.SnowflakeJdbcInternalApi; | ||
|
||
@SnowflakeJdbcInternalApi | ||
public enum ClientAuthnParameter { | ||
LOGIN_NAME, | ||
PASSWORD, | ||
RAW_SAML_RESPONSE, | ||
ACCOUNT_NAME, | ||
CLIENT_APP_ID, | ||
CLIENT_APP_VERSION, | ||
EXT_AUTHN_DUO_METHOD, | ||
PASSCODE, | ||
CLIENT_ENVIRONMENT, | ||
AUTHENTICATOR, | ||
BROWSER_MODE_REDIRECT_PORT, | ||
SESSION_PARAMETERS, | ||
PROOF_KEY, | ||
TOKEN | ||
} |
Oops, something went wrong.