Skip to content

Commit

Permalink
fix(ingest): snowflake - fix oauth config validation (#5796)
Browse files Browse the repository at this point in the history
  • Loading branch information
rslanka authored Sep 1, 2022
1 parent dbcd309 commit af1fc8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion metadata-ingestion/src/datahub/configuration/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class OauthConfiguration(ConfigModel):
scopes: Optional[List[str]] = Field(
description="scopes required to connect to snowflake"
)
use_certificate: Optional[bool] = Field(
use_certificate: bool = Field(
description="Do you want to use certificate and private key to authenticate using oauth",
default=False,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ def authenticator_type_is_valid(cls, v, values, field):
f"but should be set when using {v} authentication"
)
if values.get("oauth_config").use_certificate is True:
if values.get("oauth_config").base64_encoded_oauth_private_key is None:
if values.get("oauth_config").encoded_oauth_private_key is None:
raise ValueError(
"'base64_encoded_oauth_private_key' was none "
"but should be set when using certificate for oauth_config"
)
if values.get("oauth").base64_encoded_oauth_public_key is None:
if values.get("oauth").encoded_oauth_public_key is None:
raise ValueError(
"'base64_encoded_oauth_public_key' was none"
"but should be set when using use_certificate true for oauth_config"
Expand Down

0 comments on commit af1fc8d

Please sign in to comment.