Commit Graph

371 Commits (master)

Author SHA1 Message Date
Jeffrey Smith II 4ed184dd82
fix: fixes an error querying virtual dbrps (#23731)
* fix: fixes an error querying virtual dbrps

When the virtual pointer was set to false, the mappings were being ignored.

* fix: missed part in a rebase

* test: add test for shard mapping virtual dbrps

* fix: do not create virtual mappings for equivalent physical mappings
2022-10-13 14:58:07 -04:00
Christopher M. Wolff aa9c49e9f5
build(flux): update flux to v0.180.1 (#23666)
* chore: make tests robust to Flux formatter changes
2022-08-24 11:59:16 -07:00
Andrew Lee 187f991d54
fix: improve virtual DBRP default handling (#23626) 2022-08-16 14:02:31 -06:00
Andrew Lee afbbfaca87
fix: fix virtual DBRP FindMany, make virtual bucket default if not overridden (#23623)
* fix: fix find dbrps, make bucket default if not overridden

* fix: allow filtering of virtual DBRPs, filter in shard mapper

* fix: update tests to mock for virtual filter for shards and update server test
2022-08-12 11:16:37 -06:00
Andrew Lee adeac8beea
feat: add virtual DBRP mappings based on bucket name (#23606)
* feat: add virtual DBRP mapping based on bucket name

* fix: improve error handling logic

* fix: update physical dbrp tests

* fix: update influxql tests with auto-mapped buckets

* fix: add virtual filtering and testing for virtual dbrps
2022-08-03 15:44:04 -06:00
Dane Strandboge 82d1123e78
build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
Jamie Strandboge e304ef9764
fix: add write permissions check for DELETE and DROP MEASUREMENT (#23219)
We previously allowed read tokens access to all of v1 query, including
InfluxQL queries that made state changes to the DB, specifically,
'DELETE' and 'DROP MEASUREMENT'. This allowed tokens with only read
permissions to delete points via the legacy /query endpoint.
/api/v2/query was unaffected.

This adjusts the behavior to verify that the token has write permissions
when specifying 'DELETE' and 'DROP MEASUREMENT' InfluxQL queries. We
follow the same pattern as other existing v1 failure scenarios and
instead of failing hard with 401, we use ectx.Send() to send an error to
the user (with 200 status):

{"results":[{"statement_id":0,"error":"insufficient permissions"}]}

Returning in this manner is consistent with Cloud 2, which also returns
200 with "insufficient permissions" for these two InfluxQL queries.

To facilitate authorization unit tests, we add MustNewPermission() to
testing/util.go.

Closes: #22799
2022-03-24 07:28:38 -05:00
Daniel Moran 0fbda8397d
feat: recommend `influxd downgrade` after encountering unknown KV migration (#22805) 2021-11-01 11:07:54 -04:00
Daniel Moran eedd84671b
feat: initialize `influxd downgrade` command to run `Down()` migrations on metadata (#22800) 2021-10-29 16:34:01 -04:00
Sam Arnold 5015297d40
fix: more expressive errors (#22448)
* fix: more expressive errors

Closes #22446

* fix: server only logging for untyped errors

* chore: fix formatting
2021-09-13 15:12:35 -04:00
Daniel Moran 01355a068c
refactor: move helper functions for setting up test stores into testing package (#22347)
* Move tenant.Service unit tests into its package
* Delete the top-level TenantService interface now that it's not used.
* Move helper funcs for setting up test stores into testing pkg
* Delete duplicate implementations scattered through the codebase
* Move error assertions into store-creation helpers
2021-08-31 16:43:45 -04:00
Daniel Moran cc6accf106
chore: delete old-style DBRP mapping (#22339) 2021-08-30 18:27:11 -04:00
Daniel Moran ba8f91f1d9
fix: improve error message when onboarding requests are missing data (#21849) 2021-07-14 15:52:19 -04:00
Jakub Bednář 4becb6d01a
feat(users): list users via the API now supports `offset`, `limit` or `after` parameter (#21367) 2021-05-12 14:09:52 +02:00
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
Daniel Moran d4a0c34c39
fix(onboarding): deprecate misleading `retentionPeriodHrs` key (#20798) 2021-03-01 09:55:39 -05:00
Stuart Carnie 6e7a6313d7 fix: Add a ByOrgID index to DBRP
This commit adds a new index and migration to the DBRP service for
retrieving all database and retention policy mappings for a single
organization.

This change was required to resolve an invalid assumption of the DBRP
service, which relied on a prefix match of the byOrgAndDatabase kv.Index
when performing search operations by organization ID only.

Closes #20096
2020-11-24 10:28:00 +11:00
George MacRorie 16d916a952 refactor(kv): delete deprecated kv service code
This includes removal of a lot of kv.Service responsibilities. However,
it does not finish the re-wiring. It removes documents, telegrafs,
notification rules + endpoints, checks, orgs, users, buckets, passwords,
urms, labels and authorizations. There are some oustanding pieces that
are needed to get kv service compiling (dashboard service urm
dependency). Then all the call sites for kv service need updating and
the new implementations of telegraf and notification rules + endpoints
needed installing (along with any necessary migrations).
2020-11-16 12:41:26 +00:00
George 8ca2989717 feat(dashboards): isolate service in own package (#19852)
feat(dashboard): add owner ID to dashboard model

This adds the explicit OwnerID field to Dashboard and also adds a
migration which populates dashboard owners IDs based on dashboard owner
URMs.

feat(dashboards): isolate service in own package

This change isolates the dashboards service into its own package. It
also updates the API to no longer interface with user resource mappings.
Instead it defines new handlers which rely on the newly populated owner
ID field.

chore(dashboards): port tests from http package into new service transport package

chore(launcher): use dashboard transport package client in launcher tests

chore(kv): remove now defunkt dashboard service implementations
2020-11-04 15:53:02 +00:00
George MacRorie b274e15eac fix(telegraf): support pagination parameters when listing 2020-11-04 15:53:02 +00:00
George MacRorie 42445a71ff chore(testing): remove unused mapping variable 2020-11-04 15:53:02 +00:00
George MacRorie 5feea36e16 refactor(telegraf): remove references to kv service telegraf service implementation 2020-11-04 15:53:02 +00:00
Dan Moran d3dd440c5f test: fix expected RP in existing test. 2020-11-03 12:37:50 -05:00
George 78cafa861b
refactor(notifications): isolate endpoint service (#19818)
* refactor(notifications): isolate endpoint service

Following the ongoing effort to isolate behaviours into their own
packages and off of kv.Service, this change move the notification
endpoints service implementation into its own package. It removes the
endpoint behaviors from the kv service completely.

* chore(influxd): wire up the isolated check service in place of kv service
2020-10-28 15:22:14 +00:00
George 3d643e0681
refactor(notification): move rule service into own package (#19804)
* refactor(notification): move rule service into own package

* chore(launcher): fix tests to use clients as opposed to direct kv service

* chore(influx): update task cli to consume core domain model task from client

* chore(kv): remove rule service behaviours from kv

This also introduces the org id resolver type. Which is transplanted
from the kv service. As this one function coupled all resource
capabilities onto the kv service. Making removing these capabilities
impossible. Moving this type out into its own package which depends on
each service explicitly ensures we don't have one type which has to
implement all the service contracts.

* fix(launcher): remove double reference to influxdb package
2020-10-27 11:45:05 +00:00
Stuart Carnie d28e55d3b6 fix(kv): Reorganize bcrypt password hashing outside transactions
This ensures that transaction lifetimes are shorter to reduce lock
contention.

Additionally, this PR removes the ability to set an empty password
when running the initial on-boarding process. According to the
original developer, this behavior was required to permit Cloud
processes to complete. As this code is no longer shared, this security
issue is corrected.
2020-10-12 08:06:32 -07:00
Alirie Gray 12039918e4 fix(variables): use Update function for Put Variable 2020-09-11 11:48:11 -07:00
Alirie Gray adbc036ebd fix(variables): add id to put variable request 2020-09-08 11:26:03 -07:00
Stuart Carnie f9b058772b
Merge remote-tracking branch 'origin/master' into sgc/tsm1 2020-09-02 11:11:28 -07:00
Lyon Hill 46d4f7d7bb
chore(tenant): point tests to new tenant service (#19477)
Now that the tenant service is complete we should be using it for all
test instead of the kv.Service.
2020-09-02 11:50:26 -06:00
Stuart Carnie 39ab4a10c5
Merge remote-tracking branch 'origin/master' into sgc/tsm1
# Conflicts:
#	cmd/influxd/launcher/query_test.go
#	go.mod
#	go.sum
#	query/promql/internal/promqltests/go.mod
#	task/backend/executor/executor.go
#	task/backend/executor/support_test.go
2020-08-26 09:26:43 -07:00
George e2e954b47a
feat(kv): add support for WithCursorLimit to ForwardCursor (#17524) 2020-08-26 12:10:00 +01:00
Stuart Carnie fccaf74954
fix(tenant): Fix FindBuckets to no longer returns hard-coded buckets
Closes #19189
2020-08-25 14:50:15 -07:00
Stuart Carnie 0e0b2a3d87
Merge remote-tracking branch 'origin/master' into sgc/tsm1 2020-08-25 09:03:07 -07: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
Michael Desa eb2dd5af7b
fix(kv): gaurd new org dashboard pagination with feature flag (#19421)
* fix(kv): gaurd new org dashboard pagination with feature flag

* chore: remove trailing whitespace from line

* fix(testing): remove extra context
2020-08-24 12:50:10 -07:00
Stuart Carnie ca77c4f4b7
Merge remote-tracking branch 'origin/master' into sgc/tsm1 2020-08-21 13:06:45 -07:00
Alirie Gray 9b4fef0f9a fix: add variable name validation for flux identifier 2020-08-21 10:28:18 -07:00
KevinSmile ebaa32313b fix(api/dashboards): FindOptions not working 2020-08-20 16:55:52 -06:00
KevinSmile 887f88bd5a fix(api/orgs): (API-design-issue) FindOptions for orgs 2020-08-20 16:55:30 -06:00
Stuart Carnie 2b8d6ca14a
fix(influxql): Fix broken unit tests 2020-08-14 15:09:40 -07: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
Lyon Hill 1891479780
feat(onboard): allow optional password (#19225)
* feat(onboard): allow optional password

We can now allow passwords as an optional arguement. This facilitates
api only users.
2020-08-05 12:42:17 -06: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
jlapacik 7db9f4c520 Merge branch 'master' into chore/merge-master 2020-05-26 10:03:42 -07:00