Commit Graph

116 Commits (c442ca198c6f7feff4e233dee8372cd8c9cca087)

Author SHA1 Message Date
Jorge Landivar 47cd6df834 fix(http): task runs and logs no longer use task token (#14416)
* fix(http): task runs and logs no longer use task token

* test(http): skip session tests

These tests are not using checking authorization correctly.
2019-07-23 10:31:39 -05:00
kelwang 99bfd05820
Merge pull request #14339 from influxdata/add_debug_log
feat(http): add auth debug log
2019-07-15 17:08:41 -04:00
Alirie Gray c7f09d6a56
chore(tasks): use pointers for task errors (#14343) 2019-07-15 13:57:51 -07:00
Kelvin Wang f55cf4c8b3 feat(http): add auth debug log 2019-07-15 12:09:59 -04:00
Kelvin Wang 9ecada4dce feat(http): convert errorEncode to use interface 2019-06-26 21:41:01 -04:00
Chris Goller 14e7daa6e4
fix client tracing propagation from doubly recording (#14204)
Closes #14203

* chore(vendor): update to opentracing 1.1.0

* fix(http): finish client span

* fix(http): remove extra span injection
2019-06-26 00:48:15 -05:00
Alirie Gray 66157c9d44 chore(tasks): consolidate task errors into task_errors.go 2019-06-17 16:03:18 -07:00
Alirie Gray 0ae2d318b1 chore(tasks): update run limits in swagger and FindRuns 2019-06-12 14:48:32 -07:00
Christopher M. Wolff c35c15f54d
refactor(http): move queryd http interface to idpe (#13862) 2019-05-09 10:41:14 -07:00
jlapacik fb47b8cd42 fix(http): use lang.Compile 2019-04-12 07:15:27 -07:00
Jade McGough 7bcff2e973 fix(http): remove newPatchLabelHandler, it should not exist
This was removed in the labels 2.0 rewrite, and looks like it was added back as a regression
2019-03-27 14:31:04 -07:00
Mark Rushakoff 3092faace8 test(task): ensure task can be created over HTTP using org name
Closes #12089.
2019-03-14 21:23:14 -07:00
Kelvin Wang dcc052b1c2 fix(query): fix same bucket name with different orgs 2019-03-08 20:37:05 -05:00
Jacob Marble 603a1f26e0 use tracing.StartSpanFromContext 2019-03-07 12:12:31 -07:00
Jacob Marble 9541e861a3 goimports -w -local github.com/influxdata/influxdb 2019-03-07 12:12:31 -07:00
Jacob Marble 92fa813c45 add spans to multiple services 2019-03-07 12:12:31 -07:00
Jorge Landivar 2d0ba57f4b
Merge pull request #12387 from zhulongcheng/task-paging
feat(http): add task paging links
2019-03-07 01:49:29 -06:00
Palak Bhojani ef440615e6 Update response to include event object for LogEvent type
Co-authored-by: Alex Paxton <thealexpaxton@gmail.com>
Co-authored-by: Chris Goller
2019-03-06 16:01:47 -08:00
zhulongcheng b8a9c9595d feat(http): add task paging links 2019-03-06 15:06:35 +08:00
Mark Rushakoff 3307276be1 fix(task): don't error when URM task disappears
In the platform adapter, we ask the URM for a list of tasks the user
owns, and then we look up each task individually.

The task service tests uncovered a legitimate bug where FindTasks would
return a "task not found" error, originating from looking up a task that
was present when we interrogated the URM but was deleted before we could
find it in the task store.

This change also removes duplicated URM logic from the HTTP handler
which has since been pushed down into the platform adapter.
2019-03-04 08:35:04 -08:00
Jorge Landivar 9e6a2247c0
Merge pull request #12134 from zhulongcheng/validate-task-status
fix(http): validate status for creating and updating a task
2019-02-27 13:08:06 -06:00
Lyon Hill b3f450eca9
Allow the CLI to find tasks by org name (#12202)
* Allow the CLI to find tasks by org name
2019-02-27 08:56:32 -07:00
docmerlin (j. Emrys Landivar) 669c464335 feat(tasks): look up tasks by orgname 2019-02-25 15:57:01 -06:00
zhulongcheng efadd43886 fix(http): validate status for creating and updating a task 2019-02-24 15:34:32 +08:00
Mark Rushakoff f79d9cba4f fix(task): pass task's authorization to query system, if using sessions
The query system specifically expects an Authorization. When a request
comes in using a Session, use the target task's Authorization, if we are
allowed to read it, when executing a query against the system bucket.
2019-02-22 12:50:55 -08:00
Mark Rushakoff 12a604172f fix(task): create authorizations for tasks, which can read their task
Also set the generated token's description while we're here.

This enables us to use task's Authorization when we need to query the
system bucket to get run logs, etc. but we only have a Session.
2019-02-22 09:15:25 -08:00
Mark Rushakoff ecb37d7cc4 fix(task): restore functionality for creating task with org name
This is a partial rollback of changes #12004. Issue to track adding a
test: #12089.
2019-02-21 16:30:52 -08:00
Lyon Hill 3665feef38
Populate organization name on task create action (#12004)
* Populate organization name on task create action

* Move the responsiblity of organization lookup to the platform adaptor
2019-02-20 13:36:35 -07:00
Mark Rushakoff abd6fee757 fix(task): use HTTP 404 for no results when listing runs, logs 2019-02-19 11:00:43 -08:00
Mark Rushakoff cbef811c63 refactor(task): remove explicit org from run/log lookup
Task ID is now a required value on run and log filters. It was
effectively required by all implementations before anyway, so now those
types reflect that requirement.

Organization ID was removed from those same fields. The TaskService
looks up the organization ID via the task in cases where we need it at a
lower layer.
2019-02-16 14:34:49 -08:00
Lyon Hill 48cc643992
Clean out user from the task store's (#11882)
* Clean out user from the task store's
2019-02-15 15:50:09 -07:00
Mark Rushakoff 0977a651df fix(task): create authorization when using token to create task 2019-02-15 12:11:55 -08:00
Michael Desa c5b9376c0b
feat(http): add method to create authz for task when using session 2019-02-15 13:04:47 -05:00
Mark Rushakoff 007f5059c7 refactor(task): extract TaskCreate struct
With the ongoing authorization work, creation arguments will differ from
what's returned on reads. More specifically, creation will accept a
token, but reads will report back a token ID.

This refactor facilitates that authorization work, and also brings the
code closer to the swagger definition, for the TaskCreateRequest type in
particular.
2019-02-12 15:10:03 -08:00
Lyon Hill 6db627b76c
Update task http handler to use user resource mapping. (#11827)
* Update task http handler to use user resource mapping.
2019-02-12 15:37:46 -07:00
Michael Desa 23f6c4b3fe fix(http): pass resource type through to label handlers
Co-authored-by: Iris Scholten <ischolten.is@gmail.com>
2019-02-07 19:08:56 -05:00
Michael Desa dbc241b728 fix(http): use urm without authz where appropriate 2019-02-06 14:24:21 -05:00
zhulongcheng 2d48b85f0a feat(http): construct label handler by LabelBackend 2019-02-06 19:18:23 +01:00
zhulongcheng be37e07bea feat(http): construct member handler by MemberBackend 2019-02-06 19:18:23 +01:00
zhulongcheng 18f4825e4f feat(http): construct task handler by TaskBackend 2019-02-06 19:18:23 +01:00
Lyon Hill ab2a7265a4
Add user resource management to the task API (#11664)
* Add user resource management to the task API
step 1 and 2 of #11427
2019-02-05 08:26:26 -08:00
Mark Rushakoff 3f0e40812e fix(http): return 404 when task or run is not found
For an operation that looks up a task or a run, when that operation
fails, only set the status to 404 if that operation explicitly returns
ErrTaskNotFound or ErrRunNotFound.

It's possible that the operation could fail for a reason other than the
ID being invalid: for example, if there was an IO error preventing the
lookup from succeeding.

Harden that behavior with tests for the task handler.

Closes #11589.
2019-01-25 15:44:09 -08:00
Kelvin Wang f99f4759fa fix(http): fix task errors 2019-01-25 10:31:24 -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 4df856c229 chore(task): add messages to all HTTP errors from tasks
Closes #11544.
2019-01-25 09:22:34 -08:00
Mark Rushakoff a0ff60c075 fix(task): respect limit when finding runs 2019-01-24 15:32:16 -08:00
Mark Rushakoff 04a86c92af fix(http): consistently use influxdb errors in task handlers
And ensure that the task HTTP client consistently expects influxdb
errors, so that they're properly extracted and returned to the caller.

Closes #11426.
2019-01-24 11:25:02 -08:00
Mark Rushakoff 6bda17c673 fix(task): use formal errors during task creation
The client expects influxdb.Error, so use them on the server.

Also clarify the message when the task option is missing.
2019-01-22 09:40:51 -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