Commit Graph

169 Commits (ac3a175c754fff4c23f03b93b1c0bcfba3ae3ef6)

Author SHA1 Message Date
Michael Desa ac3a175c75 Ensure uniqueness of organization names in bolt 2017-11-02 13:04:41 -04:00
Michael Desa 78754bdbda Add dependent destroy of resources for organization 2017-11-01 17:12:31 -04:00
Jared Scheib 79b3f173fb Change version on UsersBucket to V2 for clean upgrade path
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-11-01 10:57:49 -07:00
Michael Desa 6fbfde5060 Add comments throughout codebase 2017-11-01 12:30:42 -04:00
Michael Desa 39d3488749 Fix Migrate Organizations to not overwrite name 2017-11-01 10:55:32 -04:00
Michael Desa ccbaac2b6d Fix organizations for default organization 2017-11-01 09:17:34 -04:00
Michael Desa a9d5bf9c05 WIP cleanup 2017-10-31 20:58:40 -04:00
Michael Desa d1488a973b WIP make app usable by frontend 2017-10-31 19:50:03 -04:00
Michael Desa 391bd189c1 Add support for super admin 2017-10-31 18:27:24 -04:00
Michael Desa 6e0bfa67df Move organization resouces to their own package 2017-10-30 14:31:19 -04:00
Michael Desa 20c61a76e4 Change OrganizationID to Organization in Roles
Fix formatting of proto file
2017-10-30 12:28:57 -04:00
Michael Desa ef4c28affa Fix typo and organization dashboards test 2017-10-30 11:08:39 -04:00
Michael Desa 2080fbe9ef Fix incorrectly named file 2017-10-30 11:06:37 -04:00
Michael Desa 834f37ef5c Add OrganizationLayoutsStore 2017-10-30 11:05:20 -04:00
Michael Desa 3c04658b8d Add OrganizationServersStore 2017-10-30 10:57:41 -04:00
Michael Desa d5c02afb9b Add OrganizationsSourcesStore 2017-10-30 10:49:54 -04:00
Michael Desa 11bb189778 Add DashboardOrganization tests 2017-10-30 10:34:18 -04:00
Michael de Sa 1abc86c82e WIP filter all resources by organization
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-27 18:14:46 -04:00
Michael de Sa 7665fc1e67 Lowercase all Providers, Schemes, & Roles in OrganizationUsers tests
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-26 15:27:44 -07: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 de Sa d037b3ffa1 Make gen for proto changes in 68e08b987
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-25 11:58:55 -07:00
Jared Scheib 68e08b979f Update Organization comments on resources
Remove `omitempty` on Organization field

Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-25 14:56:08 -04:00
Michael de Sa bea78d0c84 Remove Organization from bolt Stores
Previously, each store depended on having an organization set on the
implentation of a store. This was used to segment different
organizations into different buckets. This PR undoes that work.

Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-25 14:29:14 -04:00
Michael Desa a6d565fd7c Add Organizations to Dashboards 2017-10-25 14:00:06 -04:00
Michael Desa eca0be45e2 Add Organization to layouts 2017-10-25 12:52:56 -04:00
Michael Desa 89fef060b7 Add Organization to chronograf.Server 2017-10-25 12:42:50 -04:00
Michael Desa 7b21a6b970 Add Organization to Sources 2017-10-25 11:51:15 -04:00
Michael Desa b9219c5cc7 REMOVE ME
This commit should be removed and was added so that it when I run make
gen for adding other values it won't polute the other commits
2017-10-25 11:49:56 -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
Jared Scheib 30b8d3cdca Make all Store names plural for consistency 2017-10-24 15:54:24 -07:00
Jared Scheib a48fb6cda9 Clean up plurals in func comments
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-24 15:09:37 -07:00
Michael de Sa c15480d018 Test validOrganizationRoles comprehensively
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-24 15:08:01 -07:00
Michael de Sa 9b8a2e431a Add comments to validOrganization
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-24 15:07:35 -07:00
Jared Scheib a7558f6ce2 Ensure additional Users aren't created OrganizationUser.Add
Performs a Get against the global UsersStore, and if the User
already exists, it appends to that User instead of trying to add
the "new" User blindly.

Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-24 14:53:50 -07:00
Jared Scheib c120dbe3c5 Rename userHasValidRoles to validOrganizationRoles for clarity
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-24 14:04:48 -07:00
Jared Scheib ebcf97e2c5 Clarify Update methodology comment
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-24 14:04:05 -07:00
Michael de Sa a505c6cef2 Test for error on Add Org User without context Org
Refactor guards in OrganizationUser bolt methods into comon func

Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-24 13:53:30 -07:00
Jared Scheib b052efcfa7 Improve test reporting for which user was deleted
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-24 13:45:09 -07:00
Michael de Sa a34888e0ad Clean up derletion test name
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-24 13:43:25 -07:00
Michael de Sa 40da570358 Make vars consistent
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-24 13:41:47 -07:00
Jared Scheib 7757533d7b Improve get no users test
Change rawWant to wantRaw
Remove fmt.Println

Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-24 13:33:17 -07:00
Michael Desa 571ac39154 Add OrganizationUsersStore
bolt/organization_users_store contains a boltdb implementation of a
chronograf.UsersStore that filters the results based on the organization
that is set on the context.

Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-24 13:29:46 -04:00
Michael de Sa 9eb8829e6e Remove printing from Organization tests
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-23 12:08:49 -07:00
Jared Scheib ff575f3ca8 Rename Org field on stores to Organization
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-23 12:08:11 -07:00
Michael de Sa 9a8e96378a Nest resources under Organizations
For each organization, we create a set of buckets for each associated
resource (sources, servers, layouts, and dashbaords).

The bucket name is the path join of the resource bucket name and the
oranizations name. If the organizations name is empty, then the bucket
name is the resource bucket name (this is backwards compatible with how
resources are currently stored).

Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-20 13:50:19 -04:00
Michael Desa 2d8d2dcee7 Implement basic bolt OrganizationsStore 2017-10-20 11:13:13 -04:00
Jared Scheib 2447185071 Add bolt implementation of OrganizationsStore
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-20 09:17:00 -05:00
Jared Scheib bed327b999 Add test coverage for Get with empty User
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-19 14:39:06 -05: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 c69925558d Add tests for retrieving user by name and provider
Fix incorrect error message

Cleanup old Get user test
2017-10-19 12:52:46 -04:00