Commit Graph
85 Commits
Author SHA1 Message Date
Michael Li 02dc9be85f refact(e2e): Create role functions 2022-10-31 10:36:18 -04:00
Michael Li 81bb361148 test(e2e): Add ssh localhost test (#2579)
This adds a test case where a user would do `boundary connect` in one terminal and `ssh localhost` in another to get to the target.
2022-10-28 16:36:18 -04:00
Michael Li f4a38a7fc9 fix(e2e): Fix authentication flakiness
There was a misunderstanding of how goroutines work. Turns out, the goroutine uses the same keyring as the main routine, which can result in some conflicts depending on when the goroutine executes
2022-10-27 17:40:13 -04:00
Michael Li c1449c4fd8 test(e2e): Add additional checks to credential store tests 2022-10-27 17:40:13 -04:00
Michael Li 935cc830aa test(e2e): Add test for vault using the connect authz-token option 2022-10-27 17:40:13 -04:00
Michael Li 0424d379cf refact(e2e): Reorganize test directory
Rearranges the directory structure to align better with the enos scenarios. Tests will now be added in the `tests` directory, with a folder in the directory corresponding to an enos scenario.
2022-10-27 17:40:13 -04:00
Johan Brandhorst-Satzkorn f57454b6b9 Rewrite interface{} to any (#2535)
* chore: Rewrite interface{} to any

* Add ignore revs
2022-10-25 19:29:38 -04:00
Michael Li 57ffc71849 refact(e2e): Add context as an argument for cli methods
This was done have some alignment with the corresponding api methods as well as matching standard Go conventions.
2022-10-25 16:23:52 -04:00
Michael Li a956e8dec9 refact(e2e): Add WithEnv option to RunCommand
This was done to keep the scope of environment variables to just the command execution
2022-10-25 16:23:52 -04:00
Michael Li 1cc2b0b820 doc(e2e): Update typo in comments 2022-10-25 16:23:52 -04:00
Michael Li 6bd168b2a3 test(e2e): Add test that creates a user with the right permissions to start a session 2022-10-25 16:23:52 -04:00
Michael Li 07b16e877c refact(e2e): Rename original session cancelling test 2022-10-25 16:23:52 -04:00
Michael Li 5d795e6104 refact(e2e): Add support for authenticating as any user 2022-10-25 16:23:52 -04:00
Michael Li 5b0ff4f058 test(e2e): Port "credential stores deletion check" from bats test to e2e test suite
The "can not read deleted $NEW_STORE static store" bats test was demonstrating flaky behavior where it would fail due to the credential store read still returning something valid. This check has been moved to an e2e test in order to add some retry logic to the check.
2022-10-20 13:47:46 -04:00
Michael Li 79bc3d4878 refact(e2e): Create credential store function 2022-10-20 13:47:46 -04:00
Michael Li ab223493a3 fix(e2e): Remove unused code 2022-10-20 10:52:11 -04:00
Michael Li 56ed25a88c test(e2e): Rename file for clarity 2022-10-20 10:47:07 -04:00
Michael Li a4e27d877d refact(e2e): Update RunCommand to have context argument 2022-10-19 10:46:57 -04:00
Michael Li 84aa65ccc5 test(e2e): Add test that cancels a session 2022-10-19 10:46:57 -04:00
Michael Li cb3f057878 test(e2e): Add test that uses connect authz-token option 2022-10-19 10:46:57 -04:00
Michael Li ff960e1fb1 refact(e2e): Rename files for consistency 2022-10-19 10:46:57 -04:00
Michael Li 618eca19f5 refact(e2e): Create functions for commonly used operations
Many tests had duplicate code to create the base level domain objects in a boundary environment. This commit refactors that code to use functions for these commonly used operations.
2022-10-19 10:46:57 -04:00
Michael Li 051d337b21 refact(e2e): Move logging to helper function 2022-10-19 10:46:57 -04:00
Michael Li 1f87da9fd4 fix(e2e): Fix comment typo 2022-10-19 10:46:57 -04:00
Michael Li 01301cd32a fix(e2e): Add missing requires 2022-10-19 10:46:57 -04:00
Michael Li d8448d2184 doc(e2e): Fix typo 2022-10-12 09:49:08 -04:00
Michael Li f9dfd024ed doc(e2e): Add info for adding tests 2022-10-12 09:49:08 -04:00
Michael Li 719200612d refact(e2e): Remove use of AwsHostSetCount env
Instead of passing in the number of hosts created for a host set, we can just use the length of the IP addresses to determine that value.
2022-10-12 09:49:08 -04:00
Michael Li 5365b29007 refact(e2e): Port enos smoke test into e2e test suite
This adds a test case to the e2e test suite and unifies where testing is located.
2022-10-12 09:49:08 -04:00
Michael Li 1361c3cc6d refact(e2e): Move environment variables into its own file 2022-10-12 09:49:08 -04:00
Michael Li 86dafced1a fix(e2e): Add missing require 2022-10-12 09:49:08 -04:00
Michael Li 0afef63dca refact(e2e): Use envconfig's required property 2022-10-05 11:54:16 -04:00
Michael LiandJosh Brand da0fb9d38a test(e2e): Add dynamic host catalog test (AWS)
This adds the initial set of tests that validate setting up a dynamic host catalog on AWS

Co-authored-by: Josh Brand <jbrand@hashicorp.com>
2022-10-05 11:54:16 -04:00
Timothy MessierandJeff Mitchell d896f37493 Support reading multiple configuration files(#2504)
feat(config): Support multiple files

This updates the three subcommands that take a `-config` flag to
to support multiple config files via a repeated `-config` flag.
It updates the following subcommands:

- `server`
- `database init`
- `database migrate`

Note that the multiple file support only works if all config files are
HCL, not JSON. Also note that the config files are concatenated
together. There is no attempt to merge config files, so having the same
stanza in multiple files can yield unexpected results, with only one of
the stanzas being used.

When used with these limitations understood, this provides a way to take
different actions for different kinds of dynamic configuration changes.
An example would be when using consul-template to render the
configuration files for boundary. With the multi file support
consul-template can render one config file for the controller stanza,
and provide boundary with a dynamic database credential via vault. Then
when the credential is rotated, consul-template can send boundary a
SIGHUP to switch to the new credential without a restart. A separate
template could be used to render a config for a stanza that does not
support SIGHUP, such as the events stanza that gets its values via
consul's KV. If these values change, consul-template can restart
boundary so the new configuration is used.

Co-authored-by: Timothy Messier <tim.messier@gmail.com>
Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2022-09-29 09:01:33 -04:00
Michael Li 8fe0d13caa test(e2e): Add vault tests
Adds the first set of vault tests. This test sets up vault as a credential store and creates a set
of credentials for a target.
2022-09-27 12:21:10 -04:00
Johan Brandhorst-Satzkorn da9adb0c02 feat: Build docker dev images for specified platform (#2493)
Previously, building this target on an ARM machine would
produce an image with a amd64 binary inside an arm
OS.
2022-09-26 11:39:13 -04:00
Michael Li 21e4b70e27 test(e2e): Add end-to-end tests (connect to first target)
This adds the initial end-to-end tests. These tests validate the admin workflow
of setting up their first target
2022-09-16 15:30:12 -04:00
Timothy Messier eb61ac6304 refact(session): Add context to session factory
This adds a context to the session.RepositoryFactory, allowing
errors.NewDeprecated to be replaced with errors.New. It also removes the
common.SessionRepoFactory, instead packages just directly import from
the session package.
2022-09-07 17:53:40 +00:00
Johan Brandhorst-Satzkorn de2c40fa77 Fork pgtap-docker to support arm64 (#2411)
* feat(sql): Fork pgtap to support arm64

This forks pgtap-docker and builds the image locally,
and updates our references to use our forked image.

* fixup! feat(sql): Fork pgtap to support arm64
2022-09-01 11:33:10 -04:00
Johan Brandhorst-Satzkorn aef9073fa6 Upgrade to Go 1.19 (#2347) 2022-08-25 12:12:24 -04:00
Damian Debkowski 27e9f775be feat: add initial migration hook 2022-08-22 12:15:20 -07:00
Todd 19b549c44a Rename package servers to server (#2222) 2022-06-20 18:20:17 -07:00
Todd e379234259 Remove CanonicalAddress, GetApiTags(), and NewWorkerForStatus. (#2196)
Minor testing tweaks are also included.
2022-06-15 11:47:38 -07:00
Todd 731a45eba6 Merge the worker_status table with the worker table (#2111) 2022-06-01 13:25:29 -07:00
Todd a281d10206 Add worker config table and view (#2090)
* 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-24 15:08:02 -07:00
Todd 2ecd550e27 Add fields to server_worker to be a boundary resource (#2083)
* 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 contraints, 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.

* Updating server_id references to controller_id.

* Adding worker tag db writing test.

* Move the server table back to the top.

* Update comment for the worker object.

* Update comment for the worker table.

* Update the newWorkerId call to take a context and fix its error.

* Correct comment for the wt_network_address domain.
2022-05-18 17:03:24 -07: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 d8a443e238 Merge branch 'main' into llb-byow
# Conflicts:
#	internal/daemon/controller/handlers/targets/target_service.go
#	internal/daemon/controller/handlers/workers/multihop_service.go
#	internal/daemon/controller/handlers/workers/worker_proxy_service.go
#	internal/daemon/controller/handlers/workers/worker_service.go
#	internal/daemon/worker/status.go
#	internal/daemon/worker/worker.go
2022-05-09 14:14:52 -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
irenarindos 9e27605213 refact(servers): Split server table into worker and controller 2022-05-09 13:30:01 -04:00