Commit Graph

715 Commits (9d4162c60bde92a3849988ef3cbd293cf30c1c33)

Author SHA1 Message Date
Luke Morris fcdc4efb2c Backup/Migrate/Initialize moved into Open
Signed-off-by: Chris Goller <goller@gmail.com>
2017-12-18 12:06:17 -08:00
Luke Morris 2184aecf86 Refactor; simplify function responsibilities 2017-12-17 14:11:27 -08:00
Luke Morris da71af2b7b Clean up prior to PR 2017-12-16 13:54:55 -08:00
Luke Morris b95837fc5b Create backup of database when moving versions 2017-12-16 12:27:24 -08:00
Luke Morris 5a59d72b06 WIP 2017-12-16 01:01:14 -08:00
Michael Desa a4736148c0 Allow SuperAdmins to change into any organization 2017-12-15 16:05:56 -08:00
Jared Scheib 933291918b Reference known issue #2601 in Admin creating SuperAdmin response
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-12-15 15:05:27 -08:00
Alex P 43db95f2cc Allow users to toggle between coloring text or background with single stat thresholds 2017-12-14 19:07:19 -08:00
Michael Desa 4223767c53 Use serverContext for getting Config in NewUser 2017-12-14 13:34:19 -08:00
Nathan Haugo 3f4bfefd00 Bump version to 1.4.0.0-beta2 2017-12-14 12:47:41 -08:00
Nathan Haugo 971156edf0 Bump version to 1.4.0.0-beta2 2017-12-14 12:45:44 -08:00
Michael Desa 61ef8937ba Add comment clarifying UsersStore Add method 2017-12-14 11:36:26 -08:00
Michael Desa da605ac138 Set SuperAdmin for NewUsers based on ConfigSetting 2017-12-14 11:11:51 -08:00
Jared Scheib 456488f0ac
Merge pull request #2355 from influxdata/multitenancy_all_users_superadmin_toggle
UI Toggle & API for SuperAdminFirstUserOnly server config
2017-12-14 10:54:18 -08:00
Jared Scheib 14599e0f0a Add comment about firstUser superAdmin logic 2017-12-14 10:46:55 -08:00
Michael Desa 392594539b Add SuperAdmin to default org, even if private
Add user to default org if org is public
2017-12-13 17:38:57 -08:00
Michael Desa 2b38918a44 Prevent users joining default org if private 2017-12-13 16:59:02 -08:00
Jared Scheib f23075cbc4 Rename superAdminFirstUserOnly to superAdminNewUsers & flip default logic accordingly
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-12-13 14:49:49 -08:00
Jared Scheib 5c813493ea Add config.self & config.auth routes, update client routes & make PATCH a PUT 2017-12-13 13:54:23 -08:00
Michael Desa da67f958ae Remove SuperAdminFirstUserOnly CLI flag
Wire up boltdb config store
2017-12-13 11:55:36 -08:00
Michael Desa 9a1ba96977 Wire up bolt db ConfigStore in Server 2017-12-13 10:46:08 -08:00
Michael Desa 4496c361d7 Add PUT /config/:section route 2017-12-13 09:28:39 -08:00
Michael Desa 5ec549db0f Add /config/:section endpoint 2017-12-13 09:04:44 -08:00
Michael de Sa fcd25ad580 Implement Config GET service method
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-12-12 17:06:57 -08:00
Jared Scheib 5038f8532b Add /config link to AllRoutes handler
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-12-12 15:11:30 -08:00
Michael Desa 9fd656d4c9 Prevent user joining private default org
Previously, if an organization was private and a user was removed from
the default organization, then they would be re-added. This behavior was
so left over from when we thought of the default organization as the
place where all users would exist. This PR removes that behavior.

There is one piece of odd behavior where a user's "current organization"
will be the default organization, but they will have no role in the
default organization.
2017-12-12 13:15:53 -08:00
Deniz Kusefoglu c2b356b1c5
Merge branch 'master' into multiple-event-handlers 2017-12-08 12:20:40 -08:00
Nathan Haugo 1e8a66dffa Update bumpversion with 1.4.0.0-beta1 2017-12-07 14:38:28 -06:00
Jared Scheib 482a4de6c1 Merge branch 'master' into multitenancy 2017-12-06 19:05:16 -08:00
Jared Scheib bbe1330cbf Merge branch 'multitenancy' into multitenancy_reset_current_org 2017-12-05 18:47:05 -08:00
Deniz Kusefoglu ace69cc49b
Merge branch 'master' into multiple-event-handlers 2017-12-05 16:18:01 -08:00
Jared Scheib 808163fe69 Merge branch 'multitenancy' into multitenancy_fix_layouts 2017-12-05 16:03:05 -08:00
Michael Desa e5e65dfc1b Remove Create/Update/Delete logic for Layouts 2017-12-05 17:11:16 -05:00
Michael Desa fc0d525022 Remove /mappings in place of /layouts
Remove POST/PUT/DELETE methods to /layouts
2017-12-05 17:07:09 -05:00
Jared Scheib 987d462de3 Merge branch 'multitenancy' into multitenancy_reset_current_org 2017-12-05 13:37:46 -08:00
Nathan Haugo 4afa71a2f4
Merge pull request #2410 from influxdata/gauge-cell-type
Gauge Dashboard Cell
2017-12-05 13:26:02 -08:00
Jared Scheib 1323a062b7 Merge branch 'master' into multitenancy 2017-12-05 13:00:48 -08:00
Chris Goller 62db317268
Merge branch 'master' into feature/add-meta-auth 2017-12-05 14:37:47 -06:00
Alex P 5f6a9a9087 Merge branch 'master' into gauge-cell-type 2017-12-05 12:12:16 -08:00
Jared Scheib 93f11e1325 Merge remote-tracking branch 'origin/master' into multitenancy 2017-12-05 11:43:23 -08:00
Michael Desa 06db8a885f Allow for empty MetaURL in UpdateSource
Currently, if an empty source is supplied, then the source's meta url
will not be updated. Now, if the MetaURL is supplied and is different
than the one that is currently on the source, the value will be updated.
Even in the case of empty string meta urls.
2017-12-05 13:04:31 -05:00
Chris Goller 6db56147a8 Add basic auth or JWT tokens for meta queries 2017-12-04 18:07:08 -06:00
Michael Desa 15a1c45cf1 Allow admins to update a superadmins roles 2017-12-04 16:53:30 -05:00
Chris Goller 7d35d3b3d1
Merge branch 'master' into fix/basepath-logout 2017-12-04 15:00:07 -06:00
Andrew Watkins 87fa2c1c91 Will not supply roles if there is no metaURL 2017-12-02 12:11:52 -08:00
Chris Goller 3f760c1b1b Update oauth logout to include basepath 2017-12-01 15:35:39 -06:00
Deniz Kusefoglu 531e4af26c Return 422 error instead of 500 for bad alert rule data
Signed-off-by: Chris Goller <goller@gmail.com>
2017-12-01 11:15:57 -08:00
Deniz Kusefoglu b83ccaf420 Provide more verbose error for alert rule json parsing
Signed-off-by: Chris Goller <goller@gmail.com>
2017-12-01 11:05:38 -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
deniz kusefoglu 00dca72f19 Rename AlertHandlers to AlertNodes 2017-11-30 16:16:44 -08:00
Chris Goller c7f35f14ec Update kapacitor rule response to have empty arrays
Signed-off-by: Deniz Kusefoglu <denizk@gmail.com>
2017-11-30 16:32:47 -06:00
Michael Desa 6feba85807 Change NewUsersNotSuperAdmin to SuperAdminFirstUserOnly 2017-11-30 15:01:52 -05:00
Chris Goller 52e1175c7d Update patching of enterprise users allow incremental updating of fields 2017-11-30 12:41:50 -06:00
Michael Desa 86b9c0d985 Make first user SuperAdmin 2017-11-30 12:56:13 -05:00
Michael Desa 9ef1e57934 Unscope sources by role
Previously, as a misunderstanding of
https://github.com/influxdata/chronograf/issues/1915 we allowed
sources to be scoped by role within an organization. This was incorrect.
We no longer user the roles implementation of a chronograf.SourcesStore
and just use the organizations store.

