Create Schema Manager and propagate contexts into the DB calls downstream.
Add checks at controller startup and database init for correct schema version and schema migration dirty bit being set.
This returns authorized actions on targets to users when they perform an operation on a target, including listing. It also prevents users from seeing values in listing targets on which they have no permissions.
This adds logic to error on certain invalid listener config:
* If an address in the worker's "controller" set is unspecified or
multicast or global unicast, error
* If the controller's cluster address is unspecified, ensure
public_cluster_addr is set
This has been a source of some confusing behavior on some GitHub tickets
and even on the team, so preventing it is probably a good idea.
It also relaxes the restriction around controller address matching cluster address in single-server mode when using DNS names.
* Attempt canceling sessions by the client
In some circumstances (like a Ctrl-C), the client knows it's shutting
down and the TOFU token will be lost. In this case it makes sense to
cancel the session rather than have it time out. This introduces a
command enum to the handshake message which can be used for the client
to send commands to the worker -- in this case the only specified
command is to cancel the session. It doesn't occur if the session is
already timed out or if we can't authorize connections as this generally
means the session is already invalid.
This is a wire breaking change for json errors since we have removed and renamed a few fields, and changed part of the structure of the returned json error.
* Remove redundant fields in Status, details.error_id, details.TraceId and details.request_id from API errors.
* Added wrapped errors and "ops" field to indicate the internal operation of the errors returned by the API.
* Added error cli error reporting of Op and wrapped errors.
* Reorganize the db migration .sql scripts into individual schema version directories and generate the sql httpfs fakeFile accordingly.
* Created a /dev schema version directory to hold db schema updates that have not been finalized.
* Add an 'allow-development-migrations' flag to allow `boundary database init` to be executed even when there are schema updates in /dev.
* feat: make auth token time to live and staleness configurable
* docs: add configuration docs for auth token TTL and staleness
Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
We have behavior that causes "0.0.0.0" to only listen on IPv4, however,
it also assumed there was a port suffixed. This changes it so that it
also works with a port-less address.
Go's TLS stack doesn't need a separate CA cert and in fact for sessions
we don't use this. So simplify the worker connection to remove an
unnecessary extra key generation.