Commit Graph

118 Commits (f385d197131d76201b08d80169c0482fd7360bd4)

Author SHA1 Message Date
zhulongcheng e29f925679 feat(http): construct bucket handler by BucketBackend 2019-02-06 19:18:23 +01:00
zhulongcheng 4dbfae4628 construct user handler by UserBackend 2019-02-06 19:18:23 +01:00
Kelvin Wang 74b5dccfb4 updates based on review 2019-01-23 09:29:50 -08:00
Kelvin Wang 0e4c55a82c feat(http): add urm endpoints 2019-01-23 08:46:33 -08:00
Kelvin Wang 6e3e4503c2 feat(influxdb): add urm for scraper 2019-01-23 08:46:32 -08:00
Chris Goller a11773838f feat(http): host swagger docs at /docs and /api/v2/swagger.json 2019-01-22 11:16:27 -06:00
Michael Desa cdc9146b78 feat(influxdb): add authorized user resource mappings
feat(bolt): add function to find a resources organization id

rename platform to influxdb

Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
Co-authored-by: Michael Desa <mjdesa@gmail.com>

fix(bolt): rename FindResoureOrganization to FindResoureOrganizationID

feat(authorizer): add authorized user resource mapping service

Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
Co-authored-by: Michael Desa <mjdesa@gmail.com>

feat(influxdb): wire up authorized user resource mapping

Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
Co-authored-by: Michael Desa <mjdesa@gmail.com>

