Commit Graph
1779 Commits
Author SHA1 Message Date
Jim 6cc984e4e4 feat (errors): add WorkerFoundForRequest error code 2023-05-31 12:18:12 +00:00
Jim 6f78889947 refact: add servers.ListWorkers(...)
refactor servers.(repository).ListWorkers(...) into just
servers.ListWorkers(...) used independently of the repo.  The method
func is refactor to use the new bits as well.
2023-05-31 12:18:12 +00:00
irenarindos b43830e66e feat(bsr): add protocol to sessionMeta 2023-05-31 12:18:12 +00:00
Louis Ruch 798a1f952a feat(storage): Add support for storage plugins 2023-05-31 12:18:12 +00:00
Damian Debkowski 9ef94892f4 test(plugin): Support storage service in loopback plugin 2023-05-31 12:18:12 +00:00
Louis Ruch 351444f1bd refact(plugin): Move host loopback plugin into internal/plugin/loopback 2023-05-31 12:18:12 +00:00
Todd 4c801cca18 update the recording msg type enums 2023-05-31 12:18:12 +00:00
Todd e2a681a66a stop exporting registerUpstreamMessageTypeSpecifier 2023-05-31 12:18:11 +00:00
Todd dbe3473874 Add CreateChannel enum for upstream message handler 2023-05-31 12:18:11 +00:00
Jim 8cd0e8595f refact: split UpstreamMessageHandler into two interfaces
Originally, UpstreamMessageHandler was used by
controllerUpstreamMessageServiceServer.UpstreamMessage to process
(aka handle) an upstream message and by SendUpstreamMessage to
send an upstream msg.

We split UpstreamMessageHandler into two interfaces so we can
register handlers independently of a senders.
2023-05-31 12:18:11 +00:00
irenarindos 431b9d25a2 feat(bsr): use go 1.20 multierror 2023-05-31 12:18:11 +00:00
Jim 3995f2e6ae feat: add proper audit events for UpstreamMessage
The upstream messages all basically looked the same; regardless
of which message was sent.  This PR adds DetailsUpstreamMessage to
audit events emitted by UpstreamMessage requests/response
2023-05-31 12:18:11 +00:00
Jim 7161569955 feat (events): new test helpers: CloudEventFromFile, CloudEventFromBuf 2023-05-31 12:18:11 +00:00
Jim c4b31313a6 feat (controller): define a ControllerExtension 2023-05-31 12:18:11 +00:00
Todd 68dc4da50e Add CloseConnectionRecording enums to the upstream message service 2023-05-31 12:18:11 +00:00
irenarindos ba476ca73b feat(bsr/ssh): Add SSH Request type chunks 2023-05-31 12:18:11 +00:00
Timothy Messier 26bd86fb07 feat(bsr): Add chunk encoder 2023-05-31 12:18:11 +00:00
Timothy MessierandIrena Rindos 2a31ddd881 feat(bsr): Define container and the required fs interfaces
Co-authored-by: Irena Rindos <irenarindos@users.noreply.github.com>
2023-05-31 12:18:11 +00:00
Timothy Messier 897b70f090 feat(storage): Make Option fields exported
This makes it possible to have external packages implement the
storage.FS, storage.Container, and storage.File interfaces and correctly
inspect the various options.
2023-05-31 12:18:10 +00:00
Johan Brandhorst-Satzkorn 7632143861 add session recording API definitions 2023-05-31 12:18:10 +00:00
Johan Brandhorst-Satzkorn 7bb44b46f5 internal/db: add session recording tables
Add the following new tables used for storing session recordings:

* recording_session
* recording_connection
* recording_channel
* recording_channel_ssh
* storage_bucket
2023-05-31 12:18:10 +00:00
Jim f9b45ca5b7 refact: extend registerControllerUpstreamMessageService to reg hdrs
Extend registerControllerUpstreamMessageService to register upstream
message handlers
2023-05-31 12:18:10 +00:00
Jim 9f01e1b3c1 refact: RegisterUpstreamMessageHandler stop returning dup err
Stop returning an error if RegisterUpstreamMessageHandler is called
multiple times, since it provides little/no value and creates
invalid errors when more than one test controller is started across
all the unit tests.
2023-05-31 12:18:10 +00:00
Jim ff9b3b0873 fix(bsr/kms): VerifySignatureWithBsrKey: handle invalid signature 2023-05-31 12:18:10 +00:00
Jim 9543af8765 feature (bsr/kms): add VerifySignatureWithBsrKey(...) 2023-05-31 12:18:10 +00:00
Jim 410bec1e00 feature(worker/controller): register UpstreamMessageServiceServer 2023-05-31 12:18:10 +00:00
Jim 20cf521cc0 feat(bsr): add bsr kms support in config, dev and tests 2023-05-31 12:18:10 +00:00
Jim a8574621c7 refact(tests): upstream msg tests for node enrollment chg 2023-05-31 12:18:10 +00:00
Louis Ruch def8e47f32 feat(storage): Add pluginInfo to storageBucket 2023-05-31 12:18:10 +00:00
Damian Debkowski 87eb94e026 feat(proto): plugin support validate permissions 2023-05-31 12:18:09 +00:00
Damian Debkowski 39f3e391ae feat(proto): add headObject to storage plugin service 2023-05-31 12:18:09 +00:00
Louis Ruch 52fbc6410c feat(storage): Add interface, options and errors 2023-05-31 12:18:09 +00:00
Todd 1e3b02fbe7 Add error info and code test for a recently added error 2023-05-31 12:18:09 +00:00
Jim b9cc441227 feature (handlers): add UpstreamMessageService and its oss impl.
Define OSS protos for UpstreamMessageService rpc which defines a way
to send an upstream message to a controller (across multi-hops if
needed).