We've left the code around a roles SourcesStore in place, since it may
be useful to us in the future. It may be worth removing if it is
determined that this behavior is not desirable.
2017-11-29 17:32:41 -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
Michael Desa 6ca8bf5089 Accept name,provider,scheme in UpdateUser if unchanged 2017-11-22 15:20:48 -05:00
Michael Desa 8f7363b3f4 Ensure that organzation on role is valid org id 2017-11-22 15:03:15 -05:00
Michael Desa ec20267c2f Disallow empty organization id create/update user 2017-11-22 14:49:44 -05:00
Michael Desa f2591c9eb1 Change HTTP Status 401 to 403 in AuthorizedUser
This signals to the front end that a user must go through another ouath
flow.
2017-11-21 18:55:26 -05:00
Michael Desa cf82990623 Return HTTP Status 403 if org not found in /me
Fix returning non-standard status from AuthorizedUser
2017-11-21 18:53:42 -05:00
Chris Goller c87bfe1678 Add GENERIC_API_KEY to override of oauth2 responses to support azure 2017-11-21 16:55:03 -06:00
Andrew Watkins 59fb33387b Fix broken test due to stupid new line 2017-11-21 11:34:26 -08:00
Andrew Watkins 33e83254e5 Handle nil cell in validateDashboardRequest 2017-11-21 11:27:48 -08:00
Andrew Watkins 5398c791b1
Merge branch 'master' into feature/time-cop 2017-11-21 10:29:31 -08:00
Chris Goller e0246bc840 Update invalid swagger information for cell hex color length 2017-11-21 12:22:02 -06:00
Chris Goller 1d11677c5f Add colors to all cells 2017-11-21 12:16:23 -06:00
Jared Scheib 9b89e42777 Add mock.Store to queries test
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-11-16 13:01:20 -08:00
Jared Scheib f38b80a30d Merge branch 'master' into multitenancy 2017-11-14 00:05:18 -08:00
Michael Desa 489127cecb Add organizations to newDashboardResponse tests 2017-11-13 23:37:50 -08:00
Jared Scheib 05c76d3c52 Add Organization ID to dashboards response
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-11-13 23:28:41 -08:00
Michael de Sa 65bc529831 Fix tests broken in 96a362cb
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-11-13 23:10:26 -08:00
Michael Desa fdc6dc4aa3 Fix wording suggested in PR 2017-11-13 20:49:07 -08:00
Michael Desa 011b0bfb73 Add option to specify users are create as super admin 2017-11-13 20:44:50 -08:00
Michael Desa 5b64cb4dc3 Use default organization default role in me
Forbid users from application if they have no roles and were not
explicitly added in private organization
2017-11-13 19:28:15 -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 b731481fdc Sew up failing tests 2017-11-13 11:47:34 -08:00
Luke Morris 65ae474a5c Clear test noise 2017-11-10 18:45:25 -08:00
Luke Morris 43338cbdcb Reuse chronograf.Organization type 2017-11-10 18:31:30 -08:00
Luke Morris 31277c432c Rename whitelistOnly => public 2017-11-10 18:23:41 -08:00
Luke Morris 5ff6bfb32e Persist whitelistOnly changes to default organization 2017-11-10 16:43:11 -08:00
Andrew Watkins c6fd7058ba Add test for queryConfig validation 2017-11-10 16:02:35 -08:00
Andrew Watkins c3a4696174 Add processing of incoming queryConfig 2017-11-10 16:02:08 -08:00
Michael Desa d53fcea236 Change MeOrganization to UpdateMe 2017-11-10 16:17:46 -05: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 89ca72952c Use raw organizations store is user is super admin 2017-11-10 15:33:28 -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 85bb71033c Expose some organization routes to admins
Cleanup tests appropriately

