Skip to content

[WIP] Add support for configuring Google OAuth logins#292

Closed
alexpdp7 wants to merge 1 commit into
src-d:masterfrom
alexpdp7:oauth_google
Closed

[WIP] Add support for configuring Google OAuth logins#292
alexpdp7 wants to merge 1 commit into
src-d:masterfrom
alexpdp7:oauth_google

Conversation

@alexpdp7
Copy link
Copy Markdown

@alexpdp7 alexpdp7 commented Oct 2, 2019

Known issues:

  • Upon registration/login you are redirected to an ugly error message.
    If you change the URL you can access the application and things are
    working, though

  • User cannot access the user list!

  • No documentation for the new environment variables

Signed-off-by: Alex Corcoles alex@pdp7.net


  • I have updated the CHANGELOG file according to the conventions in keepachangelog.com
  • This PR contains changes that do not require a mention in the CHANGELOG file

@se7entyse7en se7entyse7en changed the title Add support for configuring Google OAuth logins [WIP] Add support for configuring Google OAuth logins Oct 2, 2019
# Should match `--timeout` value of gunicorn
SUPERSET_WEBSERVER_TIMEOUT = 300

if get_env_variable('OAUTH_PROVIDER', False) == 'google':
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe we should exit with an error if OAUTH_PROVIDER value is unknown.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I've done a draft implementation of that, although I don't love it

'remote_app': {
'consumer_key': get_env_variable('OAUTH_CONSUMER_KEY'),
'consumer_secret': get_env_variable('OAUTH_CONSUMER_SECRET'),
'base_url':'https://www.googleapis.com/oauth2/v2/',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please format the code

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It passes flake8 now (I didn't find a specific flake8 config in the repo)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

flake8 and pylint look fine for this change (although I'm not 100% familiar with pylint).

This file doesn't follow black conventions, so I'd leave it as-is, but if you want, I can introduce a commit before applying black to the existing file, then add my change with black conventions.

@se7entyse7en
Copy link
Copy Markdown
Contributor

From [private] slack:

IMO it makes sense to open a PR on sourced-ui pointing to your PR 👍:skin-tone-4: where we could eventually add some refinements

Actually I meant issue 😅 but I wrote PR. I think that we could use this as a base and take ownership. But there's no urgency for this to be included now.

Known issues:

* Upon registration/login you are redirected to an ugly error message.
  If you change the URL you can access the application and things are
  working, though

* User cannot access the user list!

* No documentation for the new environment variables

Signed-off-by: Alex Corcoles <alex@pdp7.net>
@alexpdp7
Copy link
Copy Markdown
Author

alexpdp7 commented Oct 2, 2019

Actually I meant issue sweat_smile but I wrote PR. I think that we could use this as a base and take ownership. But there's no urgency for this to be included now.

Don't worry, it took minutes to do it. It still lacks documentation but at least you have something to start with, I guess

@smacker
Copy link
Copy Markdown
Contributor

smacker commented Oct 17, 2019

I have weird conflicts when I try to checkout to this branch which are related to the merge of new superset into srcd-ui.
Code looks good for me. Do you guys think we can just merge it and add docs/fix redirect in a separate commit?

//cc @alexpdp7 @se7entyse7en

@alexpdp7
Copy link
Copy Markdown
Author

Forks make my head hurt. Normally I wouldn't merge code which is not "ready", but I would ignore my principles to avoid having to deal with forks...

@smacker
Copy link
Copy Markdown
Contributor

smacker commented Oct 17, 2019

another option, I can just close it, copy-paste the code into my PR and take all the praise for the implementation of the feature 😝

@alexpdp7
Copy link
Copy Markdown
Author

:D

I really don't mind. I've had success with using git format-patch / am to get out of these situations. But I'm not proud of that- I feel like I'm doing a dumb thing instead of the "proper" solution.

@se7entyse7en
Copy link
Copy Markdown
Contributor

hahaha

I'd vote for this BTW:

another option, I can just close it, copy-paste the code into my PR and take all the praise for the implementation of the feature 😝

😂

I prefer to avoid having non-properly ready things.

@smacker smacker closed this Oct 18, 2019
@smacker smacker mentioned this pull request Oct 18, 2019
2 tasks
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.

3 participants