Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support additional connection methods #323

Open
wants to merge 44 commits into
base: main
Choose a base branch
from

Conversation

jiezhen-chen
Copy link
Contributor

@jiezhen-chen jiezhen-chen commented Feb 16, 2023

resolves #332

Description

Checklist

sathiish-kumar and others added 29 commits December 19, 2022 14:52
… define a _get_connect_method method to leverage Redshift python connector to retrieve the connect method
…h due to in-built support in Redshift Python Connector
@cla-bot cla-bot bot added the cla:yes label Feb 16, 2023
Copy link
Contributor

@colin-rogers-dbt colin-rogers-dbt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small comments, need to think about how we can add some functional testing on the new connection methods to ensure future changes don't break this

}
if method == RedshiftConnectionMethod.IAM or method == RedshiftConnectionMethod.DATABASE:
kwargs["host"] = self.credentials.host
kwargs["region"] = self.credentials.host.split(".")[2]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the user passes a region that's different from the region in the host should we raise an exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, we could also default to using region from host, in the scenario that host is provided. So if provided region and region in host are different we use the region from host. But we could also throw an error. What are your thoughts?

)
if self.credentials.role:
c.cursor().execute("set role {}".format(self.credentials.role))
return c

return connect
elif method == RedshiftConnectionMethod.IDP:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have we done any local testing of these new connection methods? Ideally we would be able to cover these with integration tests but that may be unrealistic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I've done local testing for these new connection methods. What I've done for local testing - Got some credentials from someone who manages redshift_connector and edited the profiles.yml to connect to Redshift.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how feasible integration tests are - since we got these credentials from another team and we don't own these credentials. Ideally we should spend some time to create these credentials ourselves so that the integration tests don't depend on another team - but that may be out of scope for right now.

return c

return connect
elif self.credentials.credentials_provider == "OktaCredentialsProvider":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above about testing for IDP

region=self.credentials.region,
database=self.credentials.database,
cluster_identifier=self.credentials.cluster_id,
credentials_provider="OktaCredentialsProvider",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: does this need to be hardcoded? Looks like we already check that self.credentials.credentials_provider == "OktaCredentialsProvider" above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Might also be a good idea to allow more wiggle room for the customer to use these credentials. I think we can hardcode credentials_provider="OktaCredentialsProvider" in the connection call, and allow for multiple variations of Okta from the customer(both "okta" and "oktacredentialprovider" should be accepted with case insensitivity), instead of requiring customers to input excatly "OktaCredentialsProvider"

@jaklan
Copy link

jaklan commented Jul 21, 2023

Hello guys, any chance to push it forward? We really miss the support for the generic SAML Browser IdP plugin, but the MR seems to be stale for months 😕

@misteliy
Copy link

Any update here? Especially the generic IdP is very much needed in our case - would be great to see this moving forward.

Copy link
Contributor

This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Apr 12, 2024
@jaklan
Copy link

jaklan commented Apr 12, 2024

Bump

@github-actions github-actions bot removed the Stale label Apr 13, 2024
Copy link
Contributor

This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 10, 2024
Copy link
Contributor

Although we are closing this PR as stale, it can still be reopened to continue development. Just add a comment to notify the maintainers.

@github-actions github-actions bot closed this Oct 17, 2024
@github-actions github-actions bot removed the Stale label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants