* feat(mongo): add mongo for boundary cli
* Fix: remove changes added by mistake during testing
* feat(enos): install MongoDB client (mongosh) in e2e Docker test runtime
* Remove explicit Boundary DB/server startup from target_tcp_connect_mongo_test.go
* Add a full stop and trigger CI
* feat: add mongosh support to boundary connect mongo
* feat: add mongosh support to boundary connect mongo
* feat: add auth-source flag for MongoDB connect command
- Add -auth-source flag with default value 'admin' for root users
- Add BOUNDARY_CONNECT_MONGO_AUTH_SOURCE environment variable support
- Update documentation with new flag and correct mongosh default
- Improve MongoDB test with explicit auth-source parameter
- Fix Docker configuration formatting for better readability
This ensures MongoDB root users authenticate against the admin database
by default while allowing flexibility for custom authentication databases.
* test(e2e): Fixed false positive in Mongo connect test; use UriNetwork and container hostname
* make gen
* fix: Removed unnecessary variable containerName from the MongoDB E2E test
* feat(connect/mongo): Build URI compatible with mongosh and set default authSource
* feat(connect/mongo): use mongosh flags following PostgreSQL pattern
* remove 'connection string' from auth-source usage text
* Update internal/cmd/commands/connect/mongo.go
Co-authored-by: Bharath Gajjala <120367134+bgajjala8@users.noreply.github.com>
* remove 'connection string' from auth-source usage text
* refacotr: replace authSource flag with authenticationDatabase
---------
Co-authored-by: Enbiya <100806254+enbiyagoral@users.noreply.github.com>
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
* add redis connect support
* Setup redis in docker for e2e testing
* Update docs and changelog
* Commenting out e2e tests for now, will revisit in a separate task
* fix: return error when listen port already in use
* add err handling for proxy start
* add listen port and DefaultClientPort tests
* add err handling for listen info
* feat: add MySQL command support
* Fix MySQL connection according to review feedback
* Update internal/cmd/commands/connect/mysql.go
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
* Update internal/cmd/commands/connect/mysql.go
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
* Update internal/cmd/commands/connect/mysql.go
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
* feat: add MySQL support to boundary connect
* docs: add MySQL to navigation menu
Fixes content check error by adding mysql.mdx to docs navigation.
MySQL page now appears in Commands > connect section alongside postgres.
* Update testing/internal/e2e/tests/base_plus/target_tcp_connect_mysql_test.go
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
* test: add containerized MySQL connection test for target functionality
* Remove MySQL environment variables from e2e test config
* test: move MySQL e2e test from base_plus to base folder
* Fix MySQL test to support both MySQL and MariaDB clients
* Fix MySQL test to support both MySQL and MariaDB clients
* lint cleanup
* adding error checks
* Make gen
* Test case testing
* Reverting bad comment
* cleaning up extra test file
* Add Mysql to runner (#5893)
* Adding back correct test file
* Removing base plus test file
* Removing base plus test file
* Revert "Removing base plus test file"
This reverts commit ace9cb3e90a028adc1f7c8ef55436ca843abfc15.
* forcing enos docker network name
* Revert "forcing enos docker network name"
This reverts commit 631bdb4a0ef87f5435e06456e8ec0a4573ab3e49.
* changing hosts to looks for sql container
* fix container name
* Adjusting for e2e tests and a bit of cleanup
* missed a commented string
* Bgajjala mysql e2etest v2 (#5900)
* Using Env Vars rather than parsing uri
* Comments fix
* spacing
* Update testing/internal/e2e/tests/base/target_tcp_connect_mysql_test.go
* Spacing
* Update internal/cmd/commands/connect/mysql.go
* adding error checks
* Make gen
* Update testing/internal/e2e/tests/base/target_tcp_connect_mysql_test.go
* Update internal/cmd/commands/connect/mysql.go
* Make gen
* derving target port from uri
* nit
* updating test to use url strings
* nit: spacing
* nit: code organization
* nit: code organization
Co-authored-by: Enbiya Göral
---------
Co-authored-by: Enbiya <menbiyagoral@gmail.com>
Co-authored-by: Enbiya Göral <100806254+enbiyagoral@users.noreply.github.com>
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Co-authored-by: Ryan Derr <54389874+RyanDerr@users.noreply.github.com>
This allows arbitrary programs to have an easy mechanism to make
connections through Boundary using Go. Internal cluster tests and test
helpers have been migrated to use this package, as well as the `connect`
command.
---------
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
* If passing a private key without specifying it in URL syntax, give a
proper error message (previously we were only making sure it was a
scheme we knew how to handle, but we need to also be more informative
if it's not a URL at all)
* If the handshake from the proxy fails, don't hang, just exit
* Update some error messages to use capitalization in line with our
standard CLI error format
The nhooyr/websocket library now has a release with the new default
behavior that removes the message size limit. This allows us to switch
off of the fork and back to the upstream.
In the same release that includes the fix we need for the boundary
client, the wspb helper package was removed from websocket. This package
contained some functions to read and write protobuf messages. However,
it was using the deprecated github.com/golang/protobuf/proto library. To
avoid this dependancy in the library they opted to just remove wspb.
Thus this provides a replacement implementation that uses
google.golang.org/protobuf/proto. Notably the newer proto library seems
to lack an equivalent of proto.NewBuffer so writes to the websocket and
not able to leverage a sync.Pool of byte.Buffers to reduce allocations.
Refs: 88bb253554
See: https://github.com/nhooyr/websocket/commit/ac385120c6e34fa6584f3856d5db949a21bbb65e
In preparation for putting proxy code in the api package this creates some necessary fields in the target output and it pre-moves credential parsing and proxy handshake code to their new places. This will make the diff for the actual proxy code move quite a bit smaller.
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
* 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>
This avoids a situation where teardown results in an error due to the
worker not accepting the connection (since the credentials are invalid).
Teardown is a best-effort way to avoid sessions that have long lifetimes
ending up having to wait for expiration before cleanup, but if we're
near expiration it doesn't really matter.
Fixes ICU-9633
The `boundary connect` subcommands attempt to parse the credentials to
use for brokering. This allows the subcommands to insert the credentials
automatically into the process called by the subcommand, i.e. `ssh` or
`psql`. There is some fallback logic to try a best attempt at parsing
the credential in cases where a credential type has not be set on the
credential source.
The bug was introduced with the recent change to the vault credential
library subtype being renamed from `vault` to `vault-generic`. This
fallback logic would only run if the credential source type was "vault"
or "static", so if the vault credential library was created without
specifying a credential-type, the credential would not be parsed and
automatically passed to the sub-process.
This fix removes the additional check on the credential source's type,
instead it will attempt to parse the credential, relying just on the
structure of the credential.
This also fixes a similar bug in the table output of secrets when using
`boundary connect` without a subcommand. The parsing of the credentials
for display in the table was only running for `vault` or `static`.
Blame: db42eafd7a
This reduces the chance that we'll hit a failure due to a mismatched
worker address, on the certificate, especially if a worker has multiple
addresses. We aren't relying on IP/DNS for security anyways, so let's
not have it be a hindrance.
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.
Passthrough args looks for the an instance of -- and re-slices the arg
list to pass through those args to the underlying connect exec command.
However such commands may also need to parse their own '--', such as
kubectl exec.
This change updates the logic so that boundary arg parser only considers
the first instance of '--' when deciding which args to pass to the
-exec= commands.
Fixes: #1857