fix(authorizer): remove unused field from tests

Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
Co-authored-by: Michael Desa <mjdesa@gmail.com>
2019-01-18 14:22:08 -05: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
kelwang ecf63c7935
Merge pull request #11285 from influxdata/update_scraper_endpoint
fix(http): update scrapers endpoint
2019-01-18 11:59:09 -05:00
Lyon Hill 523e52d662
Show organization names in task api actions (#11223)
* Show organization names on task actions.

closes #10876
2019-01-18 09:10:14 -07:00
Kelvin Wang 63ae68b9eb fix(http): update scrapers endpoint 2019-01-18 10:38:28 -05:00
Kelvin Wang f0838e4c71 feat(authorizer): add scraper authorizer 2019-01-18 10:01:51 -05:00
Leonardo Di Donato 4706339a9a feat(http): hook handler's source svc to authorizer 2019-01-18 14:05:36 +01:00
Michael Desa 24e10a4594
Merge pull request #11261 from influxdata/feat/authorize-auths
add authorized authorization service
2019-01-18 07:55:28 -05:00
Michael Desa c9f2a597a4
Merge pull request #11207 from influxdata/feat/authorize-dashboards
add dashboard authorization
2019-01-18 07:55:15 -05:00
Michael Desa 3f6b5a27e8 feat(http): wire up authorized authorization service 2019-01-17 19:03:36 -05:00
Michael Desa 01983553c4 feat(influxdb): add authorization for user actions 2019-01-17 16:05:24 -05:00
Michael Desa 78249fdb89 feat(http): wire up dashboard authorizer 2019-01-17 16:04:16 -05:00
Kelvin Wang 2f97711703 feat(authorizer): add telegraf authorizer 2019-01-17 11:37:01 -05:00
Leonardo Di Donato ad6f2e42f5 feat(http): hook macros authorizer to handler
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-01-17 14:50:18 +01: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 59fde4a9de feat(authorizer): add authorized bucket service
feat(http): use authorizer bucket service for API handler.

test(authorizer): add tests for bucket service auth
2019-01-16 15:37:19 -05:00
Michael Desa bfb865cd72 feat(influxdb): authorize org service operations
feat(influxdb): add unauthorized error code

feat(testing): export ErrorsEqual method

feat(authorizer): add Authorize method that authorizers permissions

feat(authorizer): add org service that authorizes actions to a wrapped org service

feat(http): use authorized org service in org handler

feat(authorizer): rename Authorize to IsAllowed
2019-01-16 14:41:57 -05:00
Kelvin Wang 390f553416 fix(http): fix the user resouce mapping filter 2019-01-14 12:07:51 -05:00
Kelvin Wang 82f79932c1 feat(http): add bucket and org name in response 2019-01-11 13:09:19 -05:00
Kelvin Wang ce6004243c add(gather): add writer interface 2019-01-11 13:09:18 -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
Michael Desa 81dcfee03e
Merge pull request #2163 from zhulongcheng/session-backend
initialize session handler by SessionBackend
2019-01-09 17:05:59 -05:00
Michael Desa 857b60150e feat(platform): add proto service for creating templated resources
feat(http): add http handler for proto service

feat(mock): add mock proto service

test(http): add proto handler tests

fix(platform): add view as option when adding a cell

feat(platform): add dashboard to proto struct

feat(fs): add filesystem implementation of proto

feat(http): add protos endpoints to api handler

feat(cmd/influxd/launcher): add protos path to server

doc(http): add protos to swagger

test(cmd/influxd/launcher): add --protos-path to launcher tests

fix(fs): remove unused args from test

fix(http): use platform.Error where appropriate
2019-01-09 09:55:15 -05:00
Michael Desa 338e0587d0 fix(platform): nest view beneath dashboard cell
feat(platform): add functional options for platform errors

fix(testing): set dashboard ids properly in dashboard tests

feat(bolt): add dashboard specific views

fix(bolt): delete view when cell is removed or dashboard is deleted
2019-01-08 18:11:13 -05:00
zhulongcheng 83529543ac initialize session handler by SessionBackend 2018-12-29 11:41:06 +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
zhulongcheng 7ce8237d29 replace default-404 handler with custom-404 handler 2018-12-25 10:35:36 +08:00
AJ Bond 941e7526c0 fix(http): Fix developer mode default
Developer mode is now passed to assets
closes #2050
2018-12-21 16:33:04 -05:00
Leonardo Di Donato 09dca2ff29 fix(http): check for user before creating authorization 2018-12-21 19:23:12 +01: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 dc4c2cae35 fix(http): update swagger doc for /api/v2/ response
Alphabetize the links so that additions and verifications are easier.
2018-12-20 16:25:53 -05:00
Nathaniel Cook f4dfda705a fix(http): remove /api/v2/query/plan
BREAKING CHANGE: The API endpoint exposed internal details about the implementation of
the logical and physical plans. Those data structures need to be free to
change without breaking the API. For now since the endpoint is unused it
is being removed. A similar API may be added back in that correctly
abstracts away the internal details of plans.
2018-12-18 12:17:34 -07:00
Michael Desa 9501a547f1 feat(http): add /query/analyze endpoint to analyze queries
review(http): add suggestions from pr review

doc(http): update swage description of analyze endpoint

fix(http): remove authorization header from query analyze endpoint
2018-12-18 11:23:59 -05:00
zhulongcheng dcac51377e pass user service to handler New function 2018-12-17 23:59:30 +08:00
zhulongcheng 3b43d83da0 add UserService to members/owners endpoint handlers 2018-12-15 00:18:50 +08:00
Jade McGough 1bb276f6bc
feat(http): add labels for views (#1800)
* feat(http): add labels for views

* update swagger

* make fmt
2018-12-11 11:42:13 -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
Jade McGough e0fc798595
feat(http): add labels endpoints to telegraf config (#1824) 2018-12-11 10:15:34 -08:00
Jade McGough 8c961e12bb
Labels (#1668)
* feat(platform): add label struct

* feat(platform): add label service interface

* WIP label service

* chore(http): simplify URMapping validation

* WIP label service skeleton

* add new GET labels handler

* feat(http): add POST handler for label service

* feat(http): add label delete handler

* fix json tag

* add happy path testing

* feat(http): add label endpoints to dashboard service

* make fmt

* add label delete handler

* make fmt again :(

* feat(bolt): add label implementation

* wire boltdb implementation of labels

* feat(mock): add mock for label service

* fix tests, add delete test

* add remaining tests, flesh out GET params

* unused code

* remove comments

* add labels endpoints

* clean up labels after deleting a dashboard

* fix issues from code review

* WIP remove type from labels

* feat(http): add label cli functions

* fixes

* make fmt

* feat(http): add labels to tasks and buckets

* feat(bolt): remove labels if their resources are deleted

* remove bolt cleanup for now

* make fmt

* type conversion magic

* feat(inmem): implement label service

* prevent race conditions

* remove labels from inmem if their resources are deleted

* fix race condition

* fix formatting
2018-12-03 08:07:08 -08:00
Jade McGough 873aae3fad
Revert "feat(http): add label service" (#1667)
This reverts commit 70a430c599.
2018-12-03 04:27:27 -08:00
Jade McGough 70a430c599
feat(http): add label service (#1346) 2018-11-30 21:08:35 -08:00
Michael Desa 407c01cb17 fix(platform): use authorizer instead of authorizion for endpoints
feat(platform): add ToPermissions method to user resource mapping

The ToPermissions method returns a set of permissions that is granted
via a user resource mapping.

feat(bolt): resolve sessions permissions on lookup

feat(http): use authorizer instead of authorization service for write api

feat(bolt): create user resource mappings for org users in bucket create

feat(bolt): create user resource mapping for first org/user

fix(platform): use authorizer for query endpoint instead of authorization

test(http): use cmp instead of reflect for decode test
2018-11-20 10:56:58 -08: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 7ca5187dc6 feat(http): add plan endpoint to analyze queries 2018-11-01 21:00:37 -05:00
Kelvin Wang 0b41822434 fix the logger, and get resturns nothing 2018-10-31 19:50:04 -04:00
Kelvin Wang 74ef984e53 add http for telegraf 2018-10-30 14:00:10 -04:00
Kelvin Wang 360f8035dd add reset password
fix logger panic, update endpoint, add password reset
2018-10-29 11:56:33 -04:00
Gianluca Arbezzano 6dd6a08ea2
fixed inconsistency in links
Hello
As suggested in https://github.com/influxdata/platform/issues/983 I
changed `auths` to `authorizations` to have the key and the link in
line.

I went for this fix in order to avoid BC. I don't know if that's
the fix you had in mind. Or you were speaking more about short and long
terms.

Fixed #983

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2018-10-26 17:05:06 +02:00
Lyon Hill 19b7709bad
Add tasks to the influx cli (#1163) 2018-10-23 11:51:13 -06: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 4a951cfca8 feat(http): add user/member endpoints to view service 2018-10-11 11:15:02 -07:00
Brandon Farmer 0799765d1b Add me endpoint to links 2018-10-10 13:31:34 -07:00
Brandon Farmer d65008d24b Add a me endpoint for chronograf
Returns the currently signed in user from session or token
2018-10-10 10:07:54 -07:00
Jade McGough 4c7f66a1c3 feat(http): add owner/member endpoints for tasks 2018-10-09 13:19:19 -07:00
Chris Goller 90494a5309 chore(fmt): fix and simplify go formatting 2018-10-08 17:23:54 -05:00
Chris Goller aee35e4cde fix(http): links updated to match swagger doc 2018-10-06 10:11:20 -05:00
Edd Robinson 81e0fbabeb Integrate WAL into engine 2018-10-05 12:44:27 +01:00
Jeff Wendling 5fa10786a2 Fix issue with rebasing 2018-10-03 17:40:01 -06:00
Jade McGough 802cd0080e feat(http): move member/owner routes to factories 2018-10-02 15:31:18 -07:00
Jared Scheib 4969a91a9b fix(http): fix typo in /signout links response 2018-10-02 18:27:09 -04:00
Michael Desa 0cf834e532 chore(platform): refactor platform http handler to allow for auth 2018-10-02 14:11:44 -04:00