Commit Graph

56 Commits (be37e07bea3270751fd28fd9c53ad4353147b29e)

Author SHA1 Message Date
zhulongcheng be37e07bea feat(http): construct member handler by MemberBackend 2019-02-06 19:18:23 +01:00
zhulongcheng ef308ab9bd feat(http): construct org handler by OrgBackend 2019-02-06 19:18:23 +01:00
zhulongcheng e024b13a2e fix(http): rename desc to descending 2019-02-02 15:11:06 +08:00
Kelvin Wang 875162abd3 update(http): remove check error true 2019-01-25 10:29:27 -08:00
Kelvin Wang 79ce30691e update(http): remove kerrors, change the default to be influxdb error 2019-01-25 10:29:26 -08:00
Mark Rushakoff 3e1551334f fix(http): ensure response body always closed
This avoids leaking resources.

Found by manually inspecting results of `git grep -A5 -F '= hc.Do'`.
2019-01-18 14:55:48 -08:00
Jade McGough 8a1d7ba1ba
Labels v2 (#11198)
* WIP first-class endpoint for labels

* WIP

* WIP

* add all the boilerplate

* fix boltdb

* fix http label test

* fix test

* WIP

* fix test failures

* reenable all tests

* add failing test for label mappings

* add label mapping bolt bucket

* implement resource -> label mapping fn

* add inmem label mapping

* delete label mappings

* remove unused stuff

* add missing functions

* add POST endpoint for labels

* add GET route for label

* delete label endpoint

* add label patch endpoint

* remove commented code

* add label service to api handler

* update comment

* add FindLabelByID test

* use platform.Error

* change path name

* formatting

* remove label patch from swagger

* avoid potential orphaned mapping bug

* guard against creating label mappings from nonexistent labels

* update swagger

* update swagger

* update swagger

* fix swagger indentation

* update swagger
2019-01-18 11:03:36 -08:00
Michael Desa f66774a766 fix(http): use wrapped org/bucket services only when required
return reasonable error message for http errors on write
2019-01-16 19:03:08 -05:00
Michael Desa c60031a6b7 fix(influxdb): change resource to resource type 2019-01-15 12:57:57 -05: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
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
Michael Desa 4c60eacb58 chore(platform): cleanup, document, and use secret service
fix(http): add members/secrets/labels links on org response

fix(http:cmd/influxd): use secret service in api backend

fix(bolt): return empty list if there are no secrets for an org

chore(vault): add description of vault usage
2018-12-28 11:11:21 -05:00
Michael Desa 158be4b599
Merge pull request #1993 from zhulongcheng/fix-user-service
fix(http): pass user service to handler New function
2018-12-21 09:37:42 -05:00
Michael Desa 32bd37de9a fix(http): remove second potention call to w.WriteHeader
Multiple calls to w.WriteHeader were possible if there was an error that
was encountered while encoding the response. To resolve this, we simply
log any error that is encountered instead.
2018-12-20 11:11:09 -05:00
Jade McGough 786af8154e add patch label endpoints 2018-12-18 01:45:49 -08:00
zhulongcheng dcac51377e pass user service to handler New function 2018-12-17 23:59:30 +08:00
zhulongcheng 5f40883342 add custom-404 handler 2018-12-16 22:55:39 +08:00
zhulongcheng bec174676e fix failed rebase 2018-12-15 00:18:50 +08:00
zhulongcheng 7cd1994cd4 add ResourceType param to filter resource members 2018-12-15 00:18:50 +08:00
zhulongcheng 3b43d83da0 add UserService to members/owners endpoint handlers 2018-12-15 00:18:50 +08:00
Jade McGough a4363800bd
feat(http): add labels endpoints to organizations (#1827)
* feat(http): add labels endpoints to organizations

* make fmt
2018-12-11 10:15:45 -08:00
Kelvin Wang 2b602bfcfe fix(http): convert org errors endpoint 2018-12-06 11:05:13 -05:00
Michael Desa 56de056085 feat(vault): add vault implementation of secret service
test(platform): run testcontainer integration tests for nightly release

Integration tests for the vault secret service using testcontiners
should not run along with unit tests, however, they should run on some
regular schedule. This commit introduces `make test-integration` which
runs integration tests for vault using testcontainers. The command introduced
relies on docker being available on the host it is executed on.

chore(platform): make go modules tidy

chore: try to fix go mod

chore(platform): remove explicit logrus dependency

chore(platform): run go mod tidy

chore(platform): replace github.com/Sirupsen/logrus with github.com/sirupsen/logrus

chore(platform): update docker dependency

feat(vault): add vault implementation of secret service

test(platform): run testcontainer integration tests for nightly release

Integration tests for the vault secret service using testcontiners
should not run along with unit tests, however, they should run on some
regular schedule. This commit introduces `make test-integration` which
runs integration tests for vault using testcontainers. The command introduced
relies on docker being available on the host it is executed on.

chore(platform): make go modules tidy

chore: try to fix go mod

chore(platform): run go mod tidy

feat(vault): add vault implementation of secret service

chore(platform): make go modules tidy

feat(platform): add Put/Patch/Delete methods on secret service

feat(vault): add Put/Patch/Delete methods on vault secret service

feat(http): add http handler methods for secret service

feat(bolt): add Put/Delete/Patch methods to bolt secret service

feat(testing): add tests for Put/Patch/Delete methods in secret service

feat(mock): add mock secret service

feat(http): add tests for secrets endpoints

feat(http): update swagger for secrets endpoints

chore: run go mod tidy
2018-11-30 13:07:32 -08:00
Jakub Bednar 324f0b9516 Fixed the organizations members paths 2018-11-14 11:54:06 +01:00
Michael Desa 7227bf8fa2 feat(platform): add operation log for resources
feat(platform): add dashboard operation log interface

feat(bolt): add dashboard operation log to bolt client

feat(platform): add links to dashboard load response

fix(http): update links in json response of dashboards

feat(bolt): add operation logs for each resource

feat(http): add routes for operation logs

feat(cmd/influxd): set operation logs on http api backend
2018-11-02 14:21:14 -04:00
Chris Goller e621ed8e72 fix(http): all DELETEs now return 204 2018-10-29 14:10:33 -05:00
Jade McGough 8b12e90a46 run go fmt 2018-10-16 15:18:22 -07:00
Jade McGough d280b7ea43 fix(http): inject user_resource_mapping_service when creating route handlers 2018-10-16 14:49:35 -07:00
Jade McGough 1e0ad7a95d chore(http): remove unused handlers in org_service 2018-10-16 14:12:28 -07:00
Chris Goller 7a0206b2a5 refactor(http): remove variables named temp 2018-10-11 09:54:19 -05:00
Leonardo Di Donato 3d732812d4 update(platform/http): partial refactoring for uint64 IDs 2018-10-11 09:54:18 -05:00
Leonardo Di Donato d54fdd51e0 wip(http): porting to uint64 IDs
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
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
Jade McGough bb6d8cf156 fix(http): inject resource type into Post member factory 2018-10-09 13:19:19 -07:00
Jade McGough 802cd0080e feat(http): move member/owner routes to factories 2018-10-02 15:31:18 -07:00
Lorenzo Fontana 1a2f606533
Convert everything to /api/v2
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2018-09-28 14:23:21 +02:00
Lorenzo Fontana aa8016feca
Convert tests to v2
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2018-09-28 14:20:31 +02:00
Lorenzo Fontana 30afec36bc
Convert all routes to v2 endpoint
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2018-09-28 14:20:31 +02:00
Jade McGough 8e04f5e6e8
add org member endpoints (#846)
add org member endpoints
2018-09-24 10:17:54 -07:00
Chris Goller fbb1cc21b2 fix(http): org response returns empty array 2018-09-16 22:24:48 -05:00
Chris Goller e9695d7caf fix(http): fix org decoding and add test 2018-09-14 18:34:40 -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
Gianluca Arbezzano 0c862f71a1
Add links to orgs http handler
Fixed #795

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2018-09-11 14:55:29 +02: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
Jade McGough 43e0d143e7
chore(http): return early if a critical error occurs in write path org/bucket lookup (#767) 2018-09-05 15:53:57 -07:00
Chris Goller 8fa72fa35b feat(auth): allow authorizations to be enabled/disabled 2018-08-29 13:07:38 -05:00
Michael Desa 8c87c9d132 revert #442 2018-08-01 14:54:32 -04:00
Leonardo Di Donato c59e4e8a50 Refactoring http package 2018-08-01 18:20:59 +02:00
Nathaniel Cook b63394da0a fix(errors): Update Fluxd errors
This PR also completes some TODOs about kit/errors and http/errors.
2018-06-28 16:56:35 -06:00
Jade McGough c5f829591b fix(http): prevent creation of nameless organizations 2018-06-22 11:18:17 -07:00