Commit Graph
2028 Commits
Author SHA1 Message Date
Jim c1445728e3 tests (servers): additional CreateWorker(...) unit tests (#2134) 2022-06-05 14:50:15 -04:00
Jeff Mitchell caf19f867e Rename some variables to remove Nodee 2022-06-03 17:47:44 -04:00
Jeff Mitchell f4642930b4 Updates from review of 2076 (#2135) 2022-06-03 17:32:33 -04:00
Haotian 631c174f47 feat(worker): implements WorkerAuthStorage wrapper for worker credential encryption (#2076)
* Adds WorkerAuthStorage wrapper for worker credential encryption using nodeenrollment library.

* Adds AuthStoragePath field in worker config and dev mode to specify directory to store credentials.
2022-06-03 13:25:58 -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
Jeff Mitchell 1987264bc3 Migrate storage to database repo (#2132) 2022-06-03 14:44:53 -04:00
Todd a1c2f9f4d8 Add delete service function implementation. (#2124) 2022-06-03 11:34:52 -07:00
Jim 5f66d8f2af feature (worker): add WithFetchNodeCredentialsRequest to CreateWorker (#2131)
* feature (errors): add support fmt specifier with operands to WithMsg(...)

* feature (worker): add WithFetchNodeCredentialsRequest to CreateWorker

* fixup! feature (worker): add WithFetchNodeCredentialsRequest to CreateWorker
2022-06-03 14:32:51 -04:00
Todd abbfe45419 Add the Read/List service functions (#2123) 2022-06-03 11:19:04 -07:00
Jeff Mitchell 5c76017dd6 Fix nil storage 2022-06-03 12:58:26 -04:00
Jim 9da0faabd7 refactor (servers/workerauth): add StoreNodeInformationTx(...) (#2125)
refactor to export StoreNodeInformationTx(...) which can be used
by other repositories within their transactions to store
node information.
2022-06-03 12:28:54 -04:00
Jim 6cbb36f2b1 chore (servers): update nodeenrollment dep (#2129)
The signature for registration.AuthorizeNode(...) changed
2022-06-03 12:04:33 -04:00
Jeff Mitchell 98449f25eb Fix build 2022-06-03 11:09:02 -04:00
Jeff Mitchell cd9b10721f Pull in new nodeenrollment lib to fix some bugs 2022-06-03 11:05:07 -04:00
Jim 78ffd82581 fix (servers): return unhandled err from storeRootCertificates(...) (#2127) 2022-06-03 09:14:45 -04:00
Irena Rindos ded44710d5 Merge pull request #2093 from hashicorp/irindos-workerauth-repo
feat(workerAuth): Implement nodeenrollment lib workerauth storage
2022-06-02 15:21:33 -04:00
irenarindos 642e41c9d7 feat(workerAuth): Implement nodeenrollment lib workerauth storage 2022-06-02 15:09:12 -04:00
Jeff Mitchell 1ee2c0dde0 Switch nodeenrollment to staging branch 2022-06-02 13:20:37 -04:00
4716c1a788 Update List Workers Repo function to allow limits and provide scopes (#2121)
* Update List Workers Repo function to allow limits and provide scopes

Co-authored-by: Irena Rindos <irenarindos@users.noreply.github.com>
Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
2022-06-02 09:28:34 -07:00
Todd 587c6372c2 Add worker update to server repo (#2117) 2022-06-01 14:00:24 -07:00
Todd 731a45eba6 Merge the worker_status table with the worker table (#2111) 2022-06-01 13:25:29 -07:00
Jeff Mitchell 46e97a2b91 Update to new nodee lib bits (#2120) 2022-06-01 13:35:46 -04:00
Irena Rindos 5aebd5689f Merge pull request #2116 from hashicorp/irindos-update-workerauth-schemas
feat(workerauth): add storage for RootCertificates aggregate
2022-06-01 08:31:10 -04:00
irenarindos bf3b0340e5 feat(workerauth): add storage for RootCertificates aggregate 2022-06-01 08:16:14 -04:00
Jeff Mitchell 7bfe35da0d Update controller address handling (#2089)
* Don't assume it's non-empty or that this is an issue
* Ensure it's empty if the response is coming back through the multihop
  service so that it simply uses what is in the config file, at least
  for now
2022-06-01 01:09:56 -04:00
Michael Gaffney eece174e5e test(worker): Fix TestDeleteWorker 2022-05-31 13:57:50 -04:00
Todd fa2efe9878 Create the Worker API resource and the CRUDL operation definitions for a worker. (#2114) 2022-05-27 08:29:23 -07:00
Irena Rindos f3c1936e99 Merge pull request #2102 from hashicorp/irindos-move-worker-apis
refact(api): move worker handlers
2022-05-26 19:22:52 -04:00
irenarindos c811dff89b refact(api): move worker handlers 2022-05-26 19:19:07 -04:00
Irena Rindos 3e314a45f9 Merge pull request #2109 from hashicorp/irindos-delete-worker
feature(workers): add repository DeleteWorker
2022-05-26 19:18:13 -04:00
irenarindos 74fce3776b feature(workers): add repository DeleteWorker 2022-05-26 19:15:10 -04:00
Todd c2b2aa0857 Merge remote-tracking branch 'origin/main' into llb-byow
# Conflicts:
#	go.mod
2022-05-26 12:42:06 -07:00
Jim 70c5da1048 feature (workers): add repository CreateWorker(...) (#2105) 2022-05-26 13:32:21 -04:00
Johan Brandhorst-Satzkorn b20939ecb4 fix(cmd): Fix build error (#2107)
This seems to have been missed when #2094 was
reviewed and merged.

Blame: ec608b79da
2022-05-25 15:40:36 -04:00
Timothy Messier 1ce4ea9af5 chore(docker): Add dockerignore file to reduce context size (#2022)
Since the Dockerfile is now at the repository root, when running
building a docker image, the entire repository was being added to the
context sent to the docker daemon. However, only the compiled binary and
a few configs in `.release/docker` are needed to build the docker
images.

This ignore file will only send necessary fields into the context. This
helps speed up the docker image building.

For example, when building the dev image, without the ignore file:

    Sending build context to Docker daemon  2.043GB

And with this ignore file:

    Sending build context to Docker daemon  130.7MB

See:
    https://docs.docker.com/engine/reference/builder/#dockerignore-file
2022-05-25 14:34:53 -04: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 e5f02dfc26 Refactor the different repo methods into separate files (#2096)
* Refactor the different repo methods into separate files

* Move DefaultLiveness to the repository.go file to be shared across workers and controllers.
2022-05-23 09:07:30 -07:00
Johan Brandhorst-Satzkorn ec608b79da fix(cmd): Respect DB max open connections (#2094)
Both the init and migrate commands were ignoring
the configured max_open_connections database
setting. This fix ensures that both commands
respect the limits.
2022-05-23 08:21:15 -04:00
Todd 1c575a8762 make gen fix. 2022-05-20 11:58:40 -07:00
ToddandIrena Rindos 3fbf901739 Add source to worker tags table (#2087)
* 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.

* 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.

* Add worker tag sources ("config" or "api")

* Revert renaming of UpsertWorker until later.

* Remove no longer needed files.

* Moving the TestWorker into the servers package. Fix the worker tags test.

* Update internal/proto/controller/storage/servers/store/v1/worker.proto

Co-authored-by: Irena Rindos <irenarindos@users.noreply.github.com>

* Place the repos back together so they can be refactored in a different PR.

Co-authored-by: Irena Rindos <irenarindos@users.noreply.github.com>
2022-05-20 11:55:54 -07:00
Irena Rindos 12044af824 Merge pull request #2067 from hashicorp/irindos-pki-schemas
feat(pki): Add PKI schemas and protos
2022-05-20 13:53:12 -04:00
irenarindos af3f75ffaf fixup! feat(pki): Add PKI schemas and protos 2022-05-20 10:30:56 -04:00
Jeff Mitchell f6ef708466 Update against new nodeenrollment registration cache 2022-05-20 10:25:54 -04:00
irenarindos 20c314787d fixup! feat(pki): Add PKI schemas and protos 2022-05-20 10:23:15 -04:00
irenarindos 88a6ca036f feat(pki): Add PKI schemas and protos 2022-05-20 10:02:06 -04:00
Jeff Mitchell 1f550722a2 Sync against current library state 2022-05-19 14:17:01 -04: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
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
Carlos Alcaide Corvo d7adc2cb5e Update UI version to consume the new renamed UI artifacts (#2080) 2022-05-17 16:32:36 -07:00
Louis Ruch 6f4cee88bf fix(vault_store): Correctly return expected errors (#2081)
* fix(vault_store): Correctly return errors
2022-05-17 12:20:01 -07:00