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

Feature/twitter oauth #23

Merged
merged 15 commits into from
Jul 7, 2023
Merged

Conversation

phillipjf
Copy link

This MR switches Twitter login over to use Twitter OAuth2.0 for fetching the username. This is primarily for historical purposes to continue using Twitter usernames for identifying users. Due to changes with the Twitter API, the friends functionality is no longer feasible to maintain and was not exposed in the UI anyways. Flask-Dance project even removed Twitter in a recent release Flask-Dance#416

BREAKING: This MR includes a migration to remove the friends association in the DB.

Resolves #21.

phillipjf added 4 commits July 4, 2023 19:21
….txt

adds the ability to split out testing dependencies from the application runtime dependencies
the twitter api is becoming prohibitive to use so removing friends reduces dependency

BREAKING CHANGE:
@phillipjf
Copy link
Author

@joerick I think this covers everything to resolve #21. Will need to get the OAuth 2.0 Client ID and Client Secret from the Twitter Developer Portal and set the new environment variables (TWITTER_OAUTH_CLIENT_KEY, TWITTER_OAUTH_CLIENT_SECRET, OAUTH_REDIRECT_URI) accordingly.

migrations/versions/89a031bd9657_remove_friends.py Outdated Show resolved Hide resolved
migrations/versions/89a031bd9657_remove_friends.py Outdated Show resolved Hide resolved
sirius/web/twitter.py Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@joerick
Copy link
Member

joerick commented Jul 6, 2023

If you have a chance to look at why CI is failing, that would be much appreciated! Something dependency-based.

By the way, another thought I had was... the site is hosted on Heroku, it uses their buildpacks, not the Docker config. Do you know if the switch to pyproject.toml will work other there?

@phillipjf
Copy link
Author

If you have a chance to look at why CI is failing, that would be much appreciated! Something dependency-based.

Fixed this, the reference to the snapshottest package was the culprit. Also a couple tests needed updating.

By the way, another thought I had was... the site is hosted on Heroku, it uses their buildpacks, not the Docker config. Do you know if the switch to pyproject.toml will work other there?

I think this will work with the empty setup.py as recommended here: heroku/heroku-buildpack-python#834 (comment)

@joerick
Copy link
Member

joerick commented Jul 7, 2023

Brilliant! Lets give this a try...

@joerick joerick temporarily deployed to nord-sirius July 7, 2023 14:17 Inactive
@joerick
Copy link
Member

joerick commented Jul 7, 2023

It works!

Screenshot 2023-07-07 at 3 31 46 pm Screenshot 2023-07-07 at 3 32 00 pm

@joerick
Copy link
Member

joerick commented Jul 7, 2023

Awesome. Thank you so much @phillipjf for this! Once I had all the API creds in the right place, it worked flawlessly.

@joerick joerick merged commit 92afbae into nordprojects:master Jul 7, 2023
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.

Twitter authentication no longer working
2 participants