Commit Graph
308 Commits
Author SHA1 Message Date
Johan Brandhorst-SatzkornandDamian Debkowski ec0a3f964b Worker status refactor (#5417)
* oss: feat(proto): statistics rpc added to server coordination service

* oss: feat(session): add update statistics status service

* oss: feat(handlers): add Statistics method to worker service server

* oss: feat(worker): add statistics ticking

* oss: internal/proto: define the new RoutingInfo RPC

* oss: internal/server: repository changes for RoutingInfo RPC

* oss: internal/daemon: add RoutingInfo handler to worker service

The new RoutingInfo RPC is used to get information from the worker
that is used to make routing decisions on the controller. It also
handles the initial request from the worker.

* oss: feat(db): server_worker_session_info table

* oss: feat(proto): session info rpc for server coordination service

* oss: feat(server): worker session info request data type

* oss: feat(worker): session info ticker

* oss: feat(handler): server coordination handler for session info

* oss: feat(session): utilize session info request time for session cleanup

* oss: proto: fix some gotags comments

Some of these fields were missing comments, while others had
incorrectly formatted comments.

* oss: worker: send connection status to server

This is required for the correct tracking of orphaned connections

* oss: internal/daemon/worker: add function to wait for Statistics RPC

* oss: internal/daemon/worker: add routing info RPC

The new RoutingInfo RPC replaces part of the Status RPC,
namely the part which is used by the controller and worker
to perform decisions around the establishment of new sessions
and new worker connections.

* oss: internal/daemon/worker: remove unnecessary error check

* oss: internal/daemon/worker: lock access to config and upstreams

The new confLock protects access to the conf value and to the
addressReceivers slice.

* oss: worker: replace Status RPC with RoutingInfo

* oss: worker: deprecate the Status RPC and related types

The Status RPC and related messages have been replaced
by the RoutingInfo/SessionInfo/Statistics RPCs. The controller
will continue to support the Status RPC until two new minor
versions have been released.

* oss: internal/event: add default deny for new worker RPCs

* oss: internal/daemon/worker: allow RPC interval to be set

The new SessionInfo/RoutingInfo/Statistics RPCs run at
long intervals, which make some of our cluster tests take
a long time to complete. This allows their interval to be
configured in tests.

* oss: all: use TestWorkerRPCInterval in slow tests

This should speed up these tests significantly.

* oss: internal/tests/cluster: reset sys eventer in test

---------

Co-authored-by: Damian Debkowski <damian.debkowski@hashicorp.com>
2025-01-09 10:26:37 -08:00
Elim Tsiagbey 306c722750 feat: Add support for capturing URL actions in request info (#5044)
* feat: Add support for capturing URL actions in request info

- Pass request context to services to validate actions.
- Validate actions for auth methods during authentication. `/v1/auth-methods/{{AUTH_METHOD_ID}}:authenticate:callback` is currently only supported on `OIDC` auth methods. An error is thrown if `:callback` is not supported
2024-08-29 17:14:42 -04:00
Jim 28b465e4b8 refact: to use go-dbw CreateItems, DeleteItems (#4974)
* refact: to use go-dbw CreateItems, DeleteItems

Latest version of go-dbw updated the signature of
CreateItems(...) and DeleteItems(...) on a happy
note this latest version of go-dbw actually does
batch inserts and updates for this functions.

* all: regenerate protos with new protoc-gen-go version
2024-08-01 11:18:53 -04:00
Guy J Grigsby 3316ef5228 Update attributes description for AuthenticateRequest to match proto (#4937)
update attributes description for AuthenticateRequest to match proto and generate updated code.
2024-07-17 13:21:48 -06:00
Damian Debkowski 88c67e4eea feat(proto): define storage bucket state in worker status 2024-07-17 14:23:11 -04:00
Todd e0a7c9acdd Document the deprecation of include_terminated (#4602)
* Document the deprecation of include_terminated

* Update the changelog
2024-05-24 12:04:08 -07:00
Sepehr 1f48ba5d1a Telemetry: storage bucket proto (#4824)
* oss:feat(storage): add observation tag in proto for telemetry

* oss:feat(storage): add observation tag in proto service

* oss:feat(storage): generate proto files with changes

* oss:feat(storage): add storage bucket id to target proto
2024-05-24 10:34:15 -07:00
Uruemu S Aganbi 1aa8c2e1d7 Add observation tags for Session Recording Service (#4825)
* Add observation tags to session_recording.proto

* remove scope_info observation tags

* Remove quotes and add tag to storage_bucket_id

* Add tags for session recording service

* Update proto definitions

- Remove gotags on messages
- Remove quotes
2024-05-24 11:30:48 -04:00
Todd 0d67b86543 Add ListResolvableAliases to the user service (#4609)
* Add ListResolvableAliases to the user service

There are a few non common ways this method uses our ACL
and grant system. A user is able to list resolvable
aliases for another user if they are granted permission
to do so. That means we had to load the grants for
the user being listed for and not the requester when
determining if an alias is able to resolve to a destination
for which the requested user has permission.

Similarly, the grant hash used for the list pagination
is required to be that of the user being listed and not
the requester.
2024-04-17 08:26:46 -07:00
Johan Brandhorst-Satzkorn 31f4b73584 proto/api: improve auth method service API docs (#4616) 2024-04-09 14:14:30 -07:00
6b53766aa6 internal/proto: improvements to OpenAPIv2 spec (#4555)
* internal/gen: better API docs

Add various pieces of metadata that can be used by the API docs renderer.
Improve the service labels by specifying explicit tags.
Specify error responses. Specify version at generation time.

* internal/gen: add better errors

The default error entry is now used to cover all errors, as
adding a new error for every possible status code was a bit much.
This also properly includes the real error type now!

* Add various pieces of metadata that can be used by the API docs renderer. Improve the service labels by specifying explicit tags.

* make auth method API docs

* make API docs better

* make auth methods API docs nicer

* internal/gen: better attribute examples

Replace Output Only comments with a field behavior annotation in accounts.
Mark some fields as required.
Add elaborate description for attributes.

* Make API docs better

* Make API docs better

* Make API docs better

* internal/proto: regenerate files

* internal/proto: finish off account service

* Make API docs better

* internal/proto: add better API docs for aliases

* Tidy up service descriptions

* Added description for Boundary controller  API doc

* internal/gen: add better API intro

Copy parts of the API docs into the description

* sdk: add openapi dependency

* internal/gen: move global API doc to separate file

* internal/gen: remove required annotations

Unfortunately, while these help with the creating of resources, they still
appear required in contexts where they are not, such as when
updating a resource.

* Review comments

---------

Co-authored-by: jigar-hashicorp <jigar.shah@hashicorp.com>
Co-authored-by: Isaac Christian (he/him) <112639904+isaacchristian@users.noreply.github.com>
2024-04-08 13:55:17 -07:00
Elim Tsiagbey f483d1417c feat: Update Proto Definition for Local Storage State
Update `ServerWorkerStatus` Proto Definition to include Local Storage State
2024-04-05 16:45:35 -04:00
Michael Li 9eb608feeb chore: Update protobuf to 1.33 (#4485)
Release: https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.33.0
CVE: https://nvd.nist.gov/vuln/detail/CVE-2024-24786
2024-03-06 14:53:06 -05:00
Todd 305bb09c35 Treat alias values like other required fields in API and CLI (#4404)
* Treat Alias values like other required fields in API and CLI

* Fix protoc versions since we recently rebased on main which uses updated version
2024-02-29 15:52:27 -08:00
Todd 5a17c9cd39 Resolve aliases prior to subtype attribute transforming interceptor (#4379)
* Resolve aliases prior to subtype interceptor
2024-02-29 15:52:27 -08:00
Todd 92181e272a Create the alias service and resource (#4276)
* Create the alias service and resource

* Add alias generated API files and tests
2024-02-29 15:51:24 -08:00
Michael Milton 2e69d59dd2 feat(billing): Add cli subcommand for monthly active user counts 2024-02-23 15:44:10 +00:00
Michael Milton 280e9abb89 feat(billing): Add service handlers for monthly active user counts 2024-02-23 15:44:09 +00:00
Jim 3af259ff69 chore: update deps (#4394)
* chore: update deps

* tests: update sqlmock tests for breaking chg

* tests (handlers): sort grants in checkEqualGrants(...)

sort the expected and got grants in
checkEqualGrants(...) to make the test more
deterministic.

* tests (asciicast): update backspace enc in TestEventMarshal(...)
2024-02-13 10:50:06 -05:00
Johan Brandhorst-Satzkorn d9c6de4e8b deps: update runc dependency (#4349)
Fixes GHSA-xr7r-f8xq-vfvv
2024-02-01 13:19:24 -08:00
f5dd457b34 Multiple grant scope IDs (#4251)
Co-authored-by: Timothy Messier <tim.messier@gmail.com>
Co-authored-by: Todd <github@quaddi.com>
2024-01-23 14:33:09 -05:00
Damian Debkowski 2dda19aafe fix: reapply-storage-policy 2024-01-16 13:53:44 -08:00
Louis Ruch f26243e9af feat(recording): Delete Session Recording 2024-01-16 13:53:44 -08:00
Damian Debkowski b7739cd214 chore: generated files 2024-01-16 13:53:44 -08:00
Johan Brandhorst-Satzkorn 07be75b7be internal/handlers: add pagination to storage policies 2024-01-16 13:53:44 -08:00
Johan Brandhorst-Satzkorn b454b28912 internal/handlers: add policy list resource type 2024-01-16 13:53:44 -08:00
Damian Debkowski 50990d1b19 chore: generated files 2024-01-16 13:53:44 -08:00
Hugo 1c3b1b42f7 feat(proto): Create Policy SDK and API Service (#793) 2024-01-16 13:53:41 -08:00
Johan Brandhorst-Satzkorn 3daa55b913 internal/handlers: add scope list pagination 2024-01-05 07:43:21 -08:00
Michael Milton 52b1c1b4c7 Managed group list pagination (#4208)
* wip

* managed groups pagination

* address PR comments

* missed one change
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn b7e474d277 internal/handlers: add accounts pagination 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn f38c79a5ce internal/handlers: add host catalog pagination 2024-01-05 07:43:21 -08:00
Todd 40d9c3fd1d Paginate iam groups (#4194) 2024-01-05 07:43:21 -08:00
Michael MiltonandMichael Gaffney 8d50a0913f Auth Method list pagination (#4165)
* wip

* implement list pagination for auth methods

* remove unused code

* update tests to fix sorting

* address PR comments

* simplify query, add token tests

* change test name

* wip sql testing

* add boolean column to indicate whether auth methods should be returned to unauthenticated users, remove secrets from api response

* is_active_public not null

* remove secrets and unwrapping

* move not null to immediately after data migration

* order public_id descending

* fix(db): Fix auth method migrations (#4193)

* wip

* fix db tests

* fix failing api tests

* reverse order of create time and update time in test

---------

Co-authored-by: Michael Gaffney <mike@gaffney.cc>
2024-01-05 07:43:21 -08:00
Todd 0fad770d8a Paginate iam user (#4185)
* paginate iam user
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 050bcdfec9 handlers/host_sets: implement pagination for host sets
Adds protobuf types and handler logic to support pagination of host sets.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn f29d559d60 handlers/session_recordings: add pagination support 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 24130c4313 handlers/storage_buckets: add pagination fields 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 17b6ad5c5c handlers/hosts: implement pagination for hosts
Adds protobuf types and handler logic to support pagination of hosts.
2024-01-05 07:43:21 -08:00
Todd 5aa560387c Add pagination for iam Roles (#4161)
* Add pagination for iam Roles
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 0259f2f26b internal/handlers: add credential store pagination 2024-01-05 07:43:20 -08:00
Michael Milton 6ba3676c37 Auth token pagination (#4113)
* Add pagination support for auth tokens

* change analyze count estimate comment

* adjust queries for efficiency and security

* even more efficient queries
2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 6b03363eb8 internal/handlers: add credential library pagination 2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 9f6ac602ee internal/handlers: add credential pagination support 2024-01-05 07:43:20 -08:00
Michael Milton 9c3eb16046 Sessions list pagination (#4079)
* Session list pagination refactor

* address pr comments, add explanatory comments, clean up sql queries, move tests into proper files

* fix build error

* fix test error
2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn eca27b00c9 internal/proto: rename refresh token to list token 2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn e2fd8f9701 internal/proto: refactor list proto definitions
This aligns it more with the new domain use.
2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 5984f5bba6 handlers/targets: add pagination support 2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 84e5b9401d proto: add pagination Refresh Token
The ListRefreshToken type is used, in its marshalled form,
for pagination requests. A new refresh token is returned
which each invocation of a list method (unless
there was no input refresh token and there were no results).
2024-01-05 07:43:19 -08:00
Jeff Mitchell de4ce93931 Update main module deps (#3971) 2023-11-01 16:21:17 -04:00