Commit Graph
121 Commits
Author SHA1 Message Date
9169c6bacb [QTI-220] Add infrastructure integration testing (#2282)
* [QTI-275] Add infrastructure integration testing

On pull requests that originate from branches of the `hashicorp/boundary`
repo, we now conditionally dispatch infrastructure integration tests using
the Enos framework. The `integration` Enos scenario includes two `builder`
variants which allow developers or CI to deploy a Boundary cluster in AWS
using either a local `boundary` install bundle or that which is produced
in the `build` workflow for CRT. The `test` variants determine which type
of infrastructure integration test to run. At present those options are
`cli_ui` (Bats CLI tests) or `smoke` (creates target instances and a
target host catalog and verifies that `boundary` works).

In addition to the new workflow and quality scenarios, we simplified the
some `build` workflow steps and added Go module caching to speed up the
build pipeline.

See the [enos/README.md](https://github.com/hashicorp/boundary/blob/main/enos/README.md)
for a detailed explanation on how to configure and execute Enos scenarios
from your machine.

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Rebecca Willett <rwillett@hashicorp.com>
Co-authored-by: Josh Branch <jbrand@hashicorp.com>
2022-07-28 14:48:51 -06:00
Todd 1aad2627c8 OSS side of second downstream connections (see enterprise PR 69) (#2292) 2022-07-25 12:52:21 -07:00
Damian Debkowski c2bfcc0664 refactor(api module): enforce typed definitions (#2238) 2022-07-21 15:21:31 -07:00
Louis RuchandJeff Mitchell a17e973712 feat(credentials): Refactor credential purposes (#2260)
* feat(credentials): Refactor credential purposes

 * Application credentials have been refactored to Brokered credentials
 * Egress credentials have been refactored to Injected Application
credentials

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2022-07-19 15:16:24 -07:00
Jeff MitchellandLouis Ruch 011e2e7425 Add ssh private key type and add type to static store (#2262)
Co-authored-by: Louis Ruch <louisruch@gmail.com>
2022-07-18 19:16:11 -04:00
Jeff Mitchell 8c56a5648d Migrate plugin host/set/catalog prefixes to typed (#2256)
* Migrate plugin host/set/catalog prefixes to typed

* Add credential store typing too
2022-07-15 13:09:55 -04:00
Todd 19b549c44a Rename package servers to server (#2222) 2022-06-20 18:20:17 -07:00
Jeff Mitchell 704d68848c Merge remote-tracking branch 'origin/main' into llb-byow 2022-06-15 16:45:00 -05:00
Louis Ruch 68eb6e2bed chore(targets): remove deprecated credential libraries on target resources (#1533) 2022-06-15 08:56:24 -07:00
Louis Ruch 00dfea1244 feat(target): Add support for static credential as target credential sources 2022-06-14 13:01:17 -07:00
Louis Ruch 58d546cdd4 feat(credential): Add static credential store and username_password credential 2022-06-14 13:01:17 -07:00
Damian DebkowskiandJohan Brandhorst-Satzkorn 3441fa0447 (fix) added more context to error details for cli command (#2170)
* (test) added more context to error details for cli commands

* (fix) refactor solution to utilize custom error type casting

* (test) added api unit test to validate InvalidArgumentError return message

* Update internal/types/subtypes/error.go

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

* (refactor) rename InvalidArgumentError into UnknownSubtypeIDError

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2022-06-14 08:52:53 -07: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 06a2f4ce9c Require default ports to be defined for newly created tcp targets. (#2148) 2022-06-13 08:26:24 -07:00
HaotianandTodd 1830605a7e refact(servers) Update api for new worker and controller server tables (#2101)
* Discontinue support for old Server message in ServerCoordinationService. Split message into ServerWorkerStatus and UpstreamServer (which currently contains controller addresses). Remove unnecessary fields. Modify workerStatusServer to use new fields.

Co-authored-by: Todd <github@quaddi.com>
2022-06-03 11:59:02 -07:00
Jim 70c5da1048 feature (workers): add repository CreateWorker(...) (#2105) 2022-05-26 13:32:21 -04:00
Timothy Messier c2d632f1a2 test(targets): Prevent panic due to non-deterministic order (#2086)
This test was using the third element in the result from a list request
to craft the input for the next assertion. However, one of the test
targets that is created does not have a default port set. Since the
target list call is not ordered, sometimes this element could be the
third element and a panic would result when default port interface was
converted to a float64.

This fixes the panic like:

    --- FAIL: TestList (1.31s)
    panic: interface conversion: interface {} is nil, not float64 [recovered]
            panic: interface conversion: interface {} is nil, not float64

    goroutine 1694 [running]:
    testing.tRunner.func1.2({0x14b2320, 0xc002f486f0})
        /prefix/usr/lib/go/src/testing/testing.go:1389 +0x24e
    testing.tRunner.func1()
        /prefix/usr/lib/go/src/testing/testing.go:1392 +0x39f
    panic({0x14b2320, 0xc002f486f0})
        /prefix/usr/lib/go/src/runtime/panic.go:838 +0x207
    github.com/hashicorp/boundary/internal/tests/api/targets_test.TestList(0xc000f81380)
        /go/src/github.com/hashicorp/boundary/internal/tests/api/targets/target_test.go:193 +0x174b
    testing.tRunner(0xc000f81380, 0x2b933a8)
        /prefix/usr/lib/go/src/testing/testing.go:1439 +0x102
    created by testing.(*T).Run
        /prefix/usr/lib/go/src/testing/testing.go:1486 +0x35f
    FAIL    github.com/hashicorp/boundary/internal/tests/api/targets    5.742s
    FAIL

Refs: #2003
2022-05-18 09:45:31 -04:00
Todd 472d7d520a Remove the server_id from session table, change it to worker_id on session_connection (#2070)
* Remove the server_id from session table, change it to worker_id on session_connection

This is step 1 in updating the worker table.  The worker is becoming a public resource so it must have
a public id.  We drop the server_id column on the session_connection table and add the worker_id column
so we can use the wt_public_key type.  Since db migrations are applied while the controller is offline,
it should be safe to assume all session connections are not in a running state, thus allowing us to null
out all the worker ids in the session_connection table.

For now we don't have very good enforcement of the wt_public_id constraints, since the id is currently
defined in the worker config, but this will soon change and the worker's id will be generated by the
controller.
2022-05-16 15:14:12 -07:00
Todd b58dada40d Move the server daemons into their own package (#2061)
* Move the server daemons into their own package

With this change the internal/server package now is dedicated to the server domain (workers and controllers) and not to the server daemons.
The hope is that this will make it easier to keep the daemons decoupled from the representation of the servers in the database.
2022-05-09 12:45:10 -07:00
Johan Brandhorst-Satzkorn 7f9b294a7e refact(all): Use testing.TB for test helpers
Our test helper packages were not possible to use
with benchmarks. This refactor switches to testing.TB
to allow both tests and benchmarks to use the helpers.
2022-04-29 16:33:44 -04:00
Todd a1cf3234ed url.PathEscape resource ids in the sdk before sending building a request. (#2035) 2022-04-27 08:13:46 -07:00
Timothy Messier 3be5c44907 feat(target): Classify resources for audit events 2022-04-20 13:32:32 -04:00
Timothy Messier c8be4a9890 refact(target): Switch subtype attributes to oneof
This updates the target resources to use a oneof for attributes. This
allows requests to the targets service to leverage the new
subtypes.AttributeTransformerInterceptor so that attributes are strongly
typed prior to the service handler.
2022-04-20 13:32:32 -04:00
Johan Brandhorst-Satzkorn 8c452b0991 feat(authmethods): Add classification to all fields 2022-04-20 13:32:32 -04:00
Timothy Messier 2ade7f34a8 feat(users): Classify resources for audit events 2022-04-20 13:32:32 -04:00
Timothy Messier 006fa3a85a feat(session): Classify resources for audit events 2022-04-20 13:32:32 -04:00
Timothy Messier 38a3960047 feat(role): Classify resources for audit events 2022-04-20 13:32:32 -04:00
Timothy Messier 4599e64cab feat(event): Remove BOUNDARY_DEVELOPER_ENABLE_EVENTS env var 2022-04-20 13:32:32 -04:00
Timothy Messier 1af803780c feat(controller): Reorder interceptor stack
The new `subtype.AttributeTransformerInterceptor` can return an error if
it fails to transform the attributes. This is mainly if invalid
attribute fields were included for a particular subtype. This error case
used to be checked in the grpc service handler functions. However, now
that it is happening in the interceptor, the `errorInterceptor` needs to
be moved up in the stack so that it will process the response of the new
transformation interceptor.

The `errorInterceptor` used to be after the `auditRequestInterceptor`
and prior to the `auditResponseInterceptor`, meaning that the
`auditResponseInterceptor` would have access to the result of the
`errorInterceptor`. But it seems the `auditRequestInterceptor` does not
use or need any of the headers set by the `errorInterceptor` so it
should be safe to move the `errorInterceptor`. This is important since
the `subtype.AttributeTransformerInterceptor` needs to be before the
audit interceptors in the stack to properly transform requests/responses
so they can be audited with the complete classification information.
2022-04-20 13:32:32 -04:00
Timothy Messier 6ad9aba505 feat(credentialstore): Classify resources for audit events 2022-04-20 13:32:32 -04:00
Timothy Messier 00e57b20a2 feat(credentiallibrary): Classify resources for audit events 2022-04-20 13:32:32 -04:00
Timothy Messier 95315a3e0a feat(groups): Classify resources for audit events 2022-04-20 13:32:32 -04:00
Timothy Messier e2eca03d26 feat(managedgroups): Classify resources for audit events 2022-04-20 13:32:31 -04:00
Timothy Messier 9643f7af76 test(managedgroups): Add api tests for managed-groups endpoints 2022-04-20 13:32:31 -04:00
Johan Brandhorst-Satzkorn fc6cddfc7f feat(authtokens): Add classification to all fields (#1996) 2022-04-20 13:32:31 -04:00
Johan Brandhorst-Satzkorn d51ce41db8 feat(hostsets): Classify all proto fields 2022-04-20 13:32:31 -04:00
Johan Brandhorst-Satzkorn 8fa3e8dee0 feat(hostcatalogs): Classify all proto fields 2022-04-20 13:32:31 -04:00
Johan Brandhorst-Satzkorn 5440195cce feat(hosts): Classify host proto fields 2022-04-20 13:32:31 -04:00
Johan Brandhorst-Satzkorn a2bff4efdf feat(authmethods): Add typed attributes to authenticate request and response
The AuthenticateRequest and AuthenticateResponse types have a
complex mapping rule system, which requires a pair of custom
callback functions.
2022-04-20 13:32:31 -04:00
Johan Brandhorst-Satzkorn 53481146fd feat(authmethods): add well typed attribute options (#1972)
Add well typed attribute options to the authmethods proto
definitions, while hiding them from being rendered in
the openapiv2 spec.
2022-04-20 13:32:31 -04:00
Timothy Messier 0fc5cd5a33 test(account): Use require to prevent panic on test failure
If these assertions failed, then next assersions would result in a panic
when accessing the slice.
2022-04-20 13:32:31 -04:00
Jeff Mitchell bf9e7874b1 Use custom X.509 verification logic for proxy connections (#2008)
This reduces the chance that we'll hit a failure due to a mismatched
worker address, on the certificate, especially if a worker has multiple
addresses. We aren't relying on IP/DNS for security anyways, so let's
not have it be a hindrance.
2022-04-16 12:09:22 -04:00
Jim 4636efce8f refactor (tests): GetEventDetails(...) will stop returning nil (#2019) 2022-04-15 12:20:44 -04:00
Hugo Vieira aae944be37 test(worker): Remove test-only hooks from actual code
This change introduces a `nonceFn` field that can be changed
by a test but at runtime is transparent to the code that calls it.

The current nonce-generating logic defaults to a test-only field which
opens us up to this value inadvertently being set.
With this change, the default behavior becomes using `base62` to
generate a random nonce, and any tests have to explicitly change that.
2022-03-29 16:46:02 +01:00
Hugo Vieira 61e310998f refactor(worker): Decouple listeners/servers shutdown
This change is the Worker-side counterpart to the change in
eebdfb88dc.
2022-03-29 16:46:02 +01:00
Hugo Vieira eebdfb88dc refact(controller): Decouple listeners/servers shutdown from Worker
In general, these changes were introduced in the same vein of the
changes to controller `startListeners`.

Specifically, these changes also decouple the Controller and the Worker
shutdown processes. Currently, a call to `stopListeners` on an instance
that is running as both a Controller and a Worker would stop the
listeners for both.

Lastly, we also add unit/integration tests to the shutdown code.
2022-03-25 15:04:23 +00:00
Timothy Messier 79670180a7 refact(session): Move domain logic of Worker Status into domain service
This creates a domain service function `session.WorkerStatusReport`. The
service performs two functions:

1. Checks the status for all of the reported sessions, returning a
   report of the sessions that are in a "non-active" state, i.e.
   "cacneling" or "terminated".
2. Looks for any "orphaned" session connections, i.e. connections that
   are active but were not reported by the worker. These connections are
   marked as closed.

This also removes the "ShouldCloseConnectionsOnWorker" logic, as this
was determined to not be a possible state, and was unnecessary.
2022-03-15 13:51:15 -04:00
Irena Rindos 5a2c0db586 fix(session connections): Create session connection repository 2022-03-15 12:11:31 -04:00
Haotian fa00a06bef feat(host): Add host set information to static host (#1828)
* feat(host): Add host set information to static host

Updates LookupHost and ListHost API to include sets a static host is part of, as like with plugin hosts.

* test: updated TestList_Plugin and TestCrud to be more consistent under race conditions
2022-02-01 10:06:13 -08:00
Louis Ruch ac78ee6315 Merge pull request #1819 from hashicorp/louis-scheduler
feat(scheduler): Add support for run now option
2022-01-13 12:22:06 -08:00