-
Notifications
You must be signed in to change notification settings - Fork 171
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 d8f2882
Showing
11 changed files
with
163 additions
and
69 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; | ||
} | ||
} |
Oops, something went wrong.