Commit Graph
1864 Commits
Author SHA1 Message Date
Jim 4636efce8f refactor (tests): GetEventDetails(...) will stop returning nil (#2019) 2022-04-15 12:20:44 -04:00
Jim cb93c6bdfd chore: update auditResponseInterceptor const op (#2018) 2022-04-15 12:04:20 -04:00
Jeff Mitchell f370abc1da Unify plugin building (#2013)
This causes the build.sh script to chain to plugins.sh which makes
plugin building behave the same for both local and release builds.
2022-04-15 09:17:43 -04:00
Cameron Perera f9ce13c779 chore: Add redirect for targets worker filtering (#2009) 2022-04-14 12:55:34 -05:00
Hugo cc54a834e8 feat(worker): Instrumentation for Controller Cluster Communication (#1998)
* feat(worker): Instrumentation for Controller Cluster Communication

Adds request latency observations to the worker side (client) of
worker <-> controller cluster communications by integrating a new
grpc client interceptor.

* style(controller): make-gen-deltas changes
2022-04-13 15:52:54 -07:00
Todd 36b7f3e1f8 Update the cluster server metrics to use the gRPC status.Handler. (#2000)
gRPC status.Handler gives us visibility into gRPC returned errors. In contrast, there are some situations where no metric would be counted at all using the interceptor approach (for example, in out of memory cases where gRPC would return a resource exhausted error).
2022-04-13 10:27:26 -07:00
Haotian e3f72bd0a4 feat(metrics): add build info metric on server start (#1984)
Adds a Prometheus gauge metric set to the value of 1, with labels for go version, git revision, and Boundary version. 
Assigns the Prometheus DefaultRegisterer to the Server struct as a parameter to NewServer(), to avoid "duplicate metrics collector registration" panics from test cases.
2022-04-12 17:04:11 -07:00
Johan Brandhorst-Satzkorn 8d80d10ff7 fix(controller): Cancel tests on fatal errors (#1994)
When requesting a token, any error is fatal to the test.
The previous behavior would return a nil token, which
could cause subsequent uses to panic. This will instead
interrupt any test immediately on error.
2022-04-12 16:56:04 -04:00
Louis Ruch 9b48dbc2fd fix(logs): Remove erroneous scheduler run logs at first run. (#1980)
The Scheduler is dependant on the server being inserted into the
database. Adding an upsert server call before starting scheduler
and tickers removes the race that caused log spam due to a missing
foreign key relationship.
2022-04-12 08:17:14 -07:00
Jim 8895bc08e0 fix (kms): properly reconcile DEKs for existing scopes (#1976) 2022-04-12 09:20:52 -04:00
Bryce Kalow 7f69e935bf website: website source code / content split (#1838) 2022-04-11 14:46:36 -05:00
Hugo 06c13064cc Merge pull request #1963 from hashicorp/hugoamvieira-proxyws-metrics
feat(worker): Implement proxy handler websocket instrumentation
2022-04-11 14:53:52 +01:00
Hugo Vieira 3564776517 feat(worker): Implement proxy handler websocket instrumentation
Add metrics on read/written bytes and active worker websocket
connections.
2022-04-11 14:34:40 +01:00
Louis Ruch e6b7b7f60a feat(db): Suppress not found events during db lookups (#1979) 2022-04-08 18:04:12 -07:00
Jeanne Angeles Franco 2c10159086 Remove quality-tests event (#1989) 2022-04-08 15:23:58 -07:00
Johan Brandhorst-Satzkorn f2fa1142d3 fix(test): Remove uses of t.FailNow in goroutines (#1978)
It is documented as illegal to use t.FailNow in a goroutine.
Uses of require assertions call t.FailNow. This may have led to
inconsistent test results as some assertions were subject to
undefined behavior. Note that it is still allowed to call
assert assertions in goroutines.

See: https://pkg.go.dev/testing#T.FailNow
2022-04-07 09:26:34 -04:00
Jeff Mitchell 1be55b50c7 Pull up Server to top level of Init command (#1959)
* Pull up Server to top level of Init command

Init was using a local server variable but not passing in the existing
command, resulting in the context being lost. This caused the command to
fail to run since the changes to add logging to KMS plugins were
introduced.

This also fixes a couple of places that were not using the global const
value for config KMS.

* Fix test compilation
2022-04-06 16:40:47 -04:00
Jim 0ca86c8a2c chore: remove unneeded ref to gorm.DB (#1971) 2022-04-06 09:17:17 -04:00
Todd fb068341a4 Update naming for initializing collectors and tweak some comments. (#1968) 2022-04-04 11:38:15 -07:00
Johan Brandhorst-Satzkorn b1d6a1da9a Switch to buf for protobuf generation (#1944)
* Install buf with go install

This reduces the impact of using buf on our dependency
closure, which was significant. It also avoids potential
issues with building buf given our own internal dependency
constraints. This has caused issues (including crashes!)
in the past.

See https://github.com/cockroachdb/cockroach/issues/67216#issuecomment-874176186
for more discussion on using tool dependencies generally, and
https://github.com/bufbuild/buf/issues/52
for an example of where this sort of thing caused an issue for a user.

* Upgrade buf version

We should migrate to v1 sooner rather than later, as it has some
breaking changes from v0.

* Change buf lint/breaking commands

These commands were moved up one level for v1

* Migrate to buf.yaml to v1

* Remove unused imports

These were uncovered by using "buf lint".

* Use buf v1.3.1

* Depend on googleapis and grpc-gateway via BSR

* Switch to buf for proto generation

* Remove third party dependency

* Remove unused tools and scripts

* Move local protos up one level

* Temporarily don't fail on breaking changes

* Generate CI config

* Fix generation of controller.json

* Replace use of deprecated flag

* Remove unused import, regenerate files

* Remove temporary skipping over breaking check
2022-04-04 13:55:42 -04:00
Jeff Mitchell 58a448fc6a Put session ID in ALPN (#1966)
This allows us to use SNI for actual host (e.g. routing) information. We
don't have the client cert yet so we can't look at that, so this
provides a way for us to convey the information needed to look up that
session's TLS stack.

Using SNI for hosts means we also run into the fact that we don't have
automatic agreement in terms of SANs. So when generating the certs we
now also pass worker address information to the function to be encoded
in the cert.

Finally, there is a change in how the websocket dialing happens, because
http.RoundTripper tries to be too clever for its own good and overwrites
NextProtos on a whim.
2022-04-01 16:32:20 -04:00
Haotian 62f0d18885 Initialize and provide handler for proxy worker http metrics (#1961)
*feat(metrics): implement prometheus handler for proxy worker http requests and record metric for header write duration
2022-04-01 12:07:40 -07:00
Todd 20e6c0ce6c Add collector updating interceptor to the controller cluster grpc server (#1964) 2022-04-01 10:52:36 -07:00
Jeff Mitchell 07dc3db974 Remove ALPN Muxer (#1965)
We never ended up using this and it makes it much harder to reason about the listeners.

An explanation: for the moment I separated out all of the listeners in the struct, even though one should suffice, because when I did it that way first I was hitting some really weird and hard to find intermittent behavior where it seemed like the listeners were getting crossed. So I re-did it this way with each listener very explicitly referenced. I'm happy to make a follow-up PR that attempts to combine them all into a single listener without hitting the issues I did, if desired, but at least doing it via a separate PR means that it won't be something with removing the ALPN muxer that is at fault.
2022-04-01 12:06:41 -04:00
PPacent ce7292d9c8 Docs: Adding service discovery concept page (#1886)
* Adding service discovery concept page
2022-03-31 14:54:53 -07:00
A-440Hz 95e1fe8df0 typo(metrics) changing response size to request size 2022-03-31 14:54:25 -07:00
ToddandHugo Vieira 3eb22b073a Defines the controller api metrics and registers them at controller startup (#1917)
Co-authored-by: Hugo Vieira <hugoamvieira@users.noreply.github.com>
2022-03-31 08:48:50 -07:00
Hugo 1bb2c5983d Merge pull request #1910 from hashicorp/hugoamvieira-worker-start-listeners
refactor(worker): Startup, shutdown and cluster tests changes
2022-03-31 16:28:55 +01:00
Joey Freeland 15a6ffeb6b chore: clarification on default TCP ports (#1878) 2022-03-30 09:36:30 -07:00
Lili Cosic d2602584ab docs: Add full example for using recovery KMS workflow (#1888) 2022-03-29 18:18:33 -07:00
Johan Brandhorst-Satzkorn 121a296a7f Refactor file formatting target (#1951)
Use the standard Go heuristic for determining
whether a file should be ignored by formatting
for being a generated file.

This is effectively a no-op change today, but
if we add new generated files in the future,
we should automatically ignore them in formatting.

This is a slightly updated version of #1941 that should
work across all versions of grep.
2022-03-29 15:37:25 -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 657b099440 refactor(worker): Ensure startListeners consistency with controller
Implements changes on Worker's `startListeners` func to be consistent
with the changes on the Controller's side done in
b5ef468d33.
2022-03-29 16:45:56 +01:00
Hugo Vieira 1ebd7deccf refactor(worker): Validate listener configuration in New
With this change, the Worker is now aware of its own listeners in a
more codified and structured way.

These changes have already been made in the controller on
8d48a8515c. They're now made on the
worker for similar reasons.
2022-03-29 16:44:05 +01:00
Hugo 244237cd2f feat(controller): Add health endpoint (#1882)
* feat(controller): New health service and server

This change also implements a new listener purpose, `ops`.

`ops` (short for operations) is a new listener purpose that is
responsible for serving Boundary's operations endpoints, like health
and possibly metrics.

At Startup: `ops` listeners get configured as late as possible to catch
any errors with the startup process;

At Shutdown: If the health endpoint has been set-up, we introduce a
configurable delay in the process. This is to enable the health endpoint
to report unhealthy for that amount of time. `ops` listeners are also
the last listeners to be shutdown.
2022-03-28 17:16:39 +01:00
Johan Brandhorst-Satzkorn 63d3481031 Revert "Refactor file formatting target (#1941)" (#1949)
This reverts commit 9029720664. It
was causing unexpected errors on some platforms. More investigation
will be necessary.
2022-03-25 17:54:02 -04:00
Hugo 5bdc371fa1 Merge pull request #1908 from hashicorp/hugoamvieira-controller-stop-listeners
refactor(controller): Decouple listeners/servers shutdown from Worker
2022-03-25 17:37:07 +00:00
Johan Brandhorst-Satzkorn 9029720664 Refactor file formatting target (#1941)
Use the standard Go heuristic for determining
whether a file should be ignored by formatting
for being a generated file.

This is effectively a no-op change today, but
if we add new generated files in the future,
we should automatically ignore them in formatting.
2022-03-25 13:20:10 -04: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
Hugo d438a6d2dd Merge pull request #1907 from hashicorp/hugoamvieira-controller-start-listeners
refactor(controller): `startListeners` improvements
2022-03-22 16:43:29 +00:00
Michele Degges bc2bd50b2b Add release API metadata file (#1939) 2022-03-22 09:42:20 -07:00
Johan Brandhorst-Satzkorn 803d916279 Update zalando/go-keyring with freebsd fix (#1938) 2022-03-22 09:52:42 -04:00
Jeff Mitchell af1fafab64 Speed up all make targets by only finding generated files when we need to (#1937) 2022-03-21 13:26:01 -04:00
Johan Brandhorst-Satzkorn 9dc8c45634 Revert version upgrade of dbus and go-keyring (#1936)
* Revert version upgrade of dbus and go-keyring

The combination of these versions were causing build errors on freebsd

* Only revert zalando/go-keyring
2022-03-18 16:32:43 -04:00
Jeff Mitchell c99907c6c5 Update keyring deps to remove deprecation warnings (#1924) 2022-03-18 13:52:38 -04:00
Hugo Vieira b5ef468d33 refact(controller): Ensure deterministic listeners start order
Previously, we initialized the listeners on the order they were provided
to us on the config file. In the future, we'll want to add new listener
purposes that depend on existing ones, so the init order needs to be
deterministic.

With this change, we'll initialize components in this order:
1. gRPC Server for Controller API.
2. All `api` HTTP Servers & gRPC Gateway Muxes.
3. `cluster` gRPC Server.

This commit introduces some renames for the sake of clarity as well as
improved test coverage:

- Removes `gatewayMux` reference from Controller object. This object was
misleading and is now uneeded.
- Removed uneeded `context.Context` arguments.
- Separates gRPC Server and gRPC Gateway concerns, both in functionality
and in naming. These two were conflated before.
- Added unit tests on `startListeners`.
2022-03-17 19:12:27 +00:00
Hugo Vieira 8d48a8515c refact(controller): Validate listener configuration in New
With this change, the Controller is now aware of its own listeners in a
more codified and structured way.

The reasoning behind these changes are as follows:

1. Currently, we're iterating over these listeners in multiple spots
along this initialization flow to check each listeners' purpose. By
doing this once when we create a Controller and essentially storing the
result, we can clean up the downstream code to use those results.

2. Initial effort to centralize Controller validation. At the moment, we
are doing a lot of validation all over the `cmd` and `config` packages.
From a conceptual perspective, Controller-related validation should
be performed in the function that is responsible for constructing the
Controller object itself. This enables any developer to look in a
single place for all the constraints that we place on creating a
Controller.
2022-03-17 17:53:04 +00:00
Lars Lehtonen b6ee5dc9cc internal/session: fix dropped test errors (#1928) 2022-03-17 12:57:29 -04:00
Carlos Alcaide Corvo 1a3f26ed30 Bump desktop client version for website docs (#1930) 2022-03-17 09:10:04 -07:00