Commit Graph

252 Commits (14c7428376aa8385c0149c78c746cdd81e363253)

Author SHA1 Message Date
Michael Desa 39b9a90900 Remove organization LayoutsStore 2017-12-05 17:14:21 -05:00
Jared Scheib 987d462de3 Merge branch 'multitenancy' into multitenancy_reset_current_org 2017-12-05 13:37:46 -08:00
Jared Scheib 93f11e1325 Merge remote-tracking branch 'origin/master' into multitenancy 2017-12-05 11:43:23 -08:00
Jared Scheib e64c072388
Merge pull request #2435 from influxdata/multitenancy_prevent_bad_add_org_user
Prevent unintended update of existing user on Add; fix duplicate User & Org creation client UX
2017-12-04 14:15:27 -08:00
Jared Scheib 7eed603bf7 Change ErrOrganizationNameTaken to ErrOrganizationAlreadyExists for consistency 2017-11-30 20:12:00 -08:00
Jared Scheib f8920cf39b
Merge branch 'multitenancy' into multitenancy_reset_current_org 2017-11-30 19:07:40 -08:00
Jared Scheib 6b7a18d666 Complete 9ef1e57 by removing Role concept from sources in server 2017-11-30 19:03:56 -08:00
Michael Desa e27936ee69 Add Num to UsersStore interface 2017-11-30 12:55:59 -05:00
Chris Goller 6564712e9d Merge branch 'master' into gauge-cell-type
Conflicts:
	bolt/internal/internal.pb.go
	bolt/internal/internal.proto
	server/cells.go
2017-11-27 16:08:42 -06:00
Chris Goller 4955269dcc Update indentation format of the proto file 2017-11-21 19:29:34 -06:00
Chris Goller fd93742dd7 Add colors to storage of cells 2017-11-21 19:26:25 -06:00
Andrew Watkins 93ff34affc Update proto TimeShift property descriptions 2017-11-21 10:33:21 -08:00
Andrew Watkins d8c2b2b8eb Update test 2017-11-17 10:51:50 -08:00
Michael Desa cde3dcaac1 Set default role to viewer on source if not specified 2017-11-13 20:41:54 -08:00
Michael Desa e4d99c34b4 Migrate all orphaned resources to DefaultOrg
When users upgrade, all of their bolt resources will not belong to any
organization. This PR introduces a migration path where any orphaned,
resources without an organization, will become owned by the default
organization.
2017-11-13 20:41:54 -08:00
Luke Morris b3d0d6eeee Address PR feedback. 2017-11-13 18:08:50 -08:00
Luke Morris b543e64ef1 Make Public values explicit 2017-11-13 12:15:53 -08:00
Luke Morris b38730afd5 If not set, Public should be true by default 2017-11-13 11:58:07 -08:00
Luke Morris 65ae474a5c Clear test noise 2017-11-10 18:45:25 -08:00
Luke Morris 31277c432c Rename whitelistOnly => public 2017-11-10 18:23:41 -08:00
Michael Desa 173d1f2d71 Check WhitelistOnly setting on default org in Me
Set DefaultOrganizationWhitelistOnly to false

Set DefaultOrganizationRole on new user in Me
2017-11-10 16:15:29 -05:00
Michael Desa dc1ee40bc6 Add WhitelistOnly to organizations
Fix adding default role to organization
2017-11-10 15:57:48 -05:00
Michael Desa fe6f3bd673 Fix updating default role on organization 2017-11-10 14:55:21 -05:00
Andrew Watkins 6093ddc52f WIP Add shifts to queryConifg on backend 2017-11-10 11:06:48 -08:00
Michael Desa 12facba297 Ensure users name, provider, and scheme are unique 2017-11-10 12:29:17 -05:00
Chris Goller 349dd12f20 Refactor and simplify auto group by (:interval:) template variable 2017-11-09 10:02:24 -08:00
Michael Desa cbbf9d96d7 Add comments suggested from PR review
Add tests to server/stores_test.go
2017-11-07 13:59:40 -05:00
Michael Desa 8e9037e081 Add Role to chronograf.Source 2017-11-06 11:24:10 -05:00
Michael Desa 569ae2ce4b Add test for deleting default organization
Group together constants
2017-11-06 10:17:15 -05:00
Michael Desa f92fc37f17 Change default organization name to Default 2017-11-06 10:15:50 -05:00
Michael Desa 440f2ed2b5 Prevent deletion of default organization 2017-11-06 10:14:14 -05:00
Michael Desa 3370774e8f Add default org logic to OrganizationsStore
Update resource handlers to appropriate consume default organization IDs
2017-11-06 10:14:12 -05:00
Michael Desa 45f1410fd6 Add default role to chronograf.Organization 2017-11-06 09:46:00 -05:00
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
Michael Desa 4687ecf794 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 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
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
Michael de Sa 00004a33da Use cmp.Diff for user equality comparison
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-16 16:46:20 -05:00
Michael de Sa 8fe197b02f Clean up redundant error checks
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-16 14:33:47 -05:00
Michael de Sa 255541ee0a Add name to bolt UsersStore test
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-12 20:01:35 -04:00
Michael de Sa 71ca669283 Make chronograf user roles explicit vars
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-12 19:58:45 -04:00
Michael de Sa 250eb9b730 Factor out code in common bolt UsersStore tests
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-12 19:52:34 -04:00
Michael de Sa e25ac2045c Use numberic style ID in UsersStore Get test
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-12 19:37:51 -04:00
Jared Scheib 7b8e424f03 Regenerate protoc to remove formatting changes
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-12 19:33:46 -04:00
Jared Scheib ac9984c799 Remove unused concept of RolesStore
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-12 19:33:31 -04:00
Michael de Sa 924c890862 Refactor bolt UsersStore to use ID instead of name
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-12 19:33:16 -04:00
Michael de Sa f1a496b449 Add tests for updating user in boltdb
Adds tests for updating roles, provider, and scheme

Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-12 19:32:54 -04:00
Michael de Sa 4761f4454c Set ID on retrieved user from boltdb
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-12 19:32:35 -04:00
Michael de Sa 7f4af358ae Add roles to boltdb UsersStore
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-12 19:31:44 -04:00
Jared Scheib 5947427e3f Update bolt UsersStore for updated chronograf User
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-10-12 19:31:26 -04:00
Michael Desa 334a3c5d34 Refactor bolt.RolesStore to use bolt.UsersStore
Add definitions for user roles and permissions in chronograf package

Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-10-12 19:31:15 -04:00