Commit Graph

51 Commits (01355a068c3ceeea975b0ba34c59f279c4f52339)

Author SHA1 Message Date
Daniel Moran 00afd95cb7
refactor: automated move of errors and id from root to kit (#21101)
Co-authored-by: Sam Arnold <sarnold@influxdata.com>
2021-03-30 14:10:02 -04:00
Daniel Moran ba4099ddb9
feat(cmd/influx): allow setting shard-group durations for buckets via API and CLI (#20911)
Co-authored-by: Alexander Savinykh <asavinykh@nbrx.de>
2021-03-11 14:51:03 -05:00
George 45a3f2e87c
feat(paging): add support for after id parameter in find options (#19219)
* feat(paging): add support for after id parameter in find options

* chore(http): update swagger to reflect after query parameter in list buckets

* chore(changelog): update changelog to reflect after query parameter in list buckets

* chore(tenant): update tenant storage tests for paginating with after
2020-08-25 14:59:59 +01:00
George 5cbe74630e
chore(tenant): make tenant and kv both conform with harness (#19266) 2020-08-11 15:56:42 +01:00
Alirie Gray dd85de0e78
fix: add quotation marks to bucket name validation (#19222) 2020-08-05 13:30:45 -07:00
Jonathan A. Sternberg 0cdbd496f4
fix(query): paginate bucket results in the bucket lookup (#19111)
The `buckets()` command would use a bucket lookup that wrapped the
`FindBuckets` API. It did not use the pagination aspect of this API
correctly. When the underlying implementation was changed to a version
that correctly implemented pagination, this broke the query `buckets()`
command. Since it was query that used the API incorrectly rather than a
regression in the `FindBuckets` implementation, this fixes the usage to
correctly use pagination.
2020-07-29 11:23:13 -05:00
George a2c042c872
fix(testing): accidental shadowing in parallel tests (#18945) 2020-07-14 16:18:21 +01:00
George 96d84b9126
refactor: migrator and introduce Store.(Create|Delete)Bucket (#18570)
* refactor: migrator and introduce Store.(Create|Delete)Bucket

feat: kvmigration internal utility to create / managing kv store migrations

fix: ensure migrations applied in all test cases

* chore: update kv and migration documentation
2020-07-01 12:08:20 +01:00
Jonathan A. Sternberg 5aeca082c8
chore: update staticcheck and fix newly identified lint checks (#18737) 2020-06-26 18:54:09 -05:00
Lyon Hill 57ed471bbe
fix: tenant findBucket action needs to properly route actions (#18069)
Tenant bucket look up needs route a action to storage to use indexes.
I added an error condtion into the storage code to ensure this was working
but the tests did not exercise this piece of code. Both have been remedied.
2020-05-12 16:00:38 -06:00
Alirie Gray 2c0916addf
refactor: create new token package (#17874) 2020-04-30 07:52:21 -07: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
Brandon Farmer e473394e7d feat(influxdb): prevent users from rename system buckets 2019-10-30 12:53:43 -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
Jade McGough d147874c1e
fix(kv): mock system buckets (#14884) 2019-08-30 12:47:06 -07:00
Jade McGough 2fa1ca3f49
feat: add metadata for system buckets when org is created (#14741)
feat: add metadata for system buckets when org is created
2019-08-28 12:50:23 -07:00
Kelvin Wang 57ceb9e275 feat(influxdb): bucket created and updated time 2019-05-17 11:49:10 -04:00
Kelvin Wang 76cc27751b feat(influxdb): add bucket desc 2019-04-24 11:20:05 -04:00
Kelvin Wang 7a72c363f2 remove org from bucket 2019-04-22 18:39:05 -04:00
Kelvin Wang 9d44ac3635 rename bucket organization to org 2019-04-22 18:39:01 -04:00
Kelvin Wang 054ce89dc5 fix(kv): fix bucket not found by name 2019-04-02 15:10:56 -04:00
Kelvin Wang fb6e3b3a5f fix(kv): fix bucket update issue 2019-03-08 11:36:05 -05:00
Kelvin Wang 2fa517c19c fix(testing): update bucket update uniqueness 2019-03-06 10:17:56 -05:00
Jade McGough 7840e5e6b4 fix(testing): return organization name in failure messages 2019-01-22 19:12:51 -08:00
Leonardo Di Donato 91f4ffba30 chore: bucket pagination improvements 2019-01-17 12:35:00 +01:00
zhulongcheng ca332b59de filter buckets by FindOptions 2019-01-16 13:08:56 +01: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
Kelvin Wang de708f3e98 fix(bolt): check org id exists before create bucket 2019-01-03 15:20:13 -05: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 909fb6e98c
fix(http): remove id param for /buckets and update swagger (#1942) 2018-12-13 16:27:34 -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
kelwang 6db9acc951
Revert "Revert "convert /buckets endpoint error to platform error "" 2018-11-30 13:27:40 -05:00
kelwang 2a57dc1970
Revert "convert /buckets endpoint error to platform error " 2018-11-29 12:02:32 -05:00
Kelvin Wang 232d9d71e3 fix(http): fix bucket errors 2018-11-29 09:58:56 -05: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 ff46c74d0f fix(platform/testing): check ID validity 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
Mark Rushakoff d910989677 fix(http): assign bucket fields in CreateBucket 2018-09-26 11:11:58 -07:00
Chris Goller 31a2ed1fbb feat(testing): add service testing helpers 2018-09-14 21:08:49 -05:00
Jade McGough 0b70dc99c4
don't store references to internal buckets (#789)
* add types to bucket service tests

* add type to bucket cmd interface

* bucket type needs to be defined in json for POST creations

* rip out bucket type stuff

* remove type from bucket tests

* add InternalBucketID helper fn

* remove more code

* remove org from internal bucket ID
2018-09-14 09:26:59 -07:00
Jade McGough cd30e5a820
add internal system buckets for orgs (#652)
feat(bolt): add internal system buckets for orgs
2018-09-06 09:19:58 -07: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 ae9e7c0087 Adapt tests to ID generators returning pointer to platform.ID 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