Commit Graph

25 Commits (e4377ecd28c7b577e811edee374c0cf3a3bda1e0)

Author SHA1 Message Date
Pavel Zavora 7e0cba1890 fix(go1.15): require non-nil parent in context.WithValue 2020-11-13 14:40:20 +01:00
greg linton 1a612ffa22 feat: add migrate command to chronoctl
adds a command to migrate a db from bolt to etcd and visa versa. there
is no promise that the options/functionality will not change, hence the
'beta' note. obviously there is also no guarantee that there will never
be any data loss.
after several manual tests, i do have a high level of confidence in the
functionality presented.
2020-02-03 20:43:44 -07:00
Greg f0d5e5abef
chore: add a KV layer prior to adding an etcd implementation (#5349)
* Bolt to kv/bolt

* Remove unused code

* Remove unused roles code

* Remove unused duplicate Makefile

* Clean up bolt implementation and start layering in an interface for another store

* Layer in kv interface

* Continue layering in kv interface

* Remove circuitbreaker things

* Move cell stuff out

* Convert cell logic to kv interface

* Start adding config logic to kv interface, likely will remain bolt only

* Get to compile with bolt kv before moving too far forward

* Start removing dead dashboard code

* Add generic kv implementation for dashboards

* Convert layouts to kv interface

* Migrate mappings to kv layer

* Migrate org_config to kv layer

* Migrate organizations to kv layer

* Migrate servers to kv layer

* Migrate sources to kv layer

* Migrate users to kv layer

* Start removing unused migration logic

Since there is a migration path for users via updating to 1.7.x line then to 1.8, there isn't any real reason to continue supporting migrating from a version ~2 years old.

* Cleaning up bolt dead codes

* Re-add disabled code

* Migrate tests over to kv layer

* Migrate config to kv layer

* Create default organization

* Remove etcd for now

* Improve new client and new service implementations

* Uncomment bolt build tests

* Add layouts test

* Add more dashboard tests to kv
2020-01-21 09:26:23 -07:00
Greg 1806d6c298
chore: tidy prior to kv refactor (#5342)
* Start cleaning up/reviewing for kv refactor

* Remove dependency on graceful http layer

* Remove deprecated cli option --new-sources

* Run gofmt and remove dep related files

* Update non-influx deps

* Update kapacitor dep

* Compile regexp's once

* Remove un-needed struct members

* Remove unused integrations code
2020-01-09 08:49:42 -07:00
Delmer df41635301
fix: active kapacitor updating and ui defaults (#5079)
* fix(server): fix active kapacitor settings

Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Chris Goller <goller@gmail.com>
2019-02-12 18:50:56 -05:00
Alirie Gray 0f810debcb Rename org config method Update to Put for semantic accuracy
Co-authored-by: Jared Scheib <jared.scheib@gmail.com>
2018-07-10 15:42:44 -07:00
Alirie Gray 874110bd5e Rename org config receivers and function params to be more conventional
Co-authored-by: Jared Scheib <jared.scheib@gmail.com>
2018-07-10 15:32:23 -07:00
Alirie Gray 92029e5525 Remove unecessary FindOrCreate call in Update in organizations/org_config.go
Co-authored-by: Jared Scheib <jared.scheib@gmail.com>
2018-07-10 14:39:28 -07:00
Jared Scheib ae475c7ae8 Add OrganizationConfigStore & refactor org config to be per org
As previously implemented, OrganizationConfig was a global
object. This refactor adds the organization id to context for
every request, even when auth is disabled, so that org id
can be used to get/update an organization config.

Along those lines, this also removes OrganizationConfigStore
.Initialize and replaces .Get with .FindOrCreate, handling
the creation of organization configs upon first attempted
access.

Co-authored-by: Jared Scheib <jared.scheib@gmail.com>
2018-07-09 17:36:19 -07:00
Michael Desa d8d20547ab Change Organization ID to string from uint64 2017-12-19 10:13:43 -08:00
Michael Desa f8894b7d2d Clarify comment in organization/users Add method 2017-12-14 11:46:51 -08:00
Michael Desa 61ef8937ba Add comment clarifying UsersStore Add method 2017-12-14 11:36:26 -08:00
Michael Desa 1298c2eedc Only promote user to super admin in user org store
Add diff check to Organization UsersStore Add tests

Previously, a users super admin status was disregarded in the Add
facade. This was problematic when new users were added with a super
admin status, because they would not be granted the status. This created
an odd user experiece.
2017-12-14 10:56:23 -08:00
Michael Desa 39b9a90900 Remove organization LayoutsStore 2017-12-05 17:14:21 -05:00
Michael Desa 04f65d1c68 Allow empty Organization on Layouts in Org store
Previously, canned dashboards were global to the application. When
organizations were introduced, we scoped layouts under a specific
organization. This was done without consideration to the `canned`
layouts which are more global than a specific organization and likely
apply an an application level. Since the layout did not have any
organization associated with it, it was filtered out of the list of
results that one would see for `GET /mappings`.

This commit allows users to retrieve layouts that are stored in the
canned store that do not have an organization associated when the user
requests `All` layouts for an organization.

Future work for this is outlined as a comment in the commit.
2017-12-05 12:29:57 -05: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
Michael Desa e27936ee69 Add Num to UsersStore interface 2017-11-30 12:55:59 -05:00
Michael Desa afe97e0cec Prevent unintended update of existing user on Add
Previously, the organizations store did not check to see if the user
that a user was being "added" had a role in the organization, it simply
filtered out a users roles that did not belong to that organization and
blindly appended the new ones that were supplied.

This resulted in users being able to change another users role during
new Add request for the same user.
2017-11-29 17:58:42 -05:00
Michael Desa d854d6f8a4 Fix Update method in organization.UsersStore
Previously, when users were updated, we did not use the fields on the
user that was being persisted. As a result, the API responded with the
attribute being set, but the updated values were not actually stored in
bolt. This was not noticed previously because SuperAdmins had raw access
to the UsersStore
2017-11-10 19:06:38 -05: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 6fbfde5060 Add comments throughout codebase 2017-11-01 12:30:42 -04:00
Michael Desa 3eaca382d3 User explicit type when setting context 2017-11-01 09:49:02 -04:00
Michael Desa 978da16ecd Add org param to New Organizaiton methods 2017-10-31 17:40:58 -04:00
Michael Desa d7d69730d7 Refactor organizations tests to use mocks 2017-10-30 17:03:53 -04:00
Michael Desa 6e0bfa67df Move organization resouces to their own package 2017-10-30 14:31:19 -04:00