Commit Graph

15 Commits (master)

Author SHA1 Message Date
Jamie Strandboge e304ef9764
fix: add write permissions check for DELETE and DROP MEASUREMENT ()
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: 
2022-03-24 07:28:38 -05:00
Sam Arnold 725794ef28
feat: show measurement database and retention policy wildcards ()
* feat: show measurement database and retention policy wildcards

Closes 

* chore: formatting

* test: this commit fails tests with empty database

* fix: show measurements with one empty database
2021-10-05 13:20:15 -04:00
Sam Arnold 5015297d40
fix: more expressive errors ()
* fix: more expressive errors

Closes 

* fix: server only logging for untyped errors

* chore: fix formatting
2021-09-13 15:12:35 -04:00
Daniel Moran cc6accf106
chore: delete old-style DBRP mapping () 2021-08-30 18:27:11 -04:00
Daniel Moran d747e7ec4e
feat: add config parameters to toggle WAL concurrency and timeouts ()
* feat: add context parameter to Take() method on fixed limiter
* refactor: plumb context through to uses of Take()
* test: update tests to pass context as needed
* feat: add config toggles for setting WAL write concurrency & timeout
2021-06-09 11:03:53 -04:00
Daniel Moran 00420fb54c
fix(influxql): make meta queries respect query timeout ()
Co-authored-by: davidby-influx <dbyrne@influxdata.com>
2021-05-24 21:10:53 -04:00
Daniel Moran 00afd95cb7
refactor: automated move of errors and id from root to kit ()
Co-authored-by: Sam Arnold <sarnold@influxdata.com>
2021-03-30 14:10:02 -04:00
Stuart Carnie 3ac530edd2 fix: Track seen databases in map and skip duplicates 2020-11-17 09:17:28 +11:00
Ayan George ca2055c16c
refactor: Replace ctx.Done() with ctx.Err() ()
* 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
Stuart Carnie 8576d1df99 feat: Implement DELETE FROM and DROP MEASUREMENT
Closes 
2020-09-11 11:37:43 -07:00
Stuart Carnie dee8977d2c
chore: move v2/v1/tsdb → v2/tsdb 2020-08-26 10:46:47 -07:00
Stuart Carnie 8bebf9cbeb
fix(coordinator): Return correct data types for stand-in RP values
Future work is required to ensure the retention policy information
is appropriately retrieved from the bucket service and / or meta client
2020-08-25 16:26:16 -07:00
Stuart Carnie 8a7dcc21fb
feat(influxql): Initial implementation of InfluxQL query engine
* Some tests are broken or do not pass; follow up PRs will resolve that
2020-08-14 12:37:30 -07:00
Stuart Carnie 89532f0c29
refactor: move v2/v1/models to v2/models 2020-08-03 09:20:51 -07:00
Stuart Carnie 92efddbfbe
chore(tsdb): Initial commit of tsdb package
* pulls in 1.x tsdb, compiles and passes test
2020-08-03 09:17:23 -07:00