Michael Desa
271aebb40f
Prevent duplicate organization roles in user CRUD
2017-11-03 12:06:18 -04:00
Jared Scheib
fe6e0682ca
Add SuperAdmin to userResponse
2017-11-02 16:24:16 -07:00
Michael Desa
3f55da7503
Change nil check to len == 0 check for userRequest
2017-11-01 12:38:26 -04:00
Michael Desa
7af7d65802
Change function signature of hasSuperAdminContext
2017-11-01 10:39:09 -04:00
Michael Desa
72422803c4
Add superAdmin to users CRUD
2017-11-01 09:12:19 -04:00
Michael Desa
a9d5bf9c05
WIP cleanup
2017-10-31 20:58:40 -04:00
Michael Desa
5f63e2738a
Refactor data stores into a common interface
2017-10-31 16:41:17 -04:00
Jared Scheib
5bed2cfc4f
Merge remote-tracking branch 'origin/multitenancy' into multitenancy_orgs
...
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-26 18:21:30 -04:00
Michael Desa
bf6c77ee5f
Provide route to change current users organization
...
Add current Organization to JWT.
Use OrganizationUsersStore to retrieve Users that are not me.
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-26 18:06:52 -04:00
Jared Scheib
9a6ab1bf9d
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
Michael de Sa
dad08a7389
Modify ValidUpdate to ensure only User Roles can be updated
...
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-24 14:28:35 -07:00
Michael Desa
f1ad32a367
Add missing returns in http hanlder methods
2017-10-20 15:42:51 -04:00
Jared Scheib
c994e8c5ac
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
0d235f646d
Generalize chronograf.UsersStore Get method
...
The `Get` method on the UsersStore was generalize by changing the second
parameter to a struct. This allows the Store to retrieve users by more
than simply their name.
-Get(ctx context.Context, name string) (*User, error)
+Get(ctx context.Context, q UserQuery) (*User, error)
2017-10-18 14:17:42 -04:00
Jared Scheib
5d4ac3c167
Lowercase string consts for role names
...
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-16 19:42:57 -05:00
Michael de Sa
7a45bba4f7
Place user role consts and vars in server package
...
This also decouples the bolt tests from the server package.
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-16 18:43:56 -05:00
Jared Scheib
8e298437c5
Replace string slices of role names with slices of chronograf.Role
...
This effectively reinstants rolly polly as king.
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-16 18:26:08 -05:00
Michael de Sa
2f1e128c61
Suggest valid options in Invalid Role error message
...
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-16 15:56:43 -05:00
Jared Scheib
351f762ed2
Remove unnecessary logic in ValidRoles guard
...
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-16 13:58:16 -05:00
Jared Scheib
2281adb33d
Modify chronograf user roles to only use role name
...
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-16 14:44:34 -04:00
Jared Scheib
84be5f7128
Modify User req & res to receive & give Role names only
...
Role members are fully explicated for CRUD operations.
Also adds validation for Roles on requests.
Also returns an empty array in JSON when a User has no roles.
2017-10-16 14:18:34 -04:00
Jared Scheib
25faaa02df
Add Roles to Users CRUD
...
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-12 17:42:30 -07:00
Michael de Sa
04a9af37f3
Refactor setting writer Location header
...
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-11 10:14:57 -07:00
Jared Scheib
e2ce0cda0d
Refactor applying writer location header into helper func
...
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-10 14:40:45 -07:00
Michael de Sa
64381c28ba
Remove omitempty for Provider & Scheme in userRequest and userResponse
...
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-10 14:25:45 -07:00
Michael de Sa
04f4c4b917
Use more idiomatic error message method
...
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-10 14:21:43 -07:00
Michael de Sa
a122d5537c
Add comments on ValidUpdate for future considerations
...
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-10 14:19:28 -07:00
Jared Scheib
1b250ebfa9
Make name on userResponse required
...
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-10 14:15:31 -07:00
Jared Scheib
35d6f0b8c3
Use string IDs in JSON res and req for Users
...
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-10 12:27:55 -07:00
Michael de Sa
a1782cae64
Update only fields with diff; add test for that
...
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-10 11:40:33 -07:00
Michael de Sa
d62f144e14
Use new-school sort.Slice
...
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-10 11:30:57 -07:00
Jared Scheib
004b0e20ef
Add comments to exported functions
...
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-09 15:28:39 -07:00
Michael de Sa
990c4eee4d
Return users in usersResponse in sorted order
...
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-09 15:19:46 -07:00
Michael de Sa
1a6b446bf8
Add All route & operation for Chronograf Users
...
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-09 15:03:50 -07:00
Jared Scheib
37183d871c
Implement CRUD routes & operations for Chronograf User
...
Move source Users code into source_users and source_users_test files.
Use the UsersStore for both InfluxDB and Chronograf users.
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-09 14:16:24 -07:00
Chris Goller
a12fb32a2e
Update user's roles validation
2017-03-10 18:06:06 -06:00
Chris Goller
2652a3aeb0
Add ability to update roles on a user resource
2017-03-10 16:52:24 -06:00
Chris Goller
d5addb2038
Fix updating of OSS user permissions
2017-03-10 14:53:30 -06:00
Chris Goller
44aa0526ed
Update user/role responses to return empty arrays
2017-03-10 13:24:48 -06:00
Chris Goller
46b1a08aa5
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
Chris Goller
1fcdee485f
Add tests for /me endpoint
2017-02-21 21:36:23 -06:00
Chris Goller
cdd4575b98
Add GET/POST handlers for source users
2017-02-17 14:33:10 -06:00
Chris Goller
26b10dabd7
Update users to be go 1.7 compatible
2017-02-17 13:52:21 -06:00
Chris Goller
9b24351732
Refactor users and add client usersstore
2017-02-17 13:37:00 -06:00
Chris Goller
2017944b68
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
Hunter Trujillo
6d601d527f
Add frontend support for OAuth changes.
2017-02-15 11:57:52 -07:00
Tim Raymond
d07c7ca1d6
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
Chris Goller
1522dc6e4e
Remove explorations from backend server
2017-02-01 15:09:02 -06:00
Chris Goller
a6cb4a1935
Update teapot to be informational
2016-12-07 13:28:58 -06:00
Will Piers
bc9ee7eeea
Rebase and add error logging for users endpoint
2016-11-21 14:24:01 -07:00