Commit Graph
69 Commits
Author SHA1 Message Date
Jeff Mitchell 77c837342e Use api/sdk tags 2020-10-07 14:12:10 -04:00
Jeff Mitchell 6993d10118 Update main's api/sdk mods 2020-10-07 14:05:50 -04:00
Jeff Mitchell 5cbfcf8eb6 Shuffle things around out of new modules 2020-10-07 14:03:42 -04:00
Jeff Mitchell 70a8051974 Update mod file 2020-10-07 13:56:11 -04:00
Jeff Mitchell 617921ef65 Bump deps (#522) 2020-10-01 14:49:52 -04:00
Jeff Mitchell 70fa231377 Update dbassert 2020-10-01 13:47:20 -04:00
Jeff Mitchell c1a1f8bb1b Separate out docker dep into package (#482)
This also then removes support for docker-based containing starting (for
now) from platforms other than windows/darwin/linux as there are build
issues on several.
2020-09-28 16:05:15 -04:00
Jeff Mitchell cf3fa4522d Swap base58 libraries (#472)
* Swap base58 libraries

This doesn't reduce binary size but it removes a metric ton of
dependencies.
2020-09-26 14:01:49 -04:00
Jeff Mitchell 446286e251 Bump deps (#435) 2020-09-25 17:09:07 -04:00
Jeff Mitchell 61a0ae02c1 Bring go-alpnmux in house for now 2020-09-25 10:17:12 -04:00
Jeff Mitchell 05c2e38f03 Bump deps (#364)
* Bump deps

* Revert go-kms-wrapping as the vault team broke it :-(
2020-09-16 09:08:46 -04:00
Jeff Mitchell 23156afa11 Add in most of the proxy flow (#326) 2020-09-03 13:24:34 -04:00
Jeff Mitchell 74544f6324 Encrypt tokens on the way out and decrypt on the way in (#302)
* Encrypt tokens on the way out and decrypt on the way in

This isn't a security feature related to tokens specifically; it's so
that we can discard cryptographically bad tokens before we ever hit the
DB. This way we can't pass through a DDoS to the database due to
fetching obviously invalid token values.

I'm using base58 to encode the resulting value as there aren't great
base62 options, and allowing base64 / and + values can hamper usability
by creating copying/highlighting breaks.
2020-08-25 00:20:50 -04:00
Jeff Mitchell bc32272ca7 Update go-retryablehttp, strcase, gorm 2020-08-20 17:59:47 -04:00
Jeff Mitchell 414a2ab2c3 Remove some dead, dead, dead, dead code 2020-08-20 17:58:29 -04:00
Jeff Mitchell b47cca0329 Add (non-db aspects of) the recovery key workflow (#286) 2020-08-20 13:34:03 -04:00
Jim 9570897032 basic keys mgmt repo (#264) 2020-08-19 16:47:18 -04:00
Todd Knight 23b437894a Masks can now update attribute fields. (#271) 2020-08-14 14:08:12 -07:00
Jeff Mitchell 5d104a7a01 Migrate off Vault's internalshared folder to the separated-out repo 2020-08-12 16:12:45 -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 f1b3ad373e Go mod tidy 2020-08-08 10:50:30 -04:00
Michael Gaffney bdb31cf8b5 Bump deps (#245) 2020-08-08 10:49:43 -04:00
Jeff Mitchell f07bb9dae6 Fix breakage after change to template from previous PR 2020-08-07 15:18:44 -04:00
Jeff Mitchell df4730b1a0 Minor fixes and first API test changeover (#243) 2020-08-07 15:01:18 -04:00
Jeff Mitchell 908a299ea3 Convert SDK to the new options API (#238) 2020-08-07 12:55:02 -04:00
Jeff Mitchell c0f3a72bac go mod tidy 2020-07-27 12:01:40 -04:00
Todd Knight f47046f158 Update Watchtower to use grpc-gateway v2 (#204)
* Migration to grpc gateway v2.
2020-07-23 11:26:15 -07:00
Michael Gaffney 799242fce4 Bump deps and run 'make gen' (#212) 2020-07-22 17:00:22 -04:00
Jeff Mitchell dec1f07266 Update deps and make proto 2020-07-20 13:47:27 -04:00
Jeff Mitchell fa5f45260b Bump Vault dep 2020-07-17 15:32:48 -04:00
Todd Knight 28dbcd84bd Authenticate Handler API and SDK, and much more (#183) 2020-07-14 17:32:47 -04:00
Jeff Mitchell 4decf9502a Fix handler test by moving it to a new file with a build tag 2020-07-07 20:42:17 -05:00
Jeff Mitchell 316b250a24 Use dockertest v3 consistently (#167) 2020-07-06 12:41:09 -04:00
Jeff MitchellandRandall Morey 8da4effd5e Add mechanism for bundling UI assets. (#153)
* Add mechanism for bundling UI assets.

The scripts/uigen.sh script will check out the UI repo, build assets,
create a static assets file, and clean up.

The dev Makefile target has been modified to run this script if no
assets file is found. There is also a build-ui target that will
unilaterally update (the dev target only builds if the file isn't found,
but doesn't update).

The handler has been updated to add the default org ID as a header if
the request path is "/".

Co-authored-by: Randall Morey <randall@randallmorey.com>
2020-06-30 11:26:22 -04:00
Michael Gaffney 4f30983c14 Bump deps and run make gen (#115) 2020-06-11 10:08:54 -04:00
Jim 2d18177c9d oplog support for null field updates (#107) 2020-06-10 06:56:46 -04:00
Todd Knight 2c3fbe3024 Invalid Argument errors provide per field details. (#110)
* Invalid Argument errors now return a per field error message.

* Creating an API error struct.

* SDK uses field error details proto.

* Adding tests specifically for handler helper error messages resulting in expected API output.

* Inlining the error checks into the table driven tests.  Use protocmp for assertions to make printing out diffs easier to parse.

* Aggregate the invalid argument fields detected to be wrong.

* Make the returned order of fields deterministic in the error details..

* Fixing formatting issue in errors_test.go.

* Test to confirm unimplemented results in a 405 and not 404.
2020-06-09 10:51:50 -07:00
Jim 1048673171 update dbassert dep (#100) 2020-06-02 12:07:00 -04:00
Jim 55be1f4931 Revert "updated dbassert dep (#98)" (#99)
This reverts commit 628f98d344.
2020-06-02 10:58:25 -04:00
Jim 628f98d344 updated dbassert dep (#98) 2020-06-02 10:16:56 -04:00
Jim 9feb280536 wrapper for dbasserts (#94) 2020-06-02 08:59:40 -04:00
Jeff Mitchell 31ef4a65ac Bump deps and make gen 2020-05-29 11:21:12 -04:00
Jim aa64579a8c db timestamp guards (#70) 2020-05-27 17:35:04 -04:00
Jeff Mitchell 8d5a987859 Bump g-k-w dep 2020-05-21 15:35:57 -04:00
Jeff Mitchell fafdcbbfa4 CORS support (#73)
This adds per-listener CORS support. Logic is ported from Vault, along with a fully new test suite.
2020-05-21 12:12:08 -04:00
Jeff Mitchell 66978d637a Fix tools bootstrap 2020-05-21 10:38:07 -04:00
Jeff Mitchell 8cd322bd17 Bump Vault dep 2020-05-19 18:20:18 -04:00
Jeff Mitchell 3157fd0e5f Bump deps 2020-05-19 15:14:26 -04:00
7f0dfa2344 Fix Update Project Logic (#54)
* carve out scope into a separate branch for a PR

* refactor getOpts to be private

* narrowed to just the scope proto

* wrap in a transaction

* remove user from scopes PR

* make scope type immutable

* refactored with more referential integrity (thanks mike)

* refactor based on pair programming with Mike

* better VetForWrite that supports db.Options but that requires GetOpts and Options to be exported.

* stop printing out all the db logs

* refactor withScope to be private

* refactor the VetForWrite a bit based on Todd's PR comment

* fix typo

Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>

* fix ctx propagation and Scope returns

* fix ctx propagation and use a const for std retry count

* change Std to Crud

* fix ctx propagation

* make sure update with field masks doesn't update a field not in the mask and force a read after update.

* add description

* remove comment about future

* clean error strings

* clean up enum string rep

* stdMeta

* fix return value to be just nil

* fix returns and errors

* update test to match new error string

* change len of domain to 24

* provide common function for new public ids

* use common db.NewPublicId() and provide the correct prefix

* move list out of CrudActions and provide a CrudlActions shortcut as well

* some comments about the purpose of VetForWrite()

* move to random 10

* Adding project API interface.

* Creation of Project handler and Tests

* Move to using the iam objects.

* Setting up testify framework for mocking and assertions.

* Fix iam options typo references.

* Adding tests for CreateProject and UpdateProject.

This also adds some additional argument validation.

* Merging in PR 40

* 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

* Adding functionality and tests for update masks.

* Additional tests for update.  Disable update non existant project test.

* Make not providing an update mask be an invalid argument.

* Make empty update mask paths and no mutable fields in the path an InvalidArgument error.

* Fix get Project test.

* Adding back in the Update a non existant project test case.

* Adding seperate path structured tests.

* Attach an issue id to field mask validation TODO.

* Generate Project Update SDK code (#58)

* Created the UpdateFunction method.

* Regenerate protobuf derived code since pull #50 updated dependencies.

* Special case IDs to not be passed for updates.

* Updated the tools file since imports reordered it.

* Add spaces between each tools import/comment grouping.

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-19 12:10:39 -07:00