Commit Graph

329 Commits (52da4020f8120c8577e21be8418f589f60568d98)

Author SHA1 Message Date
Daniel Moran bac5515a0a
fix(kv): add KV migration to repair DBRP mappings broken by schema change (#20168) 2020-11-25 12:49:45 -05:00
Stuart Carnie dfbe114ead fix: PR Feedback – ensure keys cannot contain / 2020-11-24 10:28:00 +11: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
Stuart Carnie 78977eb3c8 fix: Ensure Index.Walk fetches matching foreign keys only
This commit modifies the behaviour of the indexWalk function to ensure
it parses the key parts and matches the foreign key exactly.

Closes #20096
2020-11-24 10:28:00 +11:00
Arnav Aggarwal 96b26f5a42
Merge pull request #19979 from influxdata/timeFilterTasks
feat(tasks): added functionality to filter runs by time
2020-11-16 13:22:07 -08:00
George MacRorie 5954db8c4d chore(documents): reinstate minimal read-only document store for dashboard templates 2020-11-16 12:41:26 +00: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
Daniel Moran 15b9531273
fix: correct various typos (#19987)
Co-authored-by: kumakichi <xyesan@gmail.com>
2020-11-11 13:54:21 -05:00
Arnav Aggarwal 46d20c127a fix(tasks): made code review changes 2020-11-11 08:21:51 -10:00
Arnav Aggarwal 64a562db42 feat(tasks): added functionality to filter runns by time 2020-11-10 10:30:34 -10:00
Adrian Thurston 30ad7281aa
refactor: replace builtin package with fluxinit/static (#3304) (#19909)
A static initialization is not desirable in the main binaries, as it forces all
paths of code to init, but it is still useful in tests. It allows static
intialization to be performed once for all tests and eliminates the need to
always add the FluxInit call. Added a fluxinit/static package that calls
fluxinit.FluxInit() to replace the builtin package. This hides the nature of
the initialization and makes it clear that it is mandatory initialization code
getting called.
2020-11-05 16:54:28 -08:00
Ben Johnson 419b0cf76b feat: Implement full restore 2020-11-05 10:05:01 -07: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 5feea36e16 refactor(telegraf): remove references to kv service telegraf service implementation 2020-11-04 15:53:02 +00:00
George MacRorie 222470b1ef refactor(telegraf): add new isolated config service 2020-11-04 15:53:02 +00:00
Dan Moran ace60ed322 fix(kv): remove extra multiplication of RP to avoid overflow
Mirrors change from the onboarding service.
2020-11-03 12:37:50 -05:00
Stuart Carnie 6bc4158a46 feat(authorization): Add bcrypt password support to v1 authorizations
This commit extends the `v1/authorization` package to support
passwords associated with a token.

The summary of changes include:

* authorization.Service implements influxdb.PasswordsService
* Setting passwords for authorizations
* Verifying (comparing) passwords for a given authorization
* A service to cache comparing passwords, using a weaker hash
  that will live in memory only. This implementation is copied
  from InfluxDB 1.x
* Extended HTTP service to set a password using
  /private/legacy/authorizations/{id}/password

Closes #
2020-10-28 13:03:42 -07: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
Stuart Carnie 5c63c2163d feat(authorization): Create a v1 authorization service
This service is a private API for managing authorization tokens
for v1 API requests.

Note that this commit does not hook up the service to the v1
`/query` and `/write`, which will occur in a subsequent PR.

Closes #19812
2020-10-27 08:26:10 -07: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
greg linton 13cb2927bb Merge branch 'master' into feat/18733 2020-09-21 17:21:06 -06:00
Ayan George ca2055c16c
refactor: Replace ctx.Done() with ctx.Err() (#19546)
* refactor: Replace ctx.Done() with ctx.Err()

Prior to this commit we checked for context cancellation with a select
block and context.Context.Done() without multiplexing over any other
channel like:

  select {
    case <-ctx.Done():
      // handle cancellation
    default:
      // fallthrough
  }

This commit replaces those type of blocks with a simple check of
ctx.Err().  This has the following benefits:

* Calling ctx.Err() is much faster than entering a select block.

* ctx.Done() allocates a channel when called for the first time.

* Testing the result of ctx.Err() is a reliable way of determininging if
  a context.Context value has been canceled.

* fix: Fix data race in execDeleteTagValueEntry()
2020-09-16 12:20:09 -04:00
Yoofi Quansah 99bb1bba4d
Merge pull request #19548 from influxdata/yq-issue-19547
chore: remove hardcoded constants for ids
2020-09-14 09:20:45 -07:00
greg linton 53b325c7d0 Merge branch 'master' into feat/18733 2020-09-11 14:23:24 -06:00
Yoofi Quansah 2099b64578 chore: total removal of references to hardcoded IDs 2020-09-11 12:29:00 -07:00
Alirie Gray 12039918e4 fix(variables): use Update function for Put Variable 2020-09-11 11:48:11 -07:00
Yoofi Quansah 48f72e0dfd chore: remove hardcoded constants for ids 2020-09-10 12:35:25 -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
greg linton 4e1bc7ceb2 feat(pkger): add ability to export dashboards by name 2020-08-27 15:32:04 -06:00
Stuart Carnie 9163edb187
Merge remote-tracking branch 'origin/master' into sgc/tsm1 2020-08-26 10:14:42 -07: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
Lyon Hill a8fe07bfc7
chore(task): clean up old maxPermission code (#19432)
Tasks no longer uses the max permission system to pupulate an
authorization. We can safely remove this dead code.
2020-08-26 10:26:32 -06:00
George e2e954b47a
feat(kv): add support for WithCursorLimit to ForwardCursor (#17524) 2020-08-26 12:10:00 +01:00
Stuart Carnie 0e0b2a3d87
Merge remote-tracking branch 'origin/master' into sgc/tsm1 2020-08-25 09:03:07 -07:00
Brett Buddin f96303bfb2
feat(task): Record last success and failure run times in the Task (#19390)
* feat(task): Record the latest success/failure of a Task.

* chore(task): Fix typo.

* chore(kv): Test the updating of latest success/failure fields.

* fix(kv/task): Copy the latest success/failure fields when unmarshalling.

* chore(changelog): Add 19390 to changelog.
2020-08-25 10:44:37 -04: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 cc656e5221
Merge remote-tracking branch 'origin/master' into sgc/tsm1
# Conflicts:
#	storage/reads/aggregate_resultset.go
#	storage/reads/aggregate_resultset_test.go
#	storage/reads/array_cursor.gen.go
#	storage/reads/array_cursor.gen.go.tmpl
#	storage/reads/array_cursor.go
#	storage/reads/array_cursor_gen_test.go
#	storage/reads/array_cursor_test.gen.go.tmpl
#	storage/reads/group_resultset.go
#	storage/reads/group_resultset_test.go
#	storage/reads/resultset.go
2020-08-20 10:52:34 -07:00
Brett Buddin 0780232b83
feat(task): Parse Task Options using Flux AST Helpers (#19326)
* feat(task): Extract options using AST-based method.

* feat(task): Use AST-based option APIs for updating task option.

* chore(task): Use the old way of parsing durations.

* fix(task): Ordering changed on us. Fixing tests to reflect the new order.

* fix(task): There's no way for us to know if there are multiples with the current APIs.

* chore(task): Guard against duplicate options. Minor cleanup.

* fix(kit/feature): Break cyclical dependency between influxdb and pkgs that use feature.

* chore(task): Feature flag updating Flux options.

* chore(task): Ensure we are testing both paths of feature flag.

* chore: Remove dead code.

* chore(task/options): Remove unnecessary conditional.

* chore(task/options): Unexport some error helpers.
2020-08-20 11:57:23 -04:00
Stuart Carnie 057285e23a
Merge remote-tracking branch 'origin/master' into sgc/tsm1
# Conflicts:
#	query/logging.go
#	query/logging_test.go
#	query/stdlib/influxdata/influxdb/rules.go
#	query/stdlib/influxdata/influxdb/rules_test.go
#	query/stdlib/testing/testing.go
#	storage/flux/reader.go
#	storage/flux/table.gen.go
#	storage/flux/table.gen.go.tmpl
#	storage/flux/table.go
#	storage/flux/table_test.go
2020-08-11 10:25:01 -07:00
George 5cbe74630e
chore(tenant): make tenant and kv both conform with harness (#19266) 2020-08-11 15:56:42 +01: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
Stuart Carnie 4124968b28
fix(kv): Really use inmem store for in memory URM tests 2020-08-03 15:14:15 -07:00