Implement OSS versions of both workers and controllers for the
UpstreamMessageService. The upstream requests/responses are encrypted
using the originating worker's NodeCredential's key.

The worker always forwards the request upstream.

The controller attends to find a registered UpstreamMessageHandler to
handle the msg; if none if found, then an Unimplemented status error
is returned.
2023-05-31 12:18:09 +00:00
Todd bd2bca987d Add the first iteration of the recorder cache and wire it in 2023-05-31 12:18:09 +00:00
Timothy Messier 397a697731 feat(bsr): Define stubs for meta structures
These are used to provide the metadata about a session or connection
when writing a BSR and will be written to the corresponding .meta files
within a BSR.
2023-05-31 12:18:09 +00:00
Timothy Messier d15d2e3bc0 feat(bsr): Define required interface needed by storage 2023-05-31 12:18:09 +00:00
Jim aa10d1dbfe feat(KMS): add BsrKeys type and req. receiver functions 2023-05-31 12:18:09 +00:00
Jim 98d3e59372 feat(KMS): add BSR external wrapper 2023-05-31 12:18:09 +00:00
Damian Debkowski 79eea06dd7 feat(proto): storage bucket plugin grpc definitions (#252) 2023-05-31 12:18:08 +00:00
Timothy Messier 658bb27eeb feat(bsr): Define initial interfaces and types 2023-05-31 12:18:08 +00:00
Michael Milton 9ae2bdfae6 feat: license util config (#3248)
* feat: license util config

* address comments

* introduce census job

* add job

* fix import groups

* remove pointers
2023-05-30 18:20:49 -04:00
Jeff Mitchell 7bdbe8ab8e Update changelog (#3250) 2023-05-30 16:16:31 -04:00
Jeff Mitchell c149bc4a79 Allow slashes in authorize-session when using target name (#3249)
This requires specifying `**` as the selector in the proto, which will
match any segments and simply requires that the verb is the last part of
the URL, which it already is.
2023-05-30 16:03:27 -04:00
Jim 4d08c52afd feat (authenticate/oidc): support outputting auth url (#3247) 2023-05-30 12:04:05 -04:00
Jeff Mitchell 769a7c9e1c Remove cleanup calls for test controller/worker (#3245)
A previous commit added a call to t.Cleanup in the
NewTestController/NewTestWorker commands; as a result these statements
are no longer needed.
2023-05-26 14:57:32 -04:00
Hugo dba7d88523 fix(handlers/scopes): Whitespace on Name and Description fields (#3235)
This commit fixes the behaviour of scopes where whitespace was allowed
(and thus persisted) in the Name and Description fields.

It also adds some more tests for scope Create and Updateto cover more
error cases.

For scope update, `handlers.ValidateUpdateRequest` exists, however this
was not used as it does not work properly for requests where the
`global` scope is updated.

In `ValidateUpdateRequest`, an ID check is performed and it assumes
there's always a resource prefix (eg: "p", "o") and an identifier
(random numbers and letters) after the prefix. This fails for `global`.
See `handlers.ValidId`.
2023-05-25 15:43:52 +01:00
Jeff Mitchell e8559d142a Fix worker auth rotation test (#3243)
Most of the changes here are changes or enhancements that are useful for
tests. The crux of the issue was that I had pulled up one var to the
package level so it could be read from tests, but that var was not being
reset between tests. It's not even used in tests anymore, so I put it
back to function-local.
2023-05-24 23:33:51 -04:00
ace2def49d Add daily sessions pending view and accompanying snapshot table (#3217)
* feat: add a new daily billing view

* update views and table based on early feedback

* address review comments

* update CTE to be an accurate result of what we expect

* remove 'with time zone' from daily range

* remove timezone

* Update internal/db/schema/migrations/oss/postgres/70/01_hcp_billing_daily.up.sql

Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Timothy Messier <tim.messier@gmail.com>

* go mod updates

* fix tests

---------

Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
Co-authored-by: Timothy Messier <tim.messier@gmail.com>
2023-05-24 15:52:34 -04:00
Jeff Mitchell d5ad1f078a Fix test timing (#3241) 2023-05-24 15:37:22 -04:00