Commit Graph

31 Commits (7cbaebf7b75bc61f0982406d25439a033bfc9ec0)

Author SHA1 Message Date
Lyon Hill 29918a45df
fix(tenant): Allow tenant to update user and org with same name (#17833)
This will allow us to match the existing behavior that allows for update requests to go through with the same name.
2020-04-23 08:33:03 -06:00
Jonathan A. Sternberg 0ae8bebd75
refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
Lyon Hill 609970c0de
feat(tenant): Add in service functions and business logic (#17296)
* feat(tenant): Add in service functions and business logic

Built on top of the crud layer of the system we should now have additional service logic.
The addition of service layer should allow for us to verify similar functionality to the kv system.
2020-03-17 13:23:00 -06:00
Johnny Steenbergen 236f52ba62 fix(http): improve error handling and response to api consumer for org service 2020-02-04 09:43:51 -08:00
Brandon Farmer ea82dc3470 fix(tasks): tasks look up system bucket id 2019-10-21 14:48:47 -07:00
Brandon Farmer b343250390 fix(influxdb): fixes broken tests from system bucket changes 2019-10-21 14:48:47 -07:00
Chris Goller 623224614e feat(kv): random ids without comma, space, backslash for org and bucket
At times snowflake id generation would create org and bucket IDs with
characters that had special meaning for the storage engine.

The storage engine concats the org and bucket bytes together into a
single 128 bit value.  That value is used in the old measurement
section.  Measurement was transformed into the tag, _measurement.

However, certain properties of the older measurement data location
are still required for the org/bucket bytes.  We cannot have
commas, spaces, nor backslashes.

This PR puts a specific ID generator in place during the creation of
orgs and buckets.  The IDs are just random numbers but with each
of the restricted chars incremented by one.  While this changes the
entropy distribution somewhat, it does not matter too much for our
purposes.

... because now org and bucket ids are checked for previous existence
transactionally in the key-value stores.  If the ID does already exist
then we try to generate a new key up to 100 times.
2019-09-08 01:50:05 -05:00
Kelvin Wang b8c2cd6c05 feat(influxdb): add org create and update time 2019-05-20 17:36:29 -07:00
zhulongcheng 8d5c7d33a7 feat(http): update org description 2019-05-16 22:33:14 +08:00
Jade McGough c6a0bf93a7
Merge pull request #13661 from influxdata/no_filter_parameters_provided
fix(influxdb): invalid filter error
2019-05-09 15:14:54 -07:00
Kelvin Wang ea54e2c2c8 fix(kv): fix empty org name 2019-04-26 18:16:28 -04:00
Kelvin Wang 2021321186 fix(influxdb): invalid filter error 2019-04-26 12:22:42 -04:00
Kelvin Wang 4c9f34122c feat(influxdb): add org desc 2019-04-22 22:40:07 -04:00
Chris Goller 1ec7b69d85 fix(kv): error org search if neither name nor id is set 2019-02-21 11:18:08 -08:00
Jade McGough 7840e5e6b4 fix(testing): return organization name in failure messages 2019-01-22 19:12:51 -08:00
Mark Rushakoff d73d73c0d4 chore: rename imports from platform to influxdb
I did this with a dumb editor macro, so some comments changed too.

Also rename root package from platform to influxdb.

In interest of minimizing risk, anyone importing the root package has
now aliased it to "platform" so that no changes beyond imports were
necessary in those files.

Lastly, replace the old platform module to local path /dev/null so that
nobody can accidentally reintroduce a platform dependency while
migrating platform code to influxdb.
2019-01-09 20:51:47 -08:00
Andrew Watkins 3429e8d0c6
feat(auth): rewrite authorization service (#2157)
* feat(view-token-overlay): add view token overlay

* test(tokens): update tests

* chore(auths): rename mock data file

* feat(token-view): clicking on description opens token view modal

* feat(token-view): add ability to close overlay

* feat(token-view): display token permissions with updated permissions shape

* feat(token-view): wip update authorization and permission shapes

* feat(auth): wip refactor auth permissions

* fix(auth): generate permissions via functions

* fix(auth): make Id ID

* chore(types): update generated client

* feat(auth): wip add user and org names to auth

* fix(user): didnt save rebase

* feat(auth): WIP refactor auth

* feat(auth): check for user existence during auth creation

* feat(auth): org must exist during auth creation

* fix(auth): pluralize telegrafs resource type

* docs(http): update swagger definition for the Authorization

* test(auth): fix broken tests

* docs(swagger): update cur_swagger Authrorizations

* fix(api): remove trace from cur_swag

* test(ui/token): update components with new generated type definitions

* feat(http): add lookup service adding names for permissions

* fix(http): remove debugging panics

* chore: go tidy

* fix: unsaved rebase

* test(idpe): add ids to Authorizations for log tests
2018-12-28 15:02:19 -08:00
Jade McGough 78d0fc2b17
fix(testing): compare expected error messages against actual (#1857)
* fix(testing): compare expected error messages against actual

* remove nonsense

* remove nonsense

* add expected error message for bucket not found

* oops
2018-12-12 10:24:33 -08:00
Kelvin Wang 2b602bfcfe fix(http): convert org errors endpoint 2018-12-06 11:05:13 -05:00
Chris Goller b4e1cd4199 tests(http): add tests for creation without IDs 2018-10-12 10:03:06 +02:00
Chris Goller 3be56561d8
test(bolt): add tests for missing orgs and buckets (#1051) 2018-10-11 13:31:46 -05:00
Chris Goller 2bea48f15a refactor(testing): rename MustIDFromString to MustIDBase16 2018-10-11 09:54:19 -05:00
Leonardo Di Donato 4ac77b634d fix(platform/testing): missing ID args within tests 2018-10-11 09:54:18 -05:00
Leonardo Di Donato 8d7f06cf4b feat(platform/id): using uint64 for platform.IDs
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Co-Authored-by: Lorenzo Fontana <lo@linux.com>
2018-10-11 09:54:18 -05:00
Chris Goller 31a2ed1fbb feat(testing): add service testing helpers 2018-09-14 21:08:49 -05:00
Michael Desa 8c87c9d132 revert #442 2018-08-01 14:54:32 -04:00
Leonardo Di Donato 5addb88eb5 MustIDFromString no more requires test instance
It panics now.
2018-08-01 18:20:59 +02:00
Leonardo Di Donato 3191de776d Refactoring code using platform.IDs
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2018-08-01 18:20:59 +02:00
Leonardo Di Donato 969fe7d69f Refactoring platform testing package 2018-08-01 18:20:59 +02:00
Lorenzo Fontana 145122232c
Testing using ids generated from string using Decode
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2018-07-20 19:43:22 +02:00
Michael Desa f654b59662 feat(platform): add boltdb implementation of services
feat(platform): add id to authorization

feat(platform): add user arg to CreateAuthorization method on auth svc

migrate(platform): move idp command to platform directory

This comit did not move the ifql command as it depends on the query
service which has yet to be migrated.

feat(platform): add optional user name to authorization struct

feat(platform): add organization name to bucket struct

Additionally allow filtering buckets by organization name.

feat(prom): ensure that prom auth svc implement base interface

feat(prometheus): add user to create authorization method

feat(prom): drop user string from create authorization

feat(zap): ensure that zap auth svc implements base service interface

feat(zap): add user to create authorization method

feat(zap): drop user string from create authorization

feat(http): add ids to authorization service

feat(http): ensure that http authoriztaion service implements auth svc interface

feat(http): use authorization ids in authorization handler

squash(http): add check for http status accepted in authorization service

feat(http): clean up authorization service and handlers

feat(http): drop user string from create authorization

fix(http): normalize the http authorization service

feat(http): normalize bucket service and handler methods

Additonally, we added support for DELETE bucket

feat(http): add delete user handler

Additionally, there was a bit of general cleanup

feat(http): add delete route for organization handler and service

Did a bit of additional cleanup of the http code.

test(testing): add service conformance tests

test(testing): add organization service conformance tests

test(testing): add conformance test for orgs service

Additionally, there was a bit of cleanup in the users service tests

test(testing): add conformance test for authorizations service

test(testing): update auth tests to validate that user exists

test(testing): update authorization conformance tests with user name

test(testing): update bucket conformance tests to include organizations

feat(bolt): add bolt implementation services

feat(bolt): add bolt implementation of organization service

feat(bolt): add bolt implementation of users service

feat(bolt): add bolt implementation of authorization service

feat(bolt): add user to create authorization method

feat(bolt): drop user string from create authorization

fix(bolt): set user name on authorization after put

feat(bolt): update bucket servie to include organizations

feat(bolt): add dependent destroy of resources

feat(cmd/idpd): use bolt services in platform server

feat(cmd/idpd): use bolt organization service in platform server

feat(cmd/idpd): use bolt users service in plaform server

feat(cmd/idpd): use bolt client as authorization service

feat(cmd/idp): show user name in output of auth sub command

feat(cmd/idp): clean up bucket subcommand of idp command

fix(cmd/idp): normalize idp command output for users

fix(cmd/idp): normalize auth subcommand output

feat(cmd/idp): add support for delete organiztion command

migrate(idp): move ifql subcommand of idp to platform
2018-05-21 10:08:22 -04:00