* Use the intercepted token if present, use it through the keyring if keyring contains it
* fixup! Use the intercepted token if present, use it through the keyring if keyring contains it
* Apply suggestions from code review
Co-authored-by: Jim <jlambert@hashicorp.com>
---------
Co-authored-by: Jim <jlambert@hashicorp.com>
* Decrease number of flags shown for daemon/search
* Update changelog
---------
Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
After updating `boundary dev` to use postgres:12 by default, it was
noticed that the responsiveness of boundary was noticeably slower. This
is due to the introduction of JIT being enabled by default in
postgres:12. JIT seems to incur noticeable overhead without providing
benefits, at least for the instance used for `boundary dev`.
It is also worth noting that for postgres:14 and newer, JIT does not get
triggered for the same queries since they seem to result in a cheaper
query plan that does not exceed the default threshold for JIT.
See:
https://www.postgresql.org/docs/current/jit.html
ICU-12283
This has been superceded by the nodeenrollment-based KMS worker auth
mechanism. This commit only removes the ability to connect with this
mechanism; some upgrade logic will remain intact for a bit and
can be removed later.
* Add skip daemon flag and send recently authed tokens to daemon
* Rename flag skip-daemon to skip-cache-daemon
* adding option test
* move common.Options to base.Option
* SocketAddress returns *url.URL, fix search test
The commands added are:
boundary daemon start
boundary daemon stop
boundary daemon add-token
boundary daemon status
boundary search
If these actions are performed on a platform that doesn't support sqlite
natively in go an error is returned.
Besides some hooks into the cmd package all the significant logic
resides in internal/clientcache
feat (cmds/authenticate): output the token name when storing token
feat: update go-dbw which now uses pure go sqlite driver
refact (base.Command): export FlagOutputCurlString
Exporting FlagOutputCurlString allows other commands that embed
the base.Command to access the flag as needed
feat: add a cache Repository to manage cache storage
feat: add a "cache" CLI command
This new command will support both managing and searching the
local CLI cache daemon.
feat: start cache daemon as needed when issue CLI commands
Move files to new directories and add persona table (#3526)
* Add persona table and move files to new directories
Client daemon now uses unix sockets and update pathing (#3535)
* Add unix socket listen and dialers with file permissions applied
* Update the pathing to match RFC
Cache refreshing now uses all stored personas. (#3545)
Updating headers for LLB files
Decouple daemon and cache server (#3566)
* Separate daemon from server
* Add persona handler to daemon server (#3579)
Moved search to use mql and added tests for the search command (#3589)
* search uses hashicorp/mql
Windows support for client side daemon (#3618)
* exec.Command for background process
* Log to stderr when in foreground and file always
* Use pid files across platform for start and stop
Requests with version info must match the daemon's version (#3640)
* requests with version info must match daemons
Update dependencies and breakout cgo/pure go sqlite drivers (#3657)
upgrade go-dbw deps and add cgo build tags
Enable graceful shutdown in windows (#3695)
* Enable graceful shutdown in windows
Co-authored-by: Jim <jlambert@hashicorp.com>
Targets delete when a persona changes address or user id (#3673)
* Handle cache refresh in repo
Add sessions to the client side cache (#3682)
* Add sessions to repository
* Search command supports sessions
* adding session related tests to db and refresh
Change cache schema from personas to tokens+users (#3737)
* Change from personas to tokens+users
* Separate keyring tokens from auth tokens
Add support for keyringless auth tokens (#3765)
* Add support for keyringless auth tokens
Remove expired auth tokens from cache (#3768)
* Remove expired auth tokens from cache
Complete the TODO of checking for inflight tx (#3779)
Delete tokens that the controller says are invalid (#3782)
fix search test with boundary token check (#3799)
Collect resource info in repository_<resource>s.go (#3769)
* Collect resource info in repository_<resource>s.go
* Move search logic into the domain (#3794)
Daemon and search restricted to supported platforms (#3801)
* Daemon and search restricted to supported platforms
Reorganize the clientcache packages (#3814)
* Refactor for self contained domain logic
* Put clientcache stuff under internal
* Add generic read/update/delete commands
This adds three generic commands that use the resource prefix to
determine the subcommand to run and pass through args over to that
subcommand. Since this occurs very early on and to avoid loading
essentially every internal resource package, I moved subtype definitions
to globals.
This replaces #3967
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
* De-duplicate Subtype code (#4031)
Co-authored-by: Timothy Messier <tim.messier@gmail.com>
---------
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Co-authored-by: Timothy Messier <tim.messier@gmail.com>
* Add generic read/update/delete commands
This adds three generic commands that use the resource prefix to
determine the subcommand to run and pass through args over to that
subcommand. Since this occurs very early on and to avoid loading
essentially every internal resource package, I moved subtype definitions
to globals.
* Update main.go
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
* Update changelog and remove another deprecated command
---------
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
* fix (events): convert multierror to stdlib error
multierror errors will be converted to a stdlib error (because
multierror doesn't support json marshaling).
* refact (errors): convert from multierror to stdlib errors.Join(...)
* refact: convert from pkg/errors to stdlib error wrapping
* Adding explicit MPL license for sub-package.
This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.
* Adding explicit MPL license for sub-package
This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.
* Updating the license from MPL to Business Source License
Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl.
* Update copyright file headers to BUS-1.1
* Rerun make gen
This will pick up the last of the license changes
* Revert "Rerun make gen"
This reverts commit dbe0968bffd92745d8663c6940debae098395a6b.
* Remove copywrite from generation script
The current version of copywrite is not sophisticated enough
to only apply the copywrite changes to certain subdirectories,
so to avoid accidentally relicensing our api and sdk modules,
we will stop running the copywrite script until such time
that it can do the right thing.
* License protobuf API as MPL
The protobuf API files are used to generate the SDK,
since we want the SDK to be MPL, the protobuf files
must also be MPL. This extends to all protobuf files
whose sources end up in the SDK directory, including:
- internal/proto/controller/api
- internal/proto/controller/custom_options
- internal/proto/plugin
It also includes the generated service directory in
internal/gen/controller/api/services, since they are
generated from the protobuf sources used for the SDK.
* Change website license file name
This makes the naming scheme consistent with the rest
of the repository.
* Add note on licensing to README
* Set copywrite license to BUSL
* Revert "Add note on licensing to README"
This reverts commit 4d865a91a7a4f11605f0dc4609355d7e3c3cfffe.
---------
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
* chore (dev/ldap): update gldap dependency
This update fixes the dup entries returned when searching for users
and/or groups
* feat (boundary/dev): add connection info for dev ldap server
This adds a new mechanism for worker authentication that uses the
third-party arbitration of the original KMS flow by leveraging
recently-added capabilities in nodeenrollment to support a registration
wrapper. This allows for workers to be registered to the system with
just a name and a matching wrapper, while at the same time allowing
these workers to be used for private Vault access and multi-hop as they
contain per-worker encryption keys and support rotation.
Nodes using this mode will generate and rotate credentials in-memory
(using another recently added nodeenrollment capability) so will have a
new set of keys on every startup. This has the side effect of ensuring
that there is never a conflict or re-use of these credentials.
Note that the normal test worker flow was using the now-deprecated KMS
method; there is still a test that uses this (explicitly) but all other
tests using test workers that did not specify a specific PKI flow now
actually use this mechanism. This means there is fairly decent test
coverage in a general sense, plus the specific tests updated/added for
this feature.
This also adds a new KMS type that can be used to have
distinct KMSes for upstream authentication vs. accepting from
downstream.
- Refactor the Target domain repository functions so that they no longer return 4 different types.
`Target` struct now contains `HostSource` & `CredentialSources` with Getters & Setters
- Extending `Target` to contain `HostSource` & `CredentialSources` enables `funcs` to just return `Target` instead of multiple return types.
This also allows easy future refactors and extensions of `Target`
* chore: Upgrade Go version
* fix: Upgrade golangci-lint to support 1.20
* fix: Don't use t.SetEnv in parallel tests
This is a panic in Go 1.20 and it sounds like a recipe
for distaster in general.
When using the json output of the cli (`-format=json`), a successful
call to the controller API would place the HTTP status code in the JSON
as `status_code`. However, if there was an error from the API the status
code would be placed in the JSON as `status`. In order to be consistent,
this adds a `status_code` field to the error response case. For
backwards compatibility it still populates `status` in the error case.
This inconsistency was missed partially due to a bug in the CLI tests.
The assertion on status code was not valid and would always be
successful. Thus this also fixes the assertions and tests.
Creates a target using an address for boundary dev and when first
init-ing boundary (boundary database init).
It also makes this newly created target the default one
(ttcp_1234567890). The target using host sources is now a secondary
target (ttcp_0987654321).
In #2721, the ability for key-only values was added via using a
wrapperspb.StringValue that could be null. This introduced a bug because
originally the default case for `-attr` was to get the string value but
instead it used the incoming value as-is to allow for nulls; the null
check was moved up later but the original behavior was not restored. As
a result, non-explicitly-quoted strings carried through the
wrapperspb.StringValue, resulting in a map for the value in JSON instead
of a string.
This also fixes the ability to set explicitly quoted strings.
Add initial templating support to Vault credential libraries
This adds support for templating various account and user values into
Vault dynamic credential library POST bodies and GET/POST paths.
It also unifies how parameters are used in grants, with backwards
compatibility.
This commit extracts 3 separate pieces of functionality into their own
function/method:
- Extracts the database opening with the intention to have a function
that performs all that functionality but returns the created database
object rather than setting it to the Server structure.
- Extracts database validation logic, to provide a common code path for
upcoming functionality.
- Expose schema manager on the Command struct as well as providing
common functions to acquire shared lock/close.
In cases where the server was started with both a controller and worker
stanza, the reload of the config was not properly setting the initial
upstream value on the new config. In this case the value is derived from
other config values and not necessarily set directly.
This now properly initializes the new config so that initial upstream is
set in the same manner as the first load.
Blame: 5d0cdf680f