Commit Graph
44 Commits
Author SHA1 Message Date
aditya2548 f8363dd06e [COMPLIANCE] Update Copyright & License Headers 2026-04-06 15:48:57 +05:30
429247f407 [COMPLIANCE] Update Copyright Headers (#6282)
* [COMPLIANCE] Update Copyright and License Headers

* chore: make gen to generate files with copyright headers

* chore: update missed copyright headers

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Justin Nguyen <justin.nguyen@hashicorp.com>
2026-01-28 11:05:07 -06:00
Timothy Messier 5329f926b6 fix(api): Correctly apply BOUNDARY_MAX_RETRIES env var (#5385)
The api.Client was first checking for the environment variable, and then
resetting the max retries to 2, thus overriding the environment variable
value. In addition, the cli would set max retries to zero if the
environment variable was not set. This would mean that by default the
max retries would be zero, and if the environment variable was set, the
max retries would be 2, regardless of the actual value for the
environment variable.

This fixes the order in which the environment variables are read, to
ensure they take precedence.
2025-01-08 10:07:09 -05:00
Hugo 6f370c1189 fix(api): Check MaxRetries integer bounds 2024-08-21 13:55:58 +01:00
Todd b71d134e06 Create Client and update Errors for client daemon commands (#4011)
* Create a client cache daemon client

* Fix error formatting for the client cache cmds
2024-01-05 07:43:20 -08:00
Jim fba9d1cdf1 Add client daemon repo, server, and cmd
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
2024-01-05 07:43:20 -08:00
Timothy Messier da5dd383ad feat(api): Use Retry-After header when retrying a request
If the api.Client receives a 429 or 503 along with a Retry-After header,
the client will automatically wait the amount of time specified, and
then re-try the request.
2023-12-04 18:07:01 +00:00
Johan Brandhorst-Satzkorn e108ae40ad Upgrade to Go 1.21 (#3573)
* Upgrade to Go 1.21

* event: remove tests depending on pointer comparison

The test now just tests that the logger is non-nil. For
some reason the old test was broken by upgrading
to Go 1.21.0.

* api: use dummy Host header for unix sockets

When using unix sockets with the net/http.Client,
we cannot use the unix socket address directly
in the Host header, as it fails the validation step.
Instead, use a dummy address in the Host header.
2023-08-15 12:04:58 -07:00
Jim d49fde2299 feat(cli/session-recordings): add download cmd 2023-05-31 12:18:22 +00:00
Johan Brandhorst-Satzkorn 3c29308673 chore: Add license headers to all files 2023-02-03 15:54:27 -08:00
Johan Brandhorst-Satzkorn f57454b6b9 Rewrite interface{} to any (#2535)
* chore: Rewrite interface{} to any

* Add ignore revs
2022-10-25 19:29:38 -04:00
Jeff Mitchell 4bd249d347 Fix some missing net.JoinHostPort calls (#2305) 2022-07-29 12:08:37 -04:00
Jeff Mitchell 3d9e541930 Switch request.WithContext to request.Clone (#2017)
The Go docs now say to use request.Clone (introduced in Go
1.13) instead of request.WithContext (introduced in Go 1.7) as it deep
copies instead of shallow copies.
2022-04-15 13:28:17 -04:00
Jeff Mitchell 7eb29261b2 Update to go-kms-wrapping version 2, and plugin-based KMS (#1901) 2022-03-16 17:04:07 -04:00
Irena Rindos a6f50e675c fix(api): address base paths containing a v1 were being truncated 2022-02-16 10:15:02 -05:00
Jeff Mitchell 081de3cf79 Migrate sdk/recovery to api/ and sdk/wrapper to internal (#1507)
* `recovery` is only used by the API (and the main module, for decryption)
* `wrapper` is only used by the CLI right now

Moving these brings them closer to the code that uses them, and makes
the SDK package a bit more clear in terms of functionality.
2021-09-07 22:13:19 -04:00
Jeff Mitchell 5b7544c81f Update API against shared libs and sdk 2021-07-14 17:24:06 -07:00
Jeff Mitchell 2cbcf9a563 Update usage of shared-secure-libs (#1393) 2021-07-12 21:06:22 -04:00
Kevin Maris 8a8b2fb8e1 Fix nil TLSClientConfig (#901) 2021-02-02 20:50:30 -05:00
Jeff Mitchell 9de928318d Skip curl output when using automatic versioning and reading (#858)
This makes it so that the actual output is the update/delete.

Fixes #856
2021-01-08 17:30:41 -05:00
Michael GaffneyandJeff Mitchell 94cb79bbdd See how Boundary would look with gofumpt applied (#853)
* See how Boundary would look with https://github.com/mvdan/gofumpt applied

Results of running `gofumpt -w -s .`

* Update tools file and Makefile for gofumpt

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2021-01-07 10:02:32 -05:00
Jim b8c527c6cd handle v1 as a prefix/suffix, not just a cut set to be trimmed (#723) 2020-10-17 19:01:24 -04:00
Jeff Mitchell ba216f894b Update docs and default address 2020-09-25 19:38:53 -04:00
Kent 'picat' Gruber 9e06d7eec2 Fix unused error in *api/client.Client.Do during redirect (#430)
Previously the error declared during the *retryablehttp.Client.Do was being "overshadowed" by the error declared when a redirect was missing the result location.

By declaring the loc outside the call assignment, we can properly "reuse" the error and resulting check after a redirect.
2020-09-24 14:13:25 -04:00
Jeff Mitchell d3606e14b6 Set wrapper on client, not token, so it doesn't fail KMS recovery on update calls 2020-09-21 12:20:44 -04:00
Jeff Mitchell 9b2646eaf9 Fix retry behavior with KMS recovery and misleading error message (#391) 2020-09-21 11:05:44 -04:00
Jeff Mitchell 07a7e9750a Tie together the database-driven session handling with the worker and add relevant CLI comands (#370) 2020-09-19 00:18:17 -04:00
Jeff Mitchell f8237fb945 Move some packages into SDK, out of internal 2020-09-09 01:24:25 -04:00
Jeff Mitchell 36f975a952 Add some recovery KMS functions needed for external clients (#339) 2020-09-09 01:15:29 -04:00
Todd Knight c3ecea172d Generate new version of SDK resources and Add Tests (#331) 2020-09-08 16:27:51 -04:00
Jeff Mitchell c4522aa813 Update host sets and auth system to new paradigm (#319) 2020-09-01 12:31:54 -04:00
Jeff Mitchell 203e2b5dc2 Initial worker porting steps (#232) 2020-08-12 00:40:39 -04:00
Jeff Mitchell 6661117d4c The name. The name. The name! 2020-08-10 17:15:02 -04:00
Jeff Mitchell 908a299ea3 Convert SDK to the new options API (#238) 2020-08-07 12:55:02 -04:00
Jeff Mitchell 995b76bbc5 Fix error that slipped in during review in #206
A strings.LastIndex call check was meant to be `-1` and got
clumsy-fingered to `-11`. This causes panics with API clients.
2020-07-22 13:29:53 -04:00
Jeff Mitchell 388a13b10d Convert scopes to the new paradigm (#206) 2020-07-22 00:14:28 -04:00
Todd Knight 28dbcd84bd Authenticate Handler API and SDK, and much more (#183) 2020-07-14 17:32:47 -04:00
Jeff Mitchell acce195dcb Organizations -> orgs consistency (#189)
* Organizations -> orgs consistency

* Fix up some tests and some mistaken substitutions
2020-07-11 12:00:49 -04:00
c0c6a9b0b8 Handler project (#44)
* Renamed fakeRepo to mockRepo

* Changing around TODOs to capture current plans with the code.

* Remove the repo interface and use a real DB for tests.

* Fixed a few tests.

* Adding checks for properly formatted identifiers.

* Updating code to account for recent merges.  Relaxing some restrictions on what an id can look like.

* Added small comment explaining why RegisterGrpcGatewayer interface exists.

* Move project service up a call level.

Long term I think it would make sense to define these services even higher up the call stack, potentially at the initialization of the controller server, near where the DB is initialized.

* Making these fields align with those in the resources under hosts/...

* Hard code the service initialization in the handler registration code.

* Regenerate project related code proto code.

* Removing type field for project.

* Adds basic project handling in CLI/SDK (#47)

*    Adds SDK for creating and reading projects
*    Reorganizes a bit
*    Adds CLI for creating and reading projects
*    Fixes some some generation bugs
*    Adds redirect support for default org ID

* Fix protobuf import references being moved.

* Update client test to look for "orgs" and "projects" instead of "org" and "project"

* Update expected segments test

* Fix setAddr handling when default organization is in use

* Set client in target after create or read

Co-authored-by: Jim Lambert <jimlambrt@Jims-MBP-3.home>
Co-authored-by: Jim <jlambert@hashicorp.com>
Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2020-05-12 17:35:48 -07:00
Jeff Mitchell c6a9c970b0 Don't require project in generated client requests 2020-05-05 16:32:27 -04:00
Jeff Mitchell 416688448c Project isn't required, so don't require it in the client 2020-05-05 13:32:54 -04:00
Jeff Mitchell 1f3c52f495 Name and addr updates (#26)
* Rename FriendlyName to Name

* Standardize on connection parameters for the server being addr

This syncs up WATCHTOWER_ADDR and -addr (formerly -address) and frees up
-address to be used in resources (which it is).

* Add description fields
2020-05-05 11:19:42 -04:00
Jeff Mitchell 17fffe7c23 Add Response type and decoding (#24)
This may not be the final interface for responses but it is fine to
start.

Fix some bugs, e.g. require an org and project to be set.
2020-05-04 23:02:18 -04:00
Jeff Mitchell 7f03246c6f Add basic API client (#19) 2020-05-04 10:58:03 -04:00