Prevent Admins from patching organizations
2017-11-10 12:48:10 -05:00
Michael Desa 8e9673380f Fix ValidSourceRequestComment 2017-11-10 12:20:58 -05:00
Michael Desa d9a29cab89 Fix ValidSourceRequest to modify pointer when needed
Add tests for Store.SourcesAll
2017-11-10 12:15:04 -05:00
Michael Desa 7123eea6dc Change UserKey to UserContextKey 2017-11-10 11:28:19 -05:00
Michael Desa fbff6cea76 Add user that made the request to organization
Previously, when an org was created it had no users. Now when an
organization is created, the user that made the request is added to the
organization with the admin role.

If there are any errors when adding the user the organization, we make a
best effort attempt to delete the organization. However it is still
possilbe that an organization would be created, but have no users if our
best effort fails.
2017-11-10 11:20:56 -05:00
Michael Desa 1832ecb4f7 Change UserKey to UserContextKey
Fix name of arguments in tests
2017-11-10 11:18:06 -05:00
Michael Desa 39910a08af Sort users organizations on me response by org ID 2017-11-10 11:09:16 -05:00
Michael Desa e83bfe87e5 Prevent user from deleteing themselves 2017-11-10 11:09:16 -05:00
Michael Desa 71851d142f Put entire user on context 2017-11-10 11:09:16 -05:00
Michael Desa 4e46b4b2c7 Differentiate between SuperAdminContext and ServerContext
Previously, the server just hijacked the super admin context in order to
get raw access to the underlying data stores, this introduces a way to
specify the it is explicitly the server making the request and no longer
hijack the super admin context.

This also adds test coverage to ensure that the correct values are being
set on context in the AuthorizedUser method.
2017-11-10 11:09:16 -05:00
Chris Goller 349dd12f20 Refactor and simplify auto group by (:interval:) template variable 2017-11-09 10:02:24 -08:00
Chris Goller eb82ec4131 Refactor and simplify auto group by (:interval:) template variable 2017-11-08 11:27:35 -06:00
Jared Scheib 355649b885
Merge pull request #2249 from influxdata/multitenancy_scoped_sources
Sources are scoped by users role in organization
2017-11-07 12:05:12 -08:00
Michael de Sa 5062773e4e Add verification that user does not have more than one role in org
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-11-07 15:02:31 -05:00
Michael de Sa 85329d0bc6 Remove super admin from store/sources tests
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
2017-11-07 14:57:37 -05:00
Jared Scheib 4df7e38779 Add clarifying comments about how roles, organization, and context are used to filter resources
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-11-07 14:56:55 -05:00
Michael Desa 6f66dd8a47 Change SuperAdminRoleName to SuperAdminStatus
SuperAdmin is not a role type, but it a status of a user that is
tangentially related to a users role in an organization. This renames
the variable to reflect that difference.
2017-11-07 13:59:51 -05: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
Jared Scheib b7533c0030 Modify mock store & json on superadmin-creates-SA user to reflect true SA status
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-11-06 11:17:27 -08:00
Michael Desa 9a548983d0 Fix role related tests after rebase 2017-11-06 11:31:44 -05:00
Michael Desa 859d94ab15 Move user roles and role names to roles package 2017-11-06 11:27:13 -05:00
Michael Desa 14459c7f7b Allow update of sources.Role in server.UpdateSource 2017-11-06 11:25:51 -05:00
Michael Desa 5e1ad82660 Add role ctx where appropriate in AuthorizedUser 2017-11-06 11:25:46 -05:00
Michael Desa f71e6a4b55 Add roles implementation of sources store
Minimal test coverage of Update/Delete/Add methods was done since they
do not involve any filtering. The filtering for them should have
happened at the API level.
2017-11-06 11:24:13 -05:00
Michael Desa 833e98ce73 Pull out setting super admin into a single func 2017-11-06 11:15:49 -05:00
Michael Desa 9af3089914 Allow SuperAdmins to promoted and demoted 2017-11-06 11:15:48 -05:00
Michael Desa c7e49001d4 Add default org check even when no auth is used 2017-11-06 10:17:17 -05:00
Michael Desa 66c779c193 Remove DefaultOrganization Name in tests mock store 2017-11-06 10:17:17 -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 3ddd253d68 Grant user role in default org if added via API
When users are created via the API they are only given roles in orgs
that are explicitly set. Additionally the roles must be roles that
belong to the current organization (unless they are a super admin).

