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

Add redshift role use option #4532

Merged
merged 13 commits into from
Jan 21, 2020

Conversation

stevebuckingham
Copy link
Contributor

@stevebuckingham stevebuckingham commented Jan 9, 2020

What type of PR is this? (check all applicable)

  • Refactor
  • Feature

Description

This is to add the ability to use IAM Roles and Users for Redshift access. It supports specifying a role and/or keys or using a role or keys already attached to the instance.

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

@stevebuckingham
Copy link
Contributor Author

Looking at this I think the failing test has nothing to do with the code in the commit - I assume there is another failure on master. Is that likely?

@arikfr
Copy link
Member

arikfr commented Jan 9, 2020

Yes, this failure is not related to your code. Sorry about this.

@@ -284,6 +349,27 @@ def configuration_schema(cls):
"required": ["dbname", "user", "password", "host", "port"],
"secret": ["password"],
}
if redshift_role_enabled:
Copy link
Member

Choose a reason for hiding this comment

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

Having all the options under one data source will make the configuration a bit confusing. Also it makes it hard to enforce required fields.

How about we create a subclass for the IAM based authentication?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure - that's a sensible option. So we end up with something like Redshift - User Login and Redshift - IAM Login.

Copy link
Member

Choose a reason for hiding this comment

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

I would go with Redshift and Redshift (IAM Login).

@stevebuckingham
Copy link
Contributor Author

I'm now making the logo work for the new version. Then it should all work.

@stevebuckingham
Copy link
Contributor Author

This should now work. I've tested it using AWS Keys. I'll make sure with roles as well.

@stevebuckingham
Copy link
Contributor Author

I've tested this using roles as well now.

Copy link
Member

@arikfr arikfr left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good. Two small suggestions on making the data source name more friendly and a question about one of the dependency additions.

requirements.txt Outdated
@@ -60,6 +60,7 @@ disposable-email-domains>=0.0.52
gevent==1.4.0
supervisor==4.1.0
supervisor_checks==0.8.1
urllib3==1.25.7
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure we need this as an explicit dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm - I think it addresses a bug raised with in a couple of places. I'll try it with just specification of the pyopenssl version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK tested it and specify of pyopenssl is enough so I have requirement requirement for specified urllib.

Copy link
Member

Choose a reason for hiding this comment

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

If it's because of #4526 then #4567 should be enough. But I'll check release notes for the other libs to see if there is anything risky there.

Copy link
Member

Choose a reason for hiding this comment

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

The cryptography upgrade looks safe, but pyopenssl has some deprecations which I'm not sure if they are supported by all the other libs we depend on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll try rerunning with just cryptography tomorrow morning - Berlin time.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! Appreciate the effort.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It worked with cryptography 2.8 and pyopenssl 19.0.0 so I've made that commit.

Copy link
Member

Choose a reason for hiding this comment

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

Great. I fixed a merge conflict and once the build finishes will merge 👍

redash/query_runner/pg.py Outdated Show resolved Hide resolved
redash/query_runner/pg.py Outdated Show resolved Hide resolved
@arikfr arikfr merged commit 56b51be into getredash:master Jan 21, 2020
@arikfr
Copy link
Member

arikfr commented Jan 21, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants