Commit Graph

15 Commits (2bd2c81bb741247a57b977b6f051d709355173ab)

Author SHA1 Message Date
Michael Desa 36e14cb111 Refactor data stores into a common interface 2017-10-31 16:41:17 -04:00
Jared Scheib cbc22b10d7 Test authorized User in the context of Organization
Make principal explicit arg in auth tests.

Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-27 13:54:28 -07:00
Michael de Sa cf58974927 Add organization field to principal in auth tests
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-27 13:19:43 -07:00
Jared Scheib 30d1739e35 Move Mock Authenticator into mocks package
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-26 15:46:06 -07:00
Jared Scheib 74fdcc1c39 Add scheme to me/AuthorizedUser tests 2017-10-24 16:21:24 -07:00
Jared Scheib f283702fe0 Lowercase Provider & Scheme & Role values for consistency
The client was being sent lowercase values for Role & Provider,
but not Scheme. This change makes all the above lowercase.
2017-10-24 16:17:59 -07:00
Jared Scheib 19369b38cc Set Scheme to be OAuth2 explicitly for all users
Add Provider to Users authenticated via /me

Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-19 14:32:33 -05:00
Michael Desa a0d300d280 Use new chonograf.UserStore Get method when needed
Refactor tests that were dependent of old implementation of UsersStore
2017-10-18 14:45:33 -04:00
Michael Desa f50a2b686f Add AuthorizedUser middleware 2017-10-18 12:35:40 -04:00
Chris Goller 45e9508d31 Update oauth2 Authenticator signatures to use extend 2017-04-17 11:49:45 -05:00
Chris Goller 1fabed5039 Update tests for refreshing jwts 2017-04-14 02:35:30 -05:00
Jared Scheib ac4423a6fd Add new auth duration CLI option; add client heartbeat; fix logout (#1119)
* User can now set oauth cookie session duration via the CLI to any duration or to expire on browser close

* Refactor GET 'me' into heartbeat at constant interval

* Add ping route to all routes

* Add /chronograf/v1/ping endpoint for server status

* Refactor cookie generation to use an interface

* WIP adding refreshable tokens

* Add reminder to review index.js Login error handling

* Refactor Authenticator interface to accommodate cookie duration and logout delay

* Update make run-dev to be more TICKStack compliant

* Remove heartbeat/logout duration from authentication

* WIP Refactor tests to accommodate cookie and auth refactor

* Update oauth2 tests to newly refactored design

* Update oauth provider tests

* Remove unused oauth2/consts.go

* Move authentication middleware to server package

* Fix authentication comment

* Update authenication documentation to mention AUTH_DURATION

* Update /chronograf/v1/ping to simply return 204

* Fix Makefile run-dev target

* Remove spurious ping route

* Update auth docs to clarify authentication duration

* Revert "Refactor GET 'me' into heartbeat at constant interval"

This reverts commit 298a8c47e1431720d9bd97a9cb853744f04501a3.

Conflicts:
ui/src/index.js

* Add auth test for JWT signing method

* Add comments for why coverage isn't written for some areas of jwt code

* Update auth docs to explicitly mention how to require re-auth for all users on server restart

* Add Duration to Validation interface for Tokens

* Make auth duration of zero yield a everlasting token

* Revert "Revert "Refactor GET 'me' into heartbeat at constant interval""

This reverts commit b4773c15afe4fcd227ad88aa9d5686beb6b0a6cd.

* Rename http status constants and add FORBIDDEN

* Heartbeat only when logged in, notify user if heartbeat fails

* Update changelog

* Fix minor word semantics

* Update oauth2 tests to be in the oauth2_test package

* Add check at compile time that JWT implements Tokenizer

* Rename CookieMux to AuthMux for consistency with earlier refactor

* Fix logout middleware

* Fix logout button not showing due to obsolete data shape expectations

* Update changelog

* Fix proptypes for logout button data shape in SideNav
2017-04-06 11:40:57 -07: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
gunnaraasen b85a5be094 Add usage stats reporting 2016-10-28 14:34:55 -07:00
Chris Goller 12348d72cb Refactor to remove autogenerated code. 2016-10-26 22:10:52 -05:00