Commit Graph

141 Commits (master)

Author SHA1 Message Date
cui fliter 46ec649b9c
chore: fix function name in comment (#24281) 2023-06-14 11:18:13 -04:00
Jeffrey Smith II f74c69c5e4
chore: update to go 1.20 (#24088)
* build: upgrade to go 1.19

* chore: bump go.mod

* chore: `gofmt` changes for doc comments

https://tip.golang.org/doc/comment

* test: update tests for new sort order

* chore: make generate-sources

* chore: make generate-sources

* chore: go 1.20

* chore: handle rand.Seed deprecation

* chore: handle rand.Seed deprecation in tests

---------

Co-authored-by: DStrand1 <dstrandboge@influxdata.com>
2023-02-09 14:14:35 -05:00
Sam Arnold e5ccbb8831
fix: forbid reading OSS buckets for a token with only write permissions (#23148)
* fix: forbid reading OSS buckets for a token with only write permissions

We previously enabled write tokens to also find DBRP buckets, in order to allow
the legacy /write (not /api/v2/write) endpoint to read the DBRP mappings and
find the real bucket id to write to.

This had the unintended consequency of allowing tokens with only write permissions
to read data in buckets via the legacy /query (not /api/v2/query) endpoint with
InfluxQL.

This change fixes the behaviour to allow writing to /write with a write-only
token, while forbidding reading from /query.

* fix: nanosecond precision in tests
2022-02-24 09:59:14 -05: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 dc3b501298
refactor: rename Lock/Unlock on KV stores to RLock/RUnlock (#22357) 2021-08-31 17:03:54 -04:00
Daniel Moran cc6accf106
chore: delete old-style DBRP mapping (#22339) 2021-08-30 18:27:11 -04:00
William Baker 5b2511c776
feat(notebooks): additional auth filter for listing (#21699) 2021-06-16 09:02:40 -04:00
William Baker 8ee59f4bf4
feat(annotations): authorization service (#21665)
* feat(annotations): added authz service for annotations and streams

* fix: tests and adjustments

* chore: misc cleanup

* chore: update number in authz comment

Co-authored-by: Daniel Moran <danxmoran@gmail.com>

* chore: update number in authz comment

Co-authored-by: Daniel Moran <danxmoran@gmail.com>

* chore: update number in authz comment

Co-authored-by: Daniel Moran <danxmoran@gmail.com>

* fix: address review comments

* feat: added post-list filter for fine-grained auth

Co-authored-by: Daniel Moran <danxmoran@gmail.com>
2021-06-11 17:39:51 -04:00
William Baker b0ea3b6675
feat: backup and restore sqlite database (#21584)
* feat: new metadata backup endpoint

* feat: added restore/sql API endpoint

* fix: content-type is multipart/mixed, part names are kv and sql

* fix: changed multipart manifest to buckets and made it .json

* feat: added lock for backing up sqlite and bolt dbs

* fix: use read lock instead of write lock on kv during backup

* fix: use filepath.Join for temp dirs
2021-06-02 19:07:53 -04:00
William Baker c267b31232
chore: move notebook service interface to root (#21570) 2021-05-26 12:27:56 -04:00
William Baker 40897b9a98
feat(notebooks): authorization for notebooks (#21490)
* feat(notebooks): auth changes to top-level authz

* feat(notebooks): added authorization

* chore(notebooks): added tests for authz
2021-05-17 19:01:27 -04:00
Sam Arnold 7b2e122869
refactor: refactor for tasks backport (#21117)
* chore: remove dead code

* refactor: move FluxLanguageService interface to fluxlang

* chore: run fmt

* refactor: move task.go from top level to task/taskmodel

* chore: run formatter

* chore: fix up import ordering with gci
2021-04-07 14:42:55 -04: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 d4a0c34c39
fix(onboarding): deprecate misleading `retentionPeriodHrs` key (#20798) 2021-03-01 09:55:39 -05: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
Daniel Moran 3317ea0644
fix: enable write-only users to pass auth checks in the V1 API (#19945) 2020-11-09 18:10:35 -05: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
Ben Johnson 2c554ae974 fix: Use operator permissions for backup/restore 2020-11-05 10:05:01 -07:00
Ben Johnson 6e1097c625 feat: Minor updates to backup/restore 2020-11-05 10:05:01 -07:00
Ben Johnson 23679c2375 feat: Implement backup/restore CLI subcommands. 2020-11-05 10:05:01 -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
Yoofi Quansah 48f72e0dfd chore: remove hardcoded constants for ids 2020-09-10 12:35:25 -07:00
George 5e22e0101d
chore(auth): remove unnecessary URM service from Bucket authorizer (#19060) 2020-08-04 14:37:14 +01:00
Bucky Schwarz 88cdf43db1 revert: feat(pkger): add Stack resource type to global list
This reverts commit 99eabf8a44.

A backend change was needed to make this work in Cloud envs, that change is blocked.
2020-07-22 12:48:53 -07:00
Johnny Steenbergen 99eabf8a44 feat(pkger): add Stack resource type to global list
now that Stacks have landed, the resource type can now be included for
any all access tokens, not just the token from setup
2020-07-21 11:16:00 -07:00
Lyon Hill a31b651057
feat(task): Add new permission lookup pattern for executor (#18920)
* feat(task): Add new permission lookup pattern for executor

We can now use the user service to populate task owners permissions.
This should improve the task lookup time and decouple the task system
from the URM system. In the future we will have the ability to better isolate
tenant pieces from the rest of the service.

* feat: add feature flagging
2020-07-13 14:47:58 -06:00
George b8f5604613
revert(tasks): Add new permission lookup pattern for executor (#18869) (#18915)
This reverts commit e9e4d794cf.
2020-07-10 11:05:07 +01:00
Lyon Hill e9e4d794cf
feat(task): Add new permission lookup pattern for executor (#18869)
We can now use the user service to populate task owners permissions.
This should improve the task lookup time and decouple the task system
from the URM system. In the future we will have the ability to better isolate
tenant pieces from the rest of the service.
2020-07-09 14:06:46 -06: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
Brett Buddin d8aa318985
fix(dbrp): Change DBRP mapping service to use Buckets resource permissions instead of DBRP. 2020-06-15 15:50:37 -04:00
Gianluca Arbezzano 1cf64fd721
feat: dbrp service
Signed-off-by: Lorenzo Affetti <lorenzo.affetti@gmail.com>
Co-Authored-By: Gianluca Arbezzano <gianarb92@gmail.com>
Co-Authored-By: George MacRorie <gmacrorie@influxdata.com>
Co-Authored-By: Alirie Gray <alirie.gray@gmail.com>
2020-05-15 12:05:38 +02:00
George f646653b1b
refactor!: replace authorizer.Allowed method with PermissionSet (#17959)
* refactor!: replace Allow method with PermissionSet

* chore(changelog): update changelog to reflect changes to authorizer
2020-05-13 12:27:46 +01:00
Lyon Hill c02e83038f
fix: org filtering for both kv and tenant need to match behaviors. (#17758) 2020-04-16 12:22:21 -06:00
Alirie Gray 8975fd2365
refactor(tenant): move bucket and urm auth layers to tenant service (#17474)
Co-authored-by: Lyon Hill <lyondhill@gmail.com>
2020-04-07 11:13:27 -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
Lorenzo Affetti 77ae0eacb5
fix(authorizer): fix auth for authorizations 2020-04-02 11:21:39 +02:00
Johnny Steenbergen 7a24e450c1 feat(pkger): add auth for pkger stack CRUDing
adds new AuthAgent type that can be reused across service middleware.
2020-03-26 10:11:59 -07:00
Marc Delagrammatikas ea8e6d15d0 refactor: fixes typo in OnboardInitialUser method
Fixes typo introduced by 7b99c28a99
2020-03-20 10:48:20 -07:00
Lorenzo Affetti 40999629ee
refactor(authorizer): auth micro framework 2020-03-19 09:43:20 +01:00
Marc Delagrammatikas 7b99c28a99 refactor: rename Generate to OnboardInitialUser
Renaming Generate in anticipation of a new method that will onboard
users other than the initial user. The intent is to simplify multi-user
setups.

Co-authored-by: Chris Goller <goller@gmail.com>
2020-03-18 15:35:26 -07:00
Gavin Cabbage 14ba382e4f
fix(buckets): return unauthorized if no org is found for user (#17264) 2020-03-13 15:35:33 -04:00
Alirie Gray 991002d83b
fix(labels): add check for write permissions to create label (#17174) 2020-03-12 10:51:50 -07:00
Lorenzo Affetti fa80fad800
refactor(authorizer): make document permission in line with other services 2020-03-12 09:52:37 +01:00
Lorenzo Affetti 76067d548e
Merge pull request #17201 from influxdata/fix/notification-endpoint-auth
fix(authorizer): fix endpoint handler auth
2020-03-11 18:30:36 +01:00
Lorenzo Affetti 4e22b0b1af
fix(authorizer): fix endpoint handler auth 2020-03-11 18:09:53 +01:00
Gavin Cabbage f5e8547482
fix(buckets): prevent returning system buckets to unauthorized users (#17117) 2020-03-11 13:06:08 -04:00
Greg f98874566c
fix: allow authorized label service to be called indirectly (#17111)
* fix: allow authorized label service to be called indirectly

17071 exists because pkger loads all service resources as authorized on
start, resulting in them all being authorized when referenced indirectly
(not hit directly via api by consumer). Rather than restructure pkger to
only authorize direct services, this allows proper indirect auth to
labels (the cause of 17071).

* Add orgService to tests

* Add resource types to find orgID from
2020-03-11 10:58:39 -06:00