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

OAuth 2 support #225

Merged
merged 6 commits into from Dec 31, 2019
Merged

OAuth 2 support #225

merged 6 commits into from Dec 31, 2019

Conversation

@ngerakines
Copy link
Collaborator

ngerakines commented Dec 19, 2019

This PR introduces OAuth 2.0 support as a client application integrating against a OAuth provider.

Change Log

Added

  • github.com/writeas/writefreely/db package that contains database and storage utility and helper code
  • Database testing utility code in github.com/writeas/writefreely/main_test.go
  • OAuth 2.0 HTTP handlers and wired them into /oauth/write.as and /oauth/callback
  • The users_oauth and oauth_client_state tables with migrations (v4).

Changed

  • The configuration structure to include OAuth application configuration.

  • I have signed the CLA
@ngerakines ngerakines requested review from thebaer and robjloranger Dec 19, 2019
@ngerakines ngerakines self-assigned this Dec 19, 2019
@thebaer thebaer added this to the 0.12 milestone Dec 19, 2019
@ngerakines ngerakines marked this pull request as ready for review Dec 24, 2019
Copy link
Member

thebaer left a comment

Just a few small notes after reading through. I'll be able to actually run / test later today or tomorrow, and give my final review then.

config/config.go Show resolved Hide resolved
database.go Outdated Show resolved Hide resolved
@thebaer
Copy link
Member

thebaer commented Dec 28, 2019

Thanks. So how can I test and verify this? Do you have sample config values if I'm running Write.as locally?

@ngerakines ngerakines requested a review from thebaer Dec 29, 2019
@ngerakines
Copy link
Collaborator Author

ngerakines commented Dec 29, 2019

Thanks. So how can I test and verify this? Do you have sample config values if I'm running Write.as locally?

I sent my local setup to you privately.

@ngerakines ngerakines mentioned this pull request Dec 30, 2019
1 of 1 task complete
thebaer added 2 commits Dec 30, 2019
This checks to see if we get a response with a populated `error` field
in exchangeOauthCode(). If so, we return that error message as an error,
to ensure the callback logic doesn't continue with a bad response.

Ref T705
Copy link
Member

thebaer left a comment

After testing, everything looks good! I committed a few changes I needed: added some helpful logging and fixed some error-passing during the code exchange process.

Last thing: we should update the database table names to be consistent with the current naming scheme. Then we'll get this merged!

migrations/v4.go Outdated Show resolved Hide resolved
migrations/v4.go Outdated Show resolved Hide resolved
@thebaer
Copy link
Member

thebaer commented Dec 31, 2019

Perfect -- thanks @ngerakines! Merging now.

@thebaer thebaer merged commit f343ceb into develop Dec 31, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.