Commit Graph
351 Commits
Author SHA1 Message Date
Todd Knight 544e78b593 Target Handler and SDK CRUDL & add|set|remove-host-sets methods. (#310) 2020-09-01 15:05:46 -07:00
Todd Knight 24ec9620ca fix: Correct missed name updates to OutgoingInterceptor. 2020-09-01 10:08:18 -07:00
Jeff Mitchell c4522aa813 Update host sets and auth system to new paradigm (#319) 2020-09-01 12:31:54 -04:00
Todd Knight 0aba6db720 Enable Split Cookies (#318) 2020-09-01 09:23:41 -07:00
Jeff Mitchell a4c20164f3 Add add/remove/set hosts functions to host-sets command (#316) 2020-08-31 10:06:21 -04:00
Jim 09112d1e96 refactor and remove kms/common pkg (#315) 2020-08-29 19:06:21 -04:00
Jeff Mitchell 514856c020 Fix broken CLI output 2020-08-28 15:58:15 -04:00
Jeff Mitchell b8c8d29008 Switch ordering of CLI create/update vs static commands (#314) 2020-08-28 13:31:20 -04:00
Jeff Mitchell 1f065316ee Initial (#313) 2020-08-28 01:28:26 -04:00
Jeff Mitchell 20aef738c4 Add host-catalogs CLI command. (#312) 2020-08-28 00:17:09 -04:00
Jeff Mitchell 17ecb6f2ce Separate accounts/host catalogs/host sets into their own packages (#311) 2020-08-27 20:43:33 -04:00
Jeff Mitchell 936c970635 Remove unneeded and breaking test 2020-08-27 18:41:52 -04:00
Jeff Mitchell 28df6eb7b0 Update config encrypt/decrypt CLI command (#309)
This updates the command to our emergent standards. It also enables
using a separate config file for a config kms, which allows non-string
values to be encrypted.

This allowed some nice cleanup as well.
2020-08-27 16:38:44 -04:00
Jeff Mitchell 274afa6b02 Shave off an IAM lookup if the user is the anonymous user (#305)
* Shave off an IAM lookup if the user is the anonymous user

* Fix build

* If authz failures are turned off, make the token type unknown instead of invalid

* Change returned token format when authz failures are disabled

* Change logic back

* Fix logic
2020-08-26 23:28:38 -04:00
Jeff Mitchell b53812a5c1 Add ability to skip automatic auth method creation (#306)
This is useful if you, for instance, want Terraform to be 100%
responsible for creation of resources (outside of the static ones that
cannot be removed or modified, like u_anon). This will mean using the
recovery mechanism for initial setup, but that isn't an issue once TF
supports that :-)
2020-08-26 23:27:46 -04:00
Jeff Mitchell 490be8a7e4 Add ability to skip role creation on scope create (#308)
* Initial work on scope creation skipping

* Fix things
2020-08-26 23:27:25 -04:00
Todd Knight e4da5e9ab5 add|set|remove-hosts for host-sets SDK and API (#304)
* Adding ability to add host set members.

* Adding SDK and API for add|set|remove hosts.
2020-08-26 11:04:26 -07:00
Jim fcb61d4b67 targets repo (#298) 2020-08-26 13:58:46 -04:00
Michael Gaffney 58dec98ea2 Rename table from servers to server (#307) 2020-08-26 13:15:12 -04:00
Michael Gaffney 9ca8a4ec20 Host set members (#301)
* Update host set member test

* Add ListSetMembers method signature and doc

* Move repository methods for host set members to new file

* Add TestSetMembers

* Implement ListSetMembers

* Return hosts from ListSetMembers

* Implement AddSetMembers

* Implement DeleteSetMembers

* Use sql.QueryContext not sql.Query

* Implement SetSetMembers

* Refactor: extract getHosts method

* Refactor: extract createMembers method

* Refactor: extract common functions

* Return correct count of changed

In SetSetMembers, retrieving the current list of hosts in the set
happens after the transaction to modify the set has completed. This
retrieval can result in an error but the number of modified rows is not
effected.

* Make list set members an unexported method

* Get hosts within the same transaction as mutations of the set

* Return hosts of set from LookupSet method

* Return hosts of set from UpdateSet method

* Remove listSetMembers

* Fix merge conflict

* Add NOTE and TODOs about using new pattern in "SetMembers" methods
2020-08-26 12:31:18 -04:00
Jeff Mitchell 39721047e4 Fix CORS test 2020-08-25 12:45:16 -04:00
Michael Gaffney de162c5533 Replace and remove ErrNilParameter with ErrInvalidParameter (#295) 2020-08-25 12:18:14 -04:00
Jeff Mitchell 8f579c75c3 paum -> ampw (#303) 2020-08-25 00:21:08 -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 647d5502b5 Change ListServers to use SeachWhere (#300) 2020-08-24 14:10:41 -04:00
Jeff Mitchell ac4d9fa311 Add nonce storage and replay prevention test (#293) 2020-08-24 13:22:10 -04:00
Randall Morey b9a14d25ac docs: add UI passthrough example to README (#299) 2020-08-24 11:46:25 -04:00
Jeff Mitchell a1490228b8 Add address to worker status tracing 2020-08-21 16:53:47 -04:00
Todd Knight c4d3414016 Add Host Set CUDLR handler and SDK (#290) 2020-08-21 10:57:30 -07:00
Todd Knight e423b6589e Request Validation logic moved into a helper (#296)
* Move all the validation logic into a helper tool.

* Adding tests for verifier helpers.
2020-08-21 08:15:32 -07: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
Michael Gaffney 14dd7b49b2 Add method signatures for host set operations (#291)
* Add method signatures for host set operations

* Rename ReplaceSetMembers to SetSetMembers
2020-08-20 17:53:58 -04:00
Jeff Mitchell 627a353ccb Don't return an empty resource if there was an apiErr (#294) 2020-08-20 17:31:38 -04:00
Michael Gaffney b24fc185a7 Export TestSets helper function (#292) 2020-08-20 15:13:12 -04:00
Michael Gaffney 3a3cdd7219 Static host set repository methods (#289)
* Implement CreateSet

* Implement UpdateSet

* Implement LookupSet

* Implement ListSets

* Implement DeleteSet

* Remove unused parameter from test helper function

* Update to use new kms structure

* Remove unused parameter for test helper function

* Fix resource-type string for host set
2020-08-20 13:56:52 -04:00
Jeff Mitchell b47cca0329 Add (non-db aspects of) the recovery key workflow (#286) 2020-08-20 13:34:03 -04:00
Todd Knight d5678c4f80 Handler for Host CRUDL actions (#287) 2020-08-20 08:20:26 -07:00
Jeff Mitchell 8dad85fef4 Add test.hcl to gitignore 2020-08-20 01:05:57 -04:00
Todd Knight 7474e956dd List Catalogs for Repo and API Handler (#288) 2020-08-19 21:49:52 -07:00
Jeff Mitchell 6bf4a5ce38 Add not null checks to wt_private_id, wt_scope_id, and wt_user_id (#284) 2020-08-19 21:45:46 -04:00
Jim 9570897032 basic keys mgmt repo (#264) 2020-08-19 16:47:18 -04:00
Michael Gaffney a413ad7b84 Static Host: Lookup, List and Delete (#283)
* Implement LookupHost

* Implement ListHosts

* Implement DeleteHost
2020-08-19 14:14:14 -04:00
Todd Knight eaae887bbe Don't require type for children of subtyped resources. (#285) 2020-08-19 10:51:15 -07:00
Jeff Mitchell a11ca2e3a8 Make gen 2020-08-18 21:58:59 -04:00
Todd Knight d86e58476f Version can be passed through request body (#281)
* Scopes inline version into update request body.

* Users inline version into update request body.

* Group inline version into update and add|set|remove member request body.

* Role inline version into update and add|set|remove grant|principal request body.

* Auth method inline version into update request body.

* Auth Account inline version into update request body.

* host catalog version is inlined for update.

* Gen after merge.

* Submitting template changes for version handling.
2020-08-18 17:38:38 -07:00
Jeff Mitchell e20c150617 Fix some tests broken by merge 2020-08-18 19:16:52 -04:00
Jeff Mitchell adfc5681be Auth methods CLI (#277) 2020-08-18 17:46:34 -04:00
Michael Gaffney 041e1f9fd3 Update host (#278)
* Add IsNotNullError function to db package

* Let the database handle default values not gorm

* Implement UpdateHost

* Remove unnecessary clone
2020-08-18 16:50:26 -04:00
Michael Gaffney e18cdc52b3 Create host (#276)
* Change testHostCatalog methods to be like other resource test methods

* Implement CreateHost

* Make allocHost return a pointer to a Host
2020-08-17 17:06:31 -04:00