Skip to content

Commit

Permalink
Use newer methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jmichalak committed Jul 5, 2024
1 parent 6f18db2 commit c4fa972
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ resource "snowflake_api_authentication_integration_with_authorization_code_grant
- `comment` (String) Specifies a comment for the integration.
- `oauth_access_token_validity` (Number) Specifies the default lifetime of the OAuth access token (in seconds) issued by an OAuth server.
- `oauth_allowed_scopes` (Set of String) Specifies a list of scopes to use when making a request from the OAuth by a role with USAGE on the integration during the OAuth client credentials flow.
- `oauth_authorization_endpoint` (String) Specifies the URL for authenticating to the external service.
- `oauth_client_auth_method` (String) Specifies that POST is used as the authentication method to the external service. Valid options are: [CLIENT_SECRET_POST]
- `oauth_grant` (String) Specifies the type of OAuth flow.
- `oauth_authorization_endpoint` (String) Specifies the URL for authenticating to the external service. If removed from the config, the resource is recreated.
- `oauth_client_auth_method` (String) Specifies that POST is used as the authentication method to the external service. If removed from the config, the resource is recreated. Valid values are (case-insensitive): `CLIENT_SECRET_POST`.
- `oauth_grant` (String) Specifies the type of OAuth flow. If removed from the config, the resource is recreated. Valid values are (case-insensitive): AUTHORIZATION_CODE.
- `oauth_refresh_token_validity` (Number) Specifies the value to determine the validity of the refresh token obtained from the OAuth server.
- `oauth_token_endpoint` (String) Specifies the token endpoint used by the client to obtain an access token by presenting its authorization grant or refresh token. The token endpoint is used with every authorization grant except for the implicit grant type (since an access token is issued directly).
- `oauth_token_endpoint` (String) Specifies the token endpoint used by the client to obtain an access token by presenting its authorization grant or refresh token. The token endpoint is used with every authorization grant except for the implicit grant type (since an access token is issued directly). If removed from the config, the resource is recreated.

### Read-Only

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ resource "snowflake_api_authentication_integration_with_client_credentials" "tes
- `comment` (String) Specifies a comment for the integration.
- `oauth_access_token_validity` (Number) Specifies the default lifetime of the OAuth access token (in seconds) issued by an OAuth server.
- `oauth_allowed_scopes` (Set of String) Specifies a list of scopes to use when making a request from the OAuth by a role with USAGE on the integration during the OAuth client credentials flow.
- `oauth_client_auth_method` (String) Specifies that POST is used as the authentication method to the external service. Valid options are: [CLIENT_SECRET_POST]
- `oauth_grant` (String) Specifies the type of OAuth flow.
- `oauth_client_auth_method` (String) Specifies that POST is used as the authentication method to the external service. If removed from the config, the resource is recreated. Valid values are (case-insensitive): `CLIENT_SECRET_POST`.
- `oauth_grant` (String) Specifies the type of OAuth flow. If removed from the config, the resource is recreated. Valid values are (case-insensitive): CLIENT_CREDENTIALS.
- `oauth_refresh_token_validity` (Number) Specifies the value to determine the validity of the refresh token obtained from the OAuth server.
- `oauth_token_endpoint` (String) Specifies the token endpoint used by the client to obtain an access token by presenting its authorization grant or refresh token. The token endpoint is used with every authorization grant except for the implicit grant type (since an access token is issued directly).
- `oauth_token_endpoint` (String) Specifies the token endpoint used by the client to obtain an access token by presenting its authorization grant or refresh token. The token endpoint is used with every authorization grant except for the implicit grant type (since an access token is issued directly). If removed from the config, the resource is recreated.

### Read-Only

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ resource "snowflake_api_authentication_integration_with_jwt_bearer" "test" {
- `comment` (String) Specifies a comment for the integration.
- `oauth_access_token_validity` (Number) Specifies the default lifetime of the OAuth access token (in seconds) issued by an OAuth server.
- `oauth_authorization_endpoint` (String) Specifies the URL for authenticating to the external service.
- `oauth_client_auth_method` (String) Specifies that POST is used as the authentication method to the external service. Valid options are: [CLIENT_SECRET_POST]
- `oauth_grant` (String) Specifies the type of OAuth flow.
- `oauth_client_auth_method` (String) Specifies that POST is used as the authentication method to the external service. If removed from the config, the resource is recreated. Valid values are (case-insensitive): `CLIENT_SECRET_POST`.
- `oauth_grant` (String) Specifies the type of OAuth flow. If removed from the config, the resource is recreated. Valid values are (case-insensitive): JWT_BEARER.
- `oauth_refresh_token_validity` (Number) Specifies the value to determine the validity of the refresh token obtained from the OAuth server.
- `oauth_token_endpoint` (String) Specifies the token endpoint used by the client to obtain an access token by presenting its authorization grant or refresh token. The token endpoint is used with every authorization grant except for the implicit grant type (since an access token is issued directly).
- `oauth_token_endpoint` (String) Specifies the token endpoint used by the client to obtain an access token by presenting its authorization grant or refresh token. The token endpoint is used with every authorization grant except for the implicit grant type (since an access token is issued directly). If removed from the config, the resource is recreated.

### Read-Only

Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/api_authentication_integration_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ var apiAuthCommonSchema = map[string]*schema.Schema{
"oauth_token_endpoint": {
Type: schema.TypeString,
Optional: true,
Description: "Specifies the token endpoint used by the client to obtain an access token by presenting its authorization grant or refresh token. The token endpoint is used with every authorization grant except for the implicit grant type (since an access token is issued directly).",
Description: "Specifies the token endpoint used by the client to obtain an access token by presenting its authorization grant or refresh token. The token endpoint is used with every authorization grant except for the implicit grant type (since an access token is issued directly). If removed from the config, the resource is recreated.",
},
"oauth_client_auth_method": {
Type: schema.TypeString,
Optional: true,
ValidateDiagFunc: sdkValidation(sdk.ToApiAuthenticationSecurityIntegrationOauthClientAuthMethodOption),
Description: fmt.Sprintf("Specifies that POST is used as the authentication method to the external service. Valid values are (case-insensitive): %s.", possibleValuesListed(sdk.AsStringList(sdk.AllApiAuthenticationSecurityIntegrationOauthClientAuthMethodOption))),
Description: fmt.Sprintf("Specifies that POST is used as the authentication method to the external service. If removed from the config, the resource is recreated. Valid values are (case-insensitive): %s.", possibleValuesListed(sdk.AsStringList(sdk.AllApiAuthenticationSecurityIntegrationOauthClientAuthMethodOption))),
},
"oauth_access_token_validity": {
Type: schema.TypeInt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var apiAuthAuthorizationCodeGrantSchema = func() map[string]*schema.Schema {
"oauth_authorization_endpoint": {
Type: schema.TypeString,
Optional: true,
Description: "Specifies the URL for authenticating to the external service.",
Description: "Specifies the URL for authenticating to the external service. If removed from the config, the resource is recreated.",
},
"oauth_allowed_scopes": {
Type: schema.TypeSet,
Expand All @@ -35,7 +35,7 @@ var apiAuthAuthorizationCodeGrantSchema = func() map[string]*schema.Schema {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{sdk.ApiAuthenticationSecurityIntegrationOauthGrantAuthorizationCode}, true),
Description: "Specifies the type of OAuth flow.",
Description: fmt.Sprintf("Specifies the type of OAuth flow. If removed from the config, the resource is recreated. Valid values are (case-insensitive): %s.", sdk.ApiAuthenticationSecurityIntegrationOauthGrantAuthorizationCode),
},
}
return MergeMaps(apiAuthCommonSchema, apiAuthAuthorizationCodeGrant)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var apiAuthClientCredentialsSchema = func() map[string]*schema.Schema {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{sdk.ApiAuthenticationSecurityIntegrationOauthGrantClientCredentials}, true),
Description: "Specifies the type of OAuth flow.",
Description: fmt.Sprintf("Specifies the type of OAuth flow. If removed from the config, the resource is recreated. Valid values are (case-insensitive): %s.", sdk.ApiAuthenticationSecurityIntegrationOauthGrantClientCredentials),
},
}
return MergeMaps(apiAuthCommonSchema, apiAuthClientCredentials)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var apiAuthJwtBearerSchema = func() map[string]*schema.Schema {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{sdk.ApiAuthenticationSecurityIntegrationOauthGrantJwtBearer}, true),
Description: "Specifies the type of OAuth flow.",
Description: fmt.Sprintf("Specifies the type of OAuth flow. If removed from the config, the resource is recreated. Valid values are (case-insensitive): %s.", sdk.ApiAuthenticationSecurityIntegrationOauthGrantJwtBearer),
},
}
return MergeMaps(apiAuthCommonSchema, apiAuthJwtBearer)
Expand Down

0 comments on commit c4fa972

Please sign in to comment.