Commit Graph
622 Commits
Author SHA1 Message Date
Timothy Messier dd23f6fdbf Update websocket library (#3908)
The nhooyr/websocket library now has a release with the new default
behavior that removes the message size limit. This allows us to switch
off of the fork and back to the upstream.

In the same release that includes the fix we need for the boundary
client, the wspb helper package was removed from websocket. This package
contained some functions to read and write protobuf messages. However,
it was using the deprecated github.com/golang/protobuf/proto library. To
avoid this dependancy in the library they opted to just remove wspb.

Thus this provides a replacement implementation that uses
google.golang.org/protobuf/proto. Notably the newer proto library seems
to lack an equivalent of proto.NewBuffer so writes to the websocket and
not able to leverage a sync.Pool of byte.Buffers to reduce allocations.

Refs: 88bb253554
See: https://github.com/nhooyr/websocket/commit/ac385120c6e34fa6584f3856d5db949a21bbb65e
2023-11-06 14:59:11 -05:00
Jeff Mitchell a9e372930d Revert 0bf60996c5 (#3990)
Post-merge some issues were discovered with the ways typing is used for
proto reflection. This will be reworked without moving the subtypes
around.
2023-11-02 16:03:47 -04:00
guangwu 8bb6632512 chore: remove refs to deprecated io/ioutil (#3811)
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-11-01 16:54:54 -04:00
Sorawis Nilparuk (Bo) 45eb3b7b51 support remote-dev format for cluster ID (#3637) 2023-11-01 16:41:27 -04:00
Jeff MitchellandJohan Brandhorst-Satzkorn 0bf60996c5 Add generic read/update/delete commands (#3967)
* Add generic read/update/delete commands

This adds three generic commands that use the resource prefix to
determine the subcommand to run and pass through args over to that
subcommand. Since this occurs very early on and to avoid loading
essentially every internal resource package, I moved subtype definitions
to globals.

* Update main.go

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>

* Update changelog and remove another deprecated command

---------

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2023-11-01 16:24:16 -04:00
Jeff Mitchell b000aa3068 Fix dev key generation (#3951)
In #2076 the refactor changed the position of a parenthesis, causing
the dev key to truncate the base64 representation instead of specifying
which bytes to base64 encode.

We don't need this slicing anymore anyways since we now do individual
key generation calls so just remove it.
2023-10-31 10:32:46 -04:00
dani c89777de41 Expose Valid Principals for Vault SSH Signed Certs (#3791)
* allow additional valid principals when creating vault ssh signed cert cred lib

* add additional_valid_principals field to credential libraries documentation page
2023-10-24 12:44:51 -04:00
Jeff MitchellandJohan Brandhorst-Satzkorn fb4a5a98dc Add some target fields and move some things around (#3879)
In preparation for putting proxy code in the api package this creates some necessary fields in the target output and it pre-moves credential parsing and proxy handshake code to their new places. This will make the diff for the actual proxy code move quite a bit smaller.

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2023-10-22 20:48:54 -04:00
Jeff Mitchell 20ac42c851 Add some useful dev flags (#3865) 2023-10-20 14:26:58 -04:00
Jeff Mitchell eb20b80c71 Migrate some credential bits around (#3864) 2023-10-18 17:48:44 -04:00
daniandDanielle Miu a7c1876d7b remove deprecated option application-credential-source (#3728)
Co-authored-by: Danielle Miu <29378233+DanielleMiu@users.noreply.github.com>
2023-09-22 15:58:18 -04:00
Sepehr e278964422 observability(events): Adding telemetry flag and and telemetry sink event type with tests 2023-09-22 11:31:42 -04:00
Jeff Mitchell b64eadedbf Fix flaky TestServer_ReloadInitialUpstreams (#3758)
With the KMS changes this should never have worked at all (because the
different databases means the credentials conveyed after the KMS-based
authentication would never be valid). However, it was sometimes passing
because of a race condition: the worker could be found in the database
before the new credentials were returned to the worker, causing the
worker to start at the KMS step with the second controller.

This changes the test to use the same database for two controllers, but
to only ever have one running at a time, and uses a sequence of two
changed (or unchanged, depending) status updates from the worker to
ensure that the reload was successful.
2023-09-21 14:25:53 -04:00
Jim 0d19892e03 fix (events): convert multierror to stdlib error (#3743)
* fix (events): convert multierror to stdlib error

multierror errors will be converted to a stdlib error (because
multierror doesn't support json marshaling).

* refact (errors): convert from multierror to stdlib errors.Join(...)

* refact: convert from pkg/errors to stdlib error wrapping
2023-09-17 19:35:43 -04:00
Irena Rindos 7bd2d2c913 feat(worker): allow hcp cluster id to be sourced from env var (#3709)
* feat(worker): allow hcp cluster id to be sourced from env var
2023-09-12 13:20:49 -04:00
Irena Rindos 9733a250fa refact(event): move observability/event to event (#3704) 2023-09-12 08:15:34 -04:00
Jim 8ee4f6ead0 feat (auth/ldap): add support for new fields to CLI (#3685)
Added support for new flags for: max-page-size and deref-aliases
2023-09-07 19:23:20 -04:00
Elim Tsiagbey d271025863 fix: Flakey upstream connection test (#3689)
The connectivity state changes for `upstream_connection_state` health field is causing the test to be flakey. Commenting out the field during assertions. `upstream_connection_state` health field is tested in other tests
2023-09-07 15:48:53 -04:00
Johan Brandhorst-Satzkorn f89515a19c all: avoid mutating global state in parallel tests (#3687)
The SetupSuiteTargetFilters globally mutates the function used for logic
inside the target handler service. This means that we could get
inconsistent logical behavior in certain tests that were run in parallel,
since the logic can change at runtime. Ensure tests that make use
of this function are never run in parallel with other tests.
2023-09-07 11:52:00 -07:00
Elim Tsiagbey fabd4093de feat: Worker Connectivity Health Check (#3650)
* feat: Worker Connectivity Health Check

Add worker upstream connection state. API calls to the worker's ops `/heath?worker_info=1` endpoint should now return a new filed called `upstream_connection_state`

```
{
   "worker_process_info":{
      "state":"active",
      "active_session_count":0,
      "upstream_connection_state":"READY"
   }
}
```

The states returned will be GRPC connection states: https://grpc.github.io/grpc/core/md_doc_connectivity-semantics-and-api.html

There could be multiple upstream addresses but GRPC manual resolver determines the state of the connection.
2023-09-01 13:42:41 -04:00
Louis Ruch 2235a50a2a feat(ssh): Add support for ssh to run command on remote host (#3633) 2023-08-29 08:45:10 -07:00
Irena Rindos df1e64f412 chore(connect): improve messaging if tofu token already used (#3602) 2023-08-17 08:59:17 -04:00
hashicorp-copywrite[bot]andJohan Brandhorst-Satzkorn 29da0bcb92 [COMPLIANCE] License changes (#3567)
* Adding explicit MPL license for sub-package.

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Adding explicit MPL license for sub-package

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Updating the license from MPL to Business Source License

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl.

* Update copyright file headers to BUS-1.1

* Rerun make gen

This will pick up the last of the license changes

* Revert "Rerun make gen"

This reverts commit dbe0968bffd92745d8663c6940debae098395a6b.

* Remove copywrite from generation script

The current version of copywrite is not sophisticated enough
to only apply the copywrite changes to certain subdirectories,
so to avoid accidentally relicensing our api and sdk modules,
we will stop running the copywrite script until such time
that it can do the right thing.

* License protobuf API as MPL

The protobuf API files are used to generate the SDK,
since we want the SDK to be MPL, the protobuf files
must also be MPL. This extends to all protobuf files
whose sources end up in the SDK directory, including:

- internal/proto/controller/api
- internal/proto/controller/custom_options
- internal/proto/plugin

It also includes the generated service directory in
internal/gen/controller/api/services, since they are
generated from the protobuf sources used for the SDK.

* Change website license file name

This makes the naming scheme consistent with the rest
of the repository.

* Add note on licensing to README

* Set copywrite license to BUSL

* Revert "Add note on licensing to README"

This reverts commit 4d865a91a7a4f11605f0dc4609355d7e3c3cfffe.

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2023-08-11 10:31:53 -07:00
Todd 8d9222bec3 Add credential and libraries to session recording resource (#3374) 2023-06-28 09:55:29 -07:00
Johan Brandhorst-Satzkorn 2ae007d61e cmd: fix session recording download flag help (#3351)
When using an alias, we automatically add a little
blurb to the end of the flag help. When not terminating
the flag help with a full stop, this looks a bit odd. Add
full stops to all the download flags for consistency.
2023-06-22 07:31:21 -07:00
Johan Brandhorst-Satzkorn 9474b373b8 api: remove create from auth-tokens help (#3341)
The auth-tokens help command included a reference to
a non-existent auth-tokens create command. Replace the
default help and also add a helpful pointer to the authenticate
command.
2023-06-20 13:17:43 -07:00
Jim 723dbdfedf fix (boundary dev): make the LDAP auth method active-public (#3344) 2023-06-20 13:56:20 -04:00
Jeff Mitchell 3a9903a836 Don't attempt session teardown if the session is expired (#3312)
This avoids a situation where teardown results in an error due to the
worker not accepting the connection (since the credentials are invalid).
Teardown is a best-effort way to avoid sessions that have long lifetimes
ending up having to wait for expiration before cleanup, but if we're
near expiration it doesn't really matter.

Fixes ICU-9633
2023-06-14 21:55:24 -04:00
Jeff Mitchell 8322916fb4 Remove all deprecated Err/Wrap/E calls (#3286) 2023-06-14 21:55:24 -04:00
Jeff Mitchell feb3aea38f Support multiple IDs in grants (#3263)
This allows specifying multiple IDs in grants via an `ids` field, which
will eventually become the normal way to specify IDs. Internally, each
grant with multiple IDs turns into multiple ACL grants each with a
single ID; to make this distinction clearer and allow for better
separation of concerns an AclGrant type has been introduced, so really
multiple IDs in a Grant turn into multiple AclGrants.

The nice thing about doing it this way is that it becomes purely a
parsing concern; no actual validation logic has changed.

For backwards compatibility with grants already stored in roles, we do
not error out if `id` is specified. However, eventually we will simply
not support grants with `id` coming via the API; they will fail API
validation, such that new grants will require the use of the updated
`ids` field.

A follow-on PR will plumb this through the service handlers/API/CLI, but
I decided to do it in separate chunks to make reviewing easier, given
that they are easily separable into the internal and external aspects of
the change.

* Add CLI/API checks around using ID in grants (#3264)

* Plumb through some contexts to remove a lot of deprecated errors (#3268)
2023-06-14 21:55:24 -04:00
Todd 8980143278 Allow kms purpose "downstream-worker-auth" (#3299) 2023-06-08 15:41:49 -07:00
Johan Brandhorst-Satzkorn ebcd6d2828 api: remove connection ID (#3298)
Removing this until we figure out why it's sometimes missing.
May add it back again later.
2023-06-08 09:15:12 -07:00
Jeff Mitchell 1b0330ad8e Update dev worker auth flag names (#3265)
This brings it in line with the updated names that have been settled on
in light of deprecating the old KMS method.
2023-06-02 12:47:59 -04:00
Louis Ruch 281f217dcc feat(plugins): Refactor host plugins to boundary plugins (#3262) 2023-06-02 08:04:50 -07:00
Jim d4e537c88d chore: updgrade pgx direct deps to v5 (#3258) 2023-06-01 08:59:38 -04:00
Timothy Messier c2da88d2a5 test(cmd/config): Fix test compilation error
Refs: 9ae2bdfae
2023-05-31 12:47:20 +00:00
irenarindos 8c96d3ef9b fix(cmd): add session recording resource prefixes 2023-05-31 12:18:24 +00:00
Johan Brandhorst-Satzkorn 59f78ac1f8 config: allow wasm execution under UI CSP
The wasm-unsafe-eval option is necessary for the asciinema
player on the Admin UI
2023-05-31 12:18:24 +00:00
Todd 2359d5b7a5 remove filter flags and options for session recordings 2023-05-31 12:18:23 +00:00
Todd d1a5f3a2ff Update attribute fields to be proto struct so generated api becomes map[string]any 2023-05-31 12:18:22 +00:00
irenarindos 4785f2388f chore(session recording): update cmd typo 2023-05-31 12:18:22 +00:00
Louis Ruch 95398d3b65 fix(dev): Fix panic in controller-only dev mode
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb8 pc=0x16626b0]

goroutine 1 [running]:
github.com/hashicorp/boundary/internal/cmd/commands/dev.(*Command).Run(0xc000b90000, {0xc00003e110, 0x1, 0x1})
        github.com/hashicorp/boundary/internal/cmd/commands/dev/dev.go:484 +0x490
github.com/mitchellh/cli.(*CLI).Run(0xc0003323c0)
        github.com/mitchellh/cli@v1.1.5/cli.go:262 +0x5f8
github.com/hashicorp/boundary/internal/cmd.RunCustom({0xc00003e100?, 0x60?, 0x0?}, 0x0?)
        github.com/hashicorp/boundary/internal/cmd/main.go:189 +0xa16
github.com/hashicorp/boundary/internal/cmd.Run(...)
        github.com/hashicorp/boundary/internal/cmd/main.go:95
main.main()
        github.com/hashicorp/boundary/cmd/boundary/main.go:16 +0xc7
2023-05-31 12:18:22 +00:00
Jim 468c58836b feat(recordings/cli): more read detail info 2023-05-31 12:18:22 +00:00
Jim d49fde2299 feat(cli/session-recordings): add download cmd 2023-05-31 12:18:22 +00:00
Johan Brandhorst-Satzkorn 98e0b9db98 commands: add created, updated to recordings 2023-05-31 12:18:22 +00:00
Louis Ruch 7207353066 docs(ssh): Update docs to reflect ssh default port is not required 2023-05-31 12:18:21 +00:00
Louis Ruch 78ca8beb77 fix(cli): Update storage CLI gen and help text 2023-05-31 12:18:19 +00:00
Johan Brandhorst-Satzkorn 15524f3408 api: add created, updated times to recordings 2023-05-31 12:18:19 +00:00
Jim 35a2296092 feat(cli): add session recordings: read and list cmds 2023-05-31 12:18:19 +00:00
Johan Brandhorst-Satzkorn 281989e595 regenerate API files 2023-05-31 12:18:17 +00:00