Commit Graph
64 Commits
Author SHA1 Message Date
Todd beecbbb8a2 Upsert creates a new KMS and Updates PKI workers (#2187) 2022-06-15 08:27:08 -07:00
06d0f99536 bug(workersAPI): do not allow nonprintable or uppercase name or desc (#2186)
* Send more info on KMS connect (#2182)

* Update nodeenrollment to v0.1.0

* bug(workersAPI): do not allow nonprintable or uppercase name or desc

* Put checks on create too

* Apply printable check to description in DB

* chore (worker): address PR feedback

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
Co-authored-by: Jim <jlambert@hashicorp.com>
2022-06-14 20:13:02 -04:00
Jeff Mitchell e6f6665bea Merge remote-tracking branch 'origin/llb-byow' into byow-attrib-consolidation 2022-06-14 17:39:18 -05:00
Jeff Mitchell 8335deb8b6 Update protos, generated code, and service handlers (#2188)
* Update protos, generated code, and service handlers

* Address review feedback
2022-06-14 17:54:35 -04:00
Jeff Mitchell 8fd663af47 Send more info on KMS connect (#2182) 2022-06-14 13:27:55 -04:00
Haotian 40ba275759 feat(worker): add 'initial_upstreams' field to worker config to prepare to replace 'controllers' field. Update worker config description on website. 2022-06-13 15:45:03 -07:00
irenarindos ee0ecc9991 fix context for worker upstreams 2022-06-13 08:44:50 -04:00
Jeff Mitchell 82b4e29d78 Properly fix (for now) the job limit 2022-06-11 11:04:40 -05:00
Jeff Mitchell cb190c0ea1 Disable session jobs for now so other jobs work right 2022-06-11 08:52:05 -05:00
Jeff Mitchell 5d3facf561 Merge remote-tracking branch 'origin/main' into llb-byow 2022-06-10 19:05:27 -04:00
Louis Ruch c4285b29cc fix(target): Correctly return egress credentials assocaited with target (#2167) 2022-06-10 12:26:19 -07:00
Irena Rindos f7dbf2a532 Merge pull request #2163 from hashicorp/irindos-clusterid-upstreams
feat(worker): Map cluster ID in config to upstream address
2022-06-10 10:17:51 -04:00
Jeff Mitchell 5a7291131f Make current key update on rotation 2022-06-10 09:33:09 -04:00
irenarindos 16d95262a6 feature(worker): add workerKeyId to status 2022-06-10 09:31:22 -04:00
irenarindos 3792fec48b fixup! feat(worker): Map cluster ID in config to upstream address 2022-06-09 16:42:56 -04:00
irenarindos 256498d40f fixup! feat(worker): Map cluster ID in config to upstream address 2022-06-09 16:39:20 -04:00
Jeff Mitchell 5b978d7fa7 Adjust parameter naming (#2161)
* Adjust parameter naming for some worker resource fields

* Add eventing listener to event when authentication is successful from a downstream worker
2022-06-09 16:27:17 -04:00
irenarindos 3aa7d11419 feat(worker): Map cluster ID in config to upstream address 2022-06-09 16:04:13 -04:00
Timothy Messier d741034829 perf(session): Change list behavior around terminated sessions
It was determined that it is a more common use case for users to request
non-terminated sessions (i.e. sessions in `pending`, `active`, or
`canceling` when requesting sessions. Notably, end users would need
non-terminated sessions to:

- Establish a new connection to a session.
- Terminate a session

So now by default a list request to `/v1/sessions` will *not* include
terminated sessions.

To still enable use cases where terminated sessions are needed, this
adds a new query parameter to include the terminated session:
`/v1/sessions?include_terminated=true`.

Note that this query parameter is considered experimental and subject to
change.
2022-06-09 19:28:04 +00:00
Timothy Messier 32070678dc perf(session): Remove connections from session list endpoint
Including the nested connection information in the session list response
had a negative impact on performance as it created a significant
multiplier on the number of rows that needed to be fetched from the
database.

It was also determined that this information was used by neither the
admin ui nor the desktop client.

Note that nested connection information can still be retrieved via a
read request for a specific session.
2022-06-09 19:28:04 +00:00
Timothy Messier f9eab71a4a feat(session): Add periodic job to delete terminated sessions 2022-06-09 19:28:04 +00:00
Jeff Mitchell d6362f9e5e Restrict anonymous user capabilities (#2156) 2022-06-09 11:30:01 -04:00
Jim f6c4e3c896 feature (worker): add worker events around authentication (#2157) 2022-06-09 11:28:12 -04:00
irenarindos 594e6e82b5 feat(worker): save workerAuth request to a file 2022-06-09 10:40:30 -04:00
Jeff Mitchell 9736b79d4e Remove temporary node authorization functions (#2147) 2022-06-07 14:56:04 -04:00
Jeff Mitchell d1b3b2441f Add node rotation (#2142) 2022-06-07 14:26:33 -04:00
Todd 1e3c941be1 Add active session count to the worker (#2145) 2022-06-07 11:21:39 -07:00
Jim 0425384b49 feature (events): add TestWithoutEventing(t) (#2137) 2022-06-07 12:23:01 -04:00
Jim fdf43fc4fe feature (worker): add CreateWorker(...) service (aka API) (#2143) 2022-06-07 11:50:30 -04:00
Todd 0f7e1ee7fa Fix canonical tags not getting assigned in the api resource. (#2144) 2022-06-06 16:50:22 -07:00
irenarindos 78150d88d9 feature(WorkerAuth): Create RotateRoots domain and job 2022-06-06 14:35:53 -04:00
Todd 43bcbba47f Implement UpdateWorker service method (#2133) 2022-06-06 10:52:50 -07:00
Jeff Mitchell 4117841cf9 Use persistent storage for worker auth credentials (#2139) 2022-06-05 22:50:44 -04:00
Jeff Mitchell c59d0df611 Add worker creation ACLs (#2138)
This is a bit more than simply adding the action; we had some
checks to ensure that list/create could only happen/not happen
in some cases and those had to be modified to account for
subactions.
2022-06-05 16:43:02 -04:00
Jeff Mitchell caf19f867e Rename some variables to remove Nodee 2022-06-03 17:47:44 -04:00
Jeff Mitchell f4642930b4 Updates from review of 2076 (#2135) 2022-06-03 17:32:33 -04:00
Haotian 631c174f47 feat(worker): implements WorkerAuthStorage wrapper for worker credential encryption (#2076)
* Adds WorkerAuthStorage wrapper for worker credential encryption using nodeenrollment library.

* Adds AuthStoragePath field in worker config and dev mode to specify directory to store credentials.
2022-06-03 13:25:58 -07:00
HaotianandTodd 1830605a7e refact(servers) Update api for new worker and controller server tables (#2101)
* Discontinue support for old Server message in ServerCoordinationService. Split message into ServerWorkerStatus and UpstreamServer (which currently contains controller addresses). Remove unnecessary fields. Modify workerStatusServer to use new fields.

Co-authored-by: Todd <github@quaddi.com>
2022-06-03 11:59:02 -07:00
Jeff Mitchell 1987264bc3 Migrate storage to database repo (#2132) 2022-06-03 14:44:53 -04:00
Todd a1c2f9f4d8 Add delete service function implementation. (#2124) 2022-06-03 11:34:52 -07:00
Todd abbfe45419 Add the Read/List service functions (#2123) 2022-06-03 11:19:04 -07:00
Jeff Mitchell 5c76017dd6 Fix nil storage 2022-06-03 12:58:26 -04:00
Jeff Mitchell 98449f25eb Fix build 2022-06-03 11:09:02 -04:00
4716c1a788 Update List Workers Repo function to allow limits and provide scopes (#2121)
* Update List Workers Repo function to allow limits and provide scopes

Co-authored-by: Irena Rindos <irenarindos@users.noreply.github.com>
Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
2022-06-02 09:28:34 -07:00
Todd 731a45eba6 Merge the worker_status table with the worker table (#2111) 2022-06-01 13:25:29 -07:00
Jeff Mitchell 46e97a2b91 Update to new nodee lib bits (#2120) 2022-06-01 13:35:46 -04:00
Jeff Mitchell 7bfe35da0d Update controller address handling (#2089)
* Don't assume it's non-empty or that this is an issue
* Ensure it's empty if the response is coming back through the multihop
  service so that it simply uses what is in the config file, at least
  for now
2022-06-01 01:09:56 -04:00
irenarindos c811dff89b refact(api): move worker handlers 2022-05-26 19:19:07 -04:00
Todd a281d10206 Add worker config table and view (#2090)
* Remove the server_id from session table, change it to worker_id on session_connection

This is step 1 in updating the worker table.  The worker is becoming a public resource so it must have
a public id.  We drop the server_id column on the session_connection table and add the worker_id column
so we can use the wt_public_key type.  Since db migrations are applied while the controller is offline,
it should be safe to assume all session connections are not in a running state, thus allowing us to null
out all the worker ids in the session_connection table.

For now we don't have very good enforcement of the wt_public_id constraints, since the id is currently
defined in the worker config, but this will soon change and the worker's id will be generated by the
controller.
2022-05-24 15:08:02 -07:00
ToddandIrena Rindos 3fbf901739 Add source to worker tags table (#2087)
* Remove the server_id from session table, change it to worker_id on session_connection

This is step 1 in updating the worker table.  The worker is becoming a public resource so it must have
a public id.  We drop the server_id column on the session_connection table and add the worker_id column
so we can use the wt_public_key type.  Since db migrations are applied while the controller is offline,
it should be safe to assume all session connections are not in a running state, thus allowing us to null
out all the worker ids in the session_connection table.

For now we don't have very good enforcement of the wt_public_id contraints, since the id is currently
defined in the worker config, but this will soon change and the worker's id will be generated by the
controller.

* Adding worker tag db writing test.

* Move the server table back to the top.

* Update comment for the worker object.

* Update comment for the worker table.

* Add worker tag sources ("config" or "api")

* Revert renaming of UpsertWorker until later.

* Remove no longer needed files.

* Moving the TestWorker into the servers package. Fix the worker tags test.

* Update internal/proto/controller/storage/servers/store/v1/worker.proto

Co-authored-by: Irena Rindos <irenarindos@users.noreply.github.com>

* Place the repos back together so they can be refactored in a different PR.

Co-authored-by: Irena Rindos <irenarindos@users.noreply.github.com>
2022-05-20 11:55:54 -07:00