Skip to content

Commit

Permalink
refactor(redshift-property, ssl_insecure): use ssl_insecure rather th…
Browse files Browse the repository at this point in the history
…an sslInsecure in internal code
  • Loading branch information
Brooke-white committed Jun 23, 2021
1 parent ed67944 commit 5ac4bda
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion redshift_connector/iam_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def set_iam_properties(
info.allow_db_user_override = allow_db_user_override

if ssl_insecure is not None:
info.sslInsecure = ssl_insecure
info.ssl_insecure = ssl_insecure

# Azure specified parameters
info.client_id = client_id
Expand Down
6 changes: 3 additions & 3 deletions redshift_connector/plugin/saml_credentials_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self: "SamlCredentialsProvider") -> None:
self.idpPort: int = 443
self.duration: typing.Optional[int] = None
self.preferred_role: typing.Optional[str] = None
self.sslInsecure: typing.Optional[bool] = None
self.ssl_insecure: typing.Optional[bool] = None
self.db_user: typing.Optional[str] = None
self.db_groups: typing.List[str] = list()
self.force_lowercase: typing.Optional[bool] = None
Expand All @@ -42,7 +42,7 @@ def add_parameter(self: "SamlCredentialsProvider", info: RedshiftProperty) -> No
self.idpPort = info.idpPort
self.duration = info.duration
self.preferred_role = info.preferred_role
self.sslInsecure = info.sslInsecure
self.ssl_insecure = info.ssl_insecure
self.db_user = info.db_user
self.db_groups = info.db_groups
self.force_lowercase = info.force_lowercase
Expand All @@ -51,7 +51,7 @@ def add_parameter(self: "SamlCredentialsProvider", info: RedshiftProperty) -> No
self.principal = info.principal

def do_verify_ssl_cert(self: "SamlCredentialsProvider") -> bool:
return not self.sslInsecure
return not self.ssl_insecure

def get_credentials(self: "SamlCredentialsProvider") -> CredentialsHolder:
key: str = self.get_cache_key()
Expand Down
2 changes: 1 addition & 1 deletion redshift_connector/redshift_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class RedshiftProperty:
# The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the IdP.
principal: typing.Optional[str] = None
# This property indicates whether the IDP hosts server certificate should be verified.
sslInsecure: bool = True
ssl_insecure: bool = True
# The Okta-provided unique ID associated with your Redshift application.
app_id: typing.Optional[str] = None
# The name of the Okta application that you use to authenticate the connection to Redshift.
Expand Down
2 changes: 1 addition & 1 deletion test/unit/helpers/idp_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def make_redshift_property() -> RedshiftProperty:
rp.idp_host = "8000"
rp.duration = 100
rp.preferred_role = "analyst"
rp.sslInsecure = False
rp.ssl_insecure = False
rp.db_user = "primary"
rp.db_groups = ["employees"]
rp.force_lowercase = True
Expand Down

0 comments on commit 5ac4bda

Please sign in to comment.