-
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 1ae7fba
Showing
10 changed files
with
99 additions
and
24 deletions.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
src/main/java/net/snowflake/client/core/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,69 @@ | ||
package net.snowflake.client.core; | ||
/* | ||
* Copyright (c) 2024 Snowflake Computing Inc. All right reserved. | ||
*/ | ||
|
||
import javax.annotation.Nullable; | ||
import java.util.Map; | ||
|
||
@SnowflakeJdbcInternalApi | ||
public class ClientAuthnDTO { | ||
|
||
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, | ||
} | ||
|
||
// 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; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/net/snowflake/client/core/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,19 @@ | ||
package net.snowflake.client.core; | ||
|
||
@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 | ||
} |
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
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
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