Commit Graph
2074 Commits
Author SHA1 Message Date
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 de4ce93931 Update main module deps (#3971) 2023-11-01 16:21:17 -04:00
Michael Gaffney 90276b5e91 tests: Set a default job run interval based on the test deadline
The Vault Credential Store only accepts Vault tokens that have a TTL
greater than the internal job scheduler's run frequency. This prevents a
Vault Credential Store from being created with a Vault token that will
expire before Boundary can renew it.

The Vault test server, by default, creates Vault tokens with a TTL equal
to the duration of time remaining until `t.Deadline()` is reached.

This change sets the test controller's default job scheduler duration to
be half of time remaining until `t.Deadline()`. The default job
scheduler duration can still be overridden by setting a duration on
`TestConrollerOpts.SchedulerRunJobInterval`.

This change fixes the error received when running:

    go test -timeout 30s \
      -tags devlicense \
      -run '^TestList$' \
      github.com/hashicorp/boundary/internal/tests/api/credentialstores

Which returned this error:

    {"kind":"Internal",
    "message":"credentialstores.(Service).createInRepo: unable to create
    credential store: vault.(Repository).CreateCredentialStore: unknown,
    unknown: error #0: scheduler interval must be greater than token
    ttl. scheduler jobs interval value: 1m0s"}
2023-10-31 15:00:36 -04:00
Sepehr 4dce290aeb telemetry(observations): fix the details flag check (#3960)
* telemetry(observations): fix the details flag check

* telemetry(observations): fix the test names
2023-10-31 09:53:49 -07: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
Jim 75cef86a34 feat (authmethod/password): add additional telmemetry for passwd acct authen (#3958) 2023-10-30 18:23:23 -04:00
Johan Brandhorst-Satzkorn 6081b6c58d internal/credential: simplify TestObject test helper (#3899)
The TestObject test helper previously returned an error,
but it's easier to have it perform the error check itself,
as it conventionally done with test helpers.
2023-10-30 11:03:04 -07:00
Sepehr f9dee55e4d Telemetry(observations): add oidc and ldap observation events (#3945)
* telemetry(observations): Add observations for oidc and ldap authentications

* telemetry(observations): Add tests ldap and oidc observation events
2023-10-30 08:54:00 -07:00
Johan Brandhorst-Satzkorn 940eb61282 sqltest: fix typo (#3886) 2023-10-26 11:18:41 -07:00
Johan Brandhorst-Satzkorn 894927ffd2 internal/host: fix inconsistent receiver (#3894)
This is a lint error but wasn't caught because it was a
historic problem. It's appearing again now because we're
adding another method to this type as part of the
pagination workflow.
2023-10-26 11:16:59 -07:00
Jim 83e0e9b3f7 fix (auth/ldap): fix encoding of mTLS client key (#3929)
We need to encode the key as a PEM before initializing cap's
ldap client
2023-10-26 11:42:07 -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
Elim Tsiagbey 5741807b4a fix: monitorUpstreamConnectionState CPU consumption (#3884)
* fix: monitorUpstreamConnectionState CPU consumption

`monitorUpstreamConnectionState()` is a goroutine that listens for GRPC client connection changes using GRPC's `WaitForStateChange` method. `monitorUpstreamConnectionState()` was consuming the a lot of CPU. It was continuously running and not actually waiting for state changes. The `state` for `monitorUpstreamConnectionState()` was not getting correctly updated which caused the loop to continuously run instead of waiting for new state changes.

Update GRPC `WaitForStateChange` method to use the same `state` that gets updated.
2023-10-23 19:35:12 -04:00
Jim 1c330543a7 fix (oplog keys): fix issue with migration of oplog keys to new tables (#3868)
We inadvertently used
kms.GetWrapper(ctx, am.ScopeId, kms.KeyPurposeDatabase)
which resulted in the use of a database key for an oplog entry.
See:
https://github.com/hashicorp/boundary/pull/3665/files#diff-bcf83b5283886c98fc45b6435fdc94d87d545b2768c6beac8acd14eb9d6b13f1

This fixes the issue with the missing "Database" purpose key when
we converted the oplog keys into their own tables.

We chosen to truncate the existing oplog entries to eliminate any
references to a Database kms key in existing oplog entries.
2023-10-23 18:42:23 -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
Michael Li e089aa219d test(bats): Add list tests for other resource types (#3869) 2023-10-20 12:09:32 -04:00
Jeff Mitchell eb20b80c71 Migrate some credential bits around (#3864) 2023-10-18 17:48:44 -04:00
Michael Li 7f596bafa9 test(bats): Fix grant due to deprecation (#3853) 2023-10-17 13:42:11 -04:00
Jim 1ed0a13004 refact (kms): convert to the new stdlib slices pkg (#3836) 2023-10-11 20:45:50 -04:00
Devon Anderson 2180ad4241 Bump UI commit (#3804) 2023-10-06 08:12:14 -05:00
Jeff Mitchell 602bbcc43e Fix intermittent startup issues on slow systems (#3803)
With a suitably slow system -- say, if you're waiting on a Windows
Terminal to output text inside a virtual machine -- the expected order
of things can be thrown off. One specific way this can happen is that
the worker can attempt to dial and have its dial fail because of the
slowness causing the dial context to time out. If, because of the
slowness, we also haven't released the log gate yet, then the event with
the failure information will be queued, along with the context that was
used.

Unfortunately, in some of these error cases, the context that was used
was the dial context instead of the system base context. In many other
places in the function it was the system base context so this is just a
mismatch, probably from code written at different times.

Normally this wouldn't be a problem as we'd fall back to the underlying
logger, but when we release the log gate, things happen differently:
it's a synchronous function and on error it causes us to abandon
system startup entirely.

This commit fixes the issue with using the incorrect context. It's an
open question whether we should change the behavior around errors when
replaying queued events, falling back to the underlying logger instead
of erroring.
2023-10-05 20:34:57 -04:00
Devon Anderson 642ddc53c7 Bump UI commit (#3790) 2023-10-02 17:20:16 -05:00
Devon Anderson d2265a2ff3 Bump UI commit (#3787) 2023-10-02 09:36:43 -05:00
Devon Anderson 12b6f5faef Bump UI commitsh and update changelog (#3784) 2023-09-28 15:09:54 -04:00
Devon Anderson 75a103fc47 Bump UI commit (#3783) 2023-09-28 08:47:56 -04:00
Devon Anderson 790013a0cd Bump UI Commit (#3778) 2023-09-26 11:58:29 -04:00
Michael Li dc912e2a86 test: Update tests to account for deprecated features in 0.14.0 (#3776)
* chore: Fix comment typo

* test(e2e): Update to use new credential library type

* test(e2e): Update to use new field name

* test(bats): Remove tests that use deprecated subcommand

* chore: Update to 0.14.0

* test(credentiallibraries): Update to use new credential library type

* doc: Add deprecation notices for 0.14.0

* fixup! doc: Add deprecation notices for 0.14.0
2023-09-26 10:33:53 -04:00
Devon Anderson 32a036556b Bump UI Commit (#3774) 2023-09-25 12:21:01 -04:00
Jim 4ed675be16 feat (db): add Writer.IsTx(...) (#3770) 2023-09-25 04:35:40 -04:00
April Ayres f13a23eab7 fix (telemetry): ignore fields without public class 2023-09-22 14:15:23 -07:00
daniandDanielle Miu 9413837b6a pass storage an empty context so it can close cleanly (#3653)
Co-authored-by: Danielle Miu <29378233+DanielleMiu@users.noreply.github.com>
2023-09-22 16:00:10 -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 14b3237a69 fix (telemetry): filtering events: fix default deny filter behavior 2023-09-22 11:31:42 -04:00
Sepehr 167161448b Add write observation interceptors, add validation check, fix default deny filter 2023-09-22 11:31:42 -04:00
April Ayres 0216c51ffc (telemetry_filter): handle map / slice traversals of proto structs 2023-09-22 11:31:42 -04:00
April Ayres ee7c17d2dc (event_observation): use consts for request/response, code cleanup 2023-09-22 11:31:42 -04:00
April Ayres c7cd6eabf3 (telemetry_filter): handle core proto types atomically 2023-09-22 11:31:42 -04:00
Sepehr 41c1e79cad observation(event): add workers list test 2023-09-22 11:31:42 -04:00
April Ayres 49a1563f6a observation(event): refine telemetry filter, and WithTelemetry() 2023-09-22 11:31:42 -04:00
Sepehr fcb29ed919 observation(event): add req/resp to observations and recursively scan observation tags 2023-09-22 11:31:42 -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
Sepehr 16d86d601a Add additional observation tags, remove from version and authorized_action 2023-09-22 11:31:42 -04:00
April Ayres 23c969ed39 Add observability tags to plugin protobuf. 2023-09-22 11:31:42 -04:00
Sepehr 14af8e8cd7 observation tags proto messages 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
Irena Rindos 8a0b8d84d8 feat(event): remove node on pipeline failure (#3736) 2023-09-20 10:19:26 -04:00
Johan Brandhorst-Satzkorn 2e0587bff0 credential: fix lint errors (#3746)
The existing pattern was subject to a bug whereby a lock
value was copied every time the value was passed around.
This was happening because of the use of an embedded
protobuf type. To avoid copying a mutex, use a pointer
type in the embedding.

Also fixes a few linter warnings complaining about the use
of unkeyed literals.
2023-09-19 09:17:42 -07:00