Commit Graph
2100 Commits
Author SHA1 Message Date
Jeff Mitchell 4efbce3112 Add description updating via worker status (#2197) 2022-06-15 15:50:36 -04:00
Todd b3efe0eb3a Allow TestPkiWorker to be created in an authorized state. (#2198)
* Allow TestPkiWorker to be created in an authorized state.
2022-06-15 12:42:50 -07:00
Todd e379234259 Remove CanonicalAddress, GetApiTags(), and NewWorkerForStatus. (#2196)
Minor testing tweaks are also included.
2022-06-15 11:47:38 -07:00
Jim d7aaa9f7e2 fix (byow): minor updates to UpsertWorkerStatus(...) on conflict (#2194) 2022-06-15 14:43:39 -04:00
Jeff Mitchell 11b025c016 Start updates on worker service test (#2195) 2022-06-15 14:24:42 -04:00
Todd 90a999d3fe Some testing fixes (#2193) 2022-06-15 10:47:25 -07:00
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
Todd 577d8418cd Make name column immutable for kms workers. (#2190)
errcode 23601 is the error code used by the immutable_column() function.
2022-06-14 15:52:35 -07: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
JimandTodd 9997f1a7bd feature (workers): required schema changes (#2185)
* feature (workers): required schema changes

Changes required for consolidation of worker name, description
and address fields

* fixup! feature (workers): required schema changes

* fixup! feature (workers): required schema changes

* fixup! feature (workers): required schema changes

* Fixing up address constraint.

* last_status_time = now() on insert only if the worker is type = 'kms'

* update last_status_time for pki and kms based on different columns being updated.

* tweaking the constraints on last_status_time and address.

Co-authored-by: Todd <github@quaddi.com>
2022-06-14 14:51:56 -07:00
Jeff Mitchell cca044d8cb Update nodeenrollment to v0.1.0 2022-06-14 13:19:50 -05:00
Jeff Mitchell 8fd663af47 Send more info on KMS connect (#2182) 2022-06-14 13:27:55 -04:00
Jim 9dde83aea7 feature (byow): classify status msg data (#2181)
Classifying the data allows it to appropriately included in
audit events
2022-06-14 12:09:02 -04:00
Jeff MitchellandJim 7c139d28b2 Have hclog payloads use json tags (#2171)
* Have hclog payloads use `json` tags

Previously a global setting for the `structs` lib was causing the `json`
tag to be used, but this could have side effects from other packages, or
could be affected by other packages' behavior. This behavior was removed
earlier but it means this format call no longer uses `json` tags; this
behavior reverts it.

It also normalizes using mapstructure in a few other places.

* Update some tests

* Fix incorrect op const

* Fix more tests

* refactor (events): tell filter to use json tags (fix related tests)

Explicitly tell the filter to use the "json" tags so we don't have to
re-tag everything with a mapstructure tag via bexpr.WithTagName("json")

Update docs

Co-authored-by: Jim <jlambert@hashicorp.com>
2022-06-13 19:02:11 -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
Todd 4b526538af Make server_id in job_run type text since it is nullable. (#2177) 2022-06-13 12:55:05 -07:00
Irena Rindos 15138b897e Merge pull request #2168 from hashicorp/irindos-upstreams-fixes
fix context for worker upstreams
2022-06-13 08:58:22 -04:00
irenarindos ee0ecc9991 fix context for worker upstreams 2022-06-13 08:44:50 -04:00
Jeff Mitchell 8a131ef4f7 Fix missing guardrail for worker kms auth population (#2172)
* Fix missing guardrail for worker kms auth population
2022-06-11 16:13:15 -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 2d274c3742 Fix merge brokenness 2022-06-10 19:20:16 -04: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
Johan Brandhorst-Satzkorn a2477420da chore: Clarify event file sink doc (#2162)
Updated examples to show the common use case of
specifying a directory path and file name for
a file sink. This should hopefully prevent users
from making the mistake of putting a full path
for the file_name field and seeing an error like:

[ERROR] unable to send event: operation="event.(Eventer).retrySend"
  warning=
  | 1 error occurred:
  | 	* mkdir : no such file or directory
  |
2022-06-10 13:30:05 -04: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
Irena Rindos adf019f216 Merge pull request #2146 from hashicorp/irindos-cluster-workerkeyid
feature(worker): add workerKeyId to status
2022-06-10 09:59:58 -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
Jeff Mitchell b84001c07d Add CLI for workers (#2164) 2022-06-10 09:05:43 -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
Timothy Messier 59a91555bf Merge pull request #2160 from hashicorp/llb-scale-testing
perf(session): Improve list response time

Notable changes include:

- Change to not include terminated sessions by default. Use the new
  `include_terminated=true` query parameter to return terminated
  sessions.
- Remove connections from list response. Connection information is still
  returned for a read of an individual session.
- Creates a periodic job that will delete terminated sessions.
2022-06-09 16:19:02 -04:00
Timothy Messier 9075ea1b61 chore(changelog): Add notes about these session changes 2022-06-09 20:11:28 +00:00
irenarindos 3aa7d11419 feat(worker): Map cluster ID in config to upstream address 2022-06-09 16:04:13 -04:00
Timothy Messier e156e88f3e chore: Update UI version to use new query param for sessions listing 2022-06-09 19:28:04 +00:00
Timothy Messier e79714e93f feat(session): Add include_termianted option to list endpoint 2022-06-09 19:28:04 +00: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 5b0abe2e27 feat(session): Add migration to delete terminated sessions
There is a new periodic job that will delete terminated sessions that
are older than one hour. However, since until now terminated sessions
were not deleted, the first time the job runs there could be a large
number of sessions that need deleted. This could have a negative impact
on a running cluster. To mitigate the operational risk, this adds a
migration to perform an initial delete while the cluster is offline.
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
Timothy Messier de2421cc25 feat(session): Add repository method to delete terminated sessions
This will delete sessions that have been in the termianted state for
longer than the given threshold.
2022-06-09 19:28:03 +00:00
Timothy Messier a4d0e3c7f8 refact(session): Rename files with job to use a prefix
This makes it so jobs will all be naturally grouped together in file
listing.
2022-06-09 19:28:03 +00:00
Jeff Mitchell 7c4f495c25 Add workers SDK API bits (#2159) 2022-06-09 14:30:33 -04:00
Johan Brandhorst-Satzkorn 8fdc07d5a5 test: Use tparse to simplify test failure analysis (#2149)
The tparse library adds a nice summary of the test output,
which should hopefully make it easier to find errors in the tests
2022-06-09 13:02:55 -04:00
Johan Brandhorst-Satzkorn e7273d65c2 Bump Go version to v1.18.3 (#2158)
* chore: Bump Go version

Go 1.18.3 has some security patches over 1.18.1.

See https://go.dev/doc/devel/release#go1.18.minor

* Fix formatting

This was missed in a recent PR
2022-06-09 11:43:39 -04:00
Jeff Mitchell d6362f9e5e Restrict anonymous user capabilities (#2156) 2022-06-09 11:30:01 -04:00