This leads to a situation where a user may not be a part of the default
organization. If this is the case, we detect it when the user hits /me
and add the user to the default org.
2017-11-06 09:46:00 -05:00
Michael Desa 45f1410fd6 Add default role to chronograf.Organization 2017-11-06 09:46:00 -05:00
Chris Goller 693f26b0c3 Update queries endpoint comment 2017-11-04 20:19:08 -05:00
Michael Desa 271aebb40f Prevent duplicate organization roles in user CRUD 2017-11-03 12:06:18 -04:00
Michael Desa 81e0bf06dc Fix me tests with proper IDs 2017-11-03 09:47:54 -04:00
Michael Desa e114f20328 Fix links in me request 2017-11-03 09:39:21 -04:00
Michael Desa 6539e5ebeb Properly pass organization context to handlers 2017-11-03 09:13:03 -04:00
Michael Desa 6f72d72fca Fix over-stringification of organization on roles 2017-11-02 21:52:30 -04:00
Jared Scheib fe6e0682ca Add SuperAdmin to userResponse 2017-11-02 16:24:16 -07:00
Chris Goller 663d418161 Fix rendering of templated queries to the /queries endpoint 2017-11-02 17:57:02 -05:00
Michael Desa da1fa2141b Add CurrentOrganization & Organizations to me resp
Remove CurrentOrganization from chronograf.User
2017-11-02 11:59:53 -04:00
Michael Desa c161dd3cc1 Fix relevant go-vet/go-lint for server package 2017-11-01 16:43:31 -04:00
Michael Desa 2aadaf3ff6 Add exhaustive test for AuthorizedUser 2017-11-01 16:38:17 -04:00
Michael Desa 929f67c882 Add comments to DataStore interface and implemntn 2017-11-01 14:24:40 -04:00
Michael Desa fd66c8a227 Fix routes tests 2017-11-01 14:09:58 -04:00
Jared Scheib cd719805ed Add organizations and users routes to allRoutes
Signed-off-by: Michael de Sa <mjdesa@gmail.com>
2017-11-01 12:59:07 -04:00
Michael Desa 3f55da7503 Change nil check to len == 0 check for userRequest 2017-11-01 12:38:26 -04:00
Michael Desa 4ecf215d19 Remove unused code 2017-11-01 12:35:09 -04:00
Michael Desa dc63e8af8f Add parseOrganizationID method 2017-11-01 12:34:00 -04:00
Michael Desa 6fbfde5060 Add comments throughout codebase 2017-11-01 12:30:42 -04:00
Michael Desa 7af7d65802 Change function signature of hasSuperAdminContext 2017-11-01 10:39:09 -04:00
Michael Desa 24c99a761b Change OrganizationID to Organization in Me req 2017-11-01 10:37:32 -04:00
Michael Desa 3eaca382d3 User explicit type when setting context 2017-11-01 09:49:02 -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 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 e111038816 Add noop implementation of each source type 2017-10-31 18:07:42 -04:00
Michael Desa d7b981987c Remove RawUsers from DataStore 2017-10-31 17:49:35 -04:00
Michael Desa 978da16ecd Add org param to New Organizaiton methods 2017-10-31 17:40:58 -04:00