Commit Graph

73 Commits (98217790b65aaa584b9de318cc537e5d260e93a9)

Author SHA1 Message Date
Chris Goller 94afc97beb Add implementation of generic oauth2 provider based on github concepts 2017-04-06 10:19:07 -05:00
Chris Goller 9ac300cf19 Update to fix go linter issues 2017-03-06 10:11:52 -06:00
Chris Goller f60a358751 Merge branch 'master' into feature/#54-tr-enterprise-client
Conflicts:
	Makefile
	chronograf.go
	server/routes.go
	server/users.go
2017-02-23 23:26:09 -06:00
Tim Raymond 22a556e964 Add organization restriction on Heroku provider
This allows operators to permit access to Chronograf only to users belonging
to a set of specific Heroku organizations. This is controlled using the
HEROKU_ORGS env or the --heroku-organizations switch.
2017-02-21 13:09:42 -05:00
Tim Raymond 3c62eaa93c Update/Cleanup OAuth2 documentation
Information on setting up Heroku and Google authentication has been
added. Also, the information about the design has been updated and moved
to the oauth2 package docs along with updated diagrams to match with
developer expectations about where design-related documentation should
be found.
2017-02-21 11:04:01 -05:00
Tim Raymond de3badc4a7 Improve documentation for oauth2 package
Adds a diagram showing how all the pieces fit together and a short
description.
2017-02-17 17:08:11 -05:00
Tim Raymond f48487771c Rename JWTMux to CookieMux
JWTMux was a disingenuous name because while JWTs are a very good choice
for a cookie encoding, they were not strictly required for use with this
mux. To better indicate the responsibilities of this mux, it's been
renamed "CookieMux," since its responsibilities end with persisting the
oauth2.Authenticator's encoded state in the browser. It is up to the
oauth2.Authenticator to choose the encoding.
2017-02-17 12:57:08 -05:00
Tim Raymond 6a96d2b745 Add test for oauth2.Callback() handler
This test ensures that the Callback handler sets a cookie in its
response to the browser when the provider returns a 200
2017-02-17 12:41:14 -05:00
Tim Raymond cde17a3837 Add test for (*JWTMux).Login()
Ensures that state is send properly to Provider.
2017-02-16 17:29:34 -05:00
Tim Raymond 322d14103a Reorganize OAuth2 Test Helpers
Moved all test helper structs and funcs under oauth2/oauth2_test.go
2017-02-16 17:27:55 -05:00
Tim Raymond 6ae180d5e7 Add tests around oauth2.JWTMux
Adds a test for Logout() handler.
2017-02-16 16:42:43 -05:00
Chris Goller cfa4d15efa Add google OAuth2 principal domain/email test 2017-02-16 13:36:37 -06:00
Chris Goller 06d314598d Add Github OAuth2 principal email/org tests 2017-02-16 13:26:08 -06:00
Tim Raymond d426193597 Configure Heroku OAuth2 properly
This was erroneously left unconfigured during dev.
2017-02-16 12:56:01 -05:00
Tim Raymond 6b9c642699 Add Heroku Oauth2 Provider
This adds an Oauth2 Provider for authenticating users against Heroku's
API. In contrast to other Providers, a maintained client library for
interacting with the Heroku API was not available, so direct HTTP calls
are made instead. This follows with their documentation posted here:
https://devcenter.heroku.com/articles/oauth2-heroku-go
2017-02-16 12:05:55 -05:00
Chris Goller fa36ac6149 Add unified OAuth2 logout route redirecting to provider logout
Signed-off-by: Tim Raymond <tim@timraymond.com>
2017-02-15 16:29:13 -06:00
Chris Goller 703af8c3da Fix go test failures from code moving 2017-02-14 23:38:43 -06:00
Chris Goller 2d691bb694 Add --public-url CLI option to support google oauth redirect uri 2017-02-14 23:34:15 -06:00
Chris Goller ae5e4edacf Add google oauth provider. Need redirect_uri 2017-02-14 23:11:11 -06:00
Chris Goller 9c3ffed99e Remove unneeded authenticator from github 2017-02-14 23:09:34 -06:00
Tim Raymond 1a80a6c4d5 Doc++ 2017-02-14 17:28:38 -05:00
Tim Raymond 821552e5f2 Add Name to oauth2.Provider
Providers should be able to tell us their name. This will help construct
routes.
2017-02-14 17:28:05 -05:00
Tim Raymond 09e8063131 Reorganize OAuth2 Logic
Created an oauth2 package which encapsulates all oauth2 providers,
utility functions, types, and interfaces. Previously some methods of the
Github provider were used as http.HandlerFuncs. These have now been
pulled into a concrete type called a JWTMux to implement other Oauth2
providers.

JWTMux has all of the functionality required to take a token from any
provider and store it as a JWT in a browser, and that is the extent of
its responsibilities. It implements the oauth2.Mux interface which would
potentially allow other strategies of oauth2 credential storage.
2017-02-14 16:18:41 -05:00