Commit Graph
234 Commits
Author SHA1 Message Date
Todd Knight e943220468 Add Delete Password Accounts to repo. (#220) 2020-07-28 09:06:50 -07:00
Michael Gaffney 76abd4f3b4 Update comments to use "base type" instead of "abstract" (#222) 2020-07-28 09:17:23 -04:00
Todd Knight a0bed2b5d7 Truncate instead of round timestamps so our tests that require a time to pass can succeed. (#224) 2020-07-28 08:59:09 -04:00
Todd Knight 25514fb553 Fix a failing test due to time resolutions mismatch. (#221)
* Round generated expiration timestamps to the nearest second.
2020-07-27 14:06:59 -07:00
Jeff Mitchell 194db3a6d8 make proto 2020-07-27 15:14:21 -04:00
Jeff Malnick 62e2d6cce1 docs: add domain model docs (#218) 2020-07-27 10:59:08 -07:00
Jeff Mitchell c0f3a72bac go mod tidy 2020-07-27 12:01:40 -04:00
Jeff Malnick ccb19caf1e test: add ability to run tests in ci as status checks (#219) 2020-07-24 20:37:44 -07:00
Jeff Malnick 4fa8c5415b docs: add docs site outline with placeholder files (#215) 2020-07-24 15:10:34 -07:00
Todd Knight 37d8f78091 Lookup and List Repo Methods for Password Auth Accounts (#216) 2020-07-24 11:38:27 -07:00
Michael Gaffney 7897c1cf52 Add base resources for password authentication (#213)
* Add base SQL and protobuf files

* Add options and public Ids

* Add AuthMethod and Account resources

* Add repository

* Add CreateAuthMethod to repository

* Add CreateAccount method to repository

* Remove redundant foreign keys

* Document relationships between iam and auth tables

* Document relationships between auth and auth_password tables

* Add documentation for subtype triggers

* Use wt_scope_id domain type for scope_id

* Refactor: move test helper function

* Remove check from SetTableName

* Remove check from another SetTableName

* Use org scope in tests

* Remove handling of CreateTime and UpdateTime from docs
2020-07-24 10:23:35 -04:00
Michael Gaffney e03a0ff9d7 Simplify SetTableName pattern (#214) 2020-07-23 17:58:41 -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
Todd Knight 6de1f7ee16 Auth Token Read/List/Delete handler and Go SDK (#199)
* Creating Auth Token Get List and Delete API.
2020-07-23 09:53:37 -07:00
Jeff Mitchell 65dc095fbc Remove another duplicated entry 2020-07-22 21:45:58 -04:00
Jeff Mitchell b1937c3b18 Remove duplicated inject tag statement in Makefile 2020-07-22 21:38:30 -04:00
Todd Knight ed05652729 Add Handlers for Add/Set/Remove Group Members (#209)
* Adding members to groups.

* Adding Group membership handler and API methods.

* Adding custom methods to permision actions list.
2020-07-22 15:10:21 -07:00
Michael Gaffney 799242fce4 Bump deps and run 'make gen' (#212) 2020-07-22 17:00:22 -04:00
Todd Knight 078376da07 Fixing some errors. 2020-07-22 12:30:58 -07:00
Jeff Mitchell e8325a9f59 Don't rely on token for scopes collection actions (#210)
Don't rely on token for scopes collection actions

This requires `scope_id` to be passed (via query param) for actions on
the scopes collection; that is, listing or creating. However, it removes
the dependency on using the token for the scope of the command. For
actions on a specific scope, we use the given ID to determine the scope
we should be operating at, doing a lookup if necessary.

Existing tests have been updated. Of particular note, the CORS test was
already operating on the scopes collection so served as a good test to
ensure that from an API level the scope_id parameter was being parsed
and passed through (the tests fail without adding that query parameter
in).
2020-07-22 15:10:44 -04:00
Jeff Mitchell 2bbc1163c4 Save the entire token, not just the ID (#211)
This allows us to use the token's scope to set the default scope for an
action in the client instead of relying on env vars.
2020-07-22 15:02:58 -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
Michael Gaffney ebf69bbd27 Fix error string for lookupAfterWrite (#208)
The following error string was the end result of an error in lookupAfterWrite:
  `set password configuration: update: lookup error lookup after write: failed record not found`

The error string with this change applied would be:
  `set password configuration: update: lookup after write: record not found`
2020-07-20 17:20:22 -04:00
Todd KnightandJeff Mitchell 168ae3a726 Create MaskManager to guarantee wire/storage update mask consistency (#121)
* Feature: Create MaskManager logic to handle project -> scope update mask logic.

* Updating resource protos and services to use new mask manager setup.

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2020-07-20 11:17:09 -07:00
Jeff Mitchell 982693d8f5 Update tests 2020-07-20 13:52:16 -04:00
Jeff Mitchell dec1f07266 Update deps and make proto 2020-07-20 13:47:27 -04:00
Jim c83e90ed38 implement SetTableName patttern that allows table name to be set back to the default for the storage type. (#196) 2020-07-17 16:20:56 -04:00
Jeff Mitchell fa5f45260b Bump Vault dep 2020-07-17 15:32:48 -04:00
Todd Knight 5bb13e71fe Include Principals and Grants on Roles When Updating the Role. (#203) 2020-07-17 09:31:10 -07:00
Jeff Mitchell 99653727bb Migrate grants to more structured output (#194) 2020-07-16 22:18:27 -04:00
Jeff Mitchell 1a1d3058c9 Move verification to a shared package (#197)
* Move verification to a shared package

The verifier is constructed at HTTP request time and added to the
context. It can then be called from appropriate handlers with
standardized error handling after all the routing.

I intentionally did not add to the handlers yet as I am a good distance
into the scope updates and didn't want to cause even more merge
conflicts. So at the moment authz is again disabled, but once the scope
updates are done, this will be integrated back in.
2020-07-16 22:12:26 -04:00
Jeff Escalante 1514ee1e27 add website template (#200) 2020-07-16 11:57:02 -07:00
Todd Knight 5826bf42fd Fixing api test cases. (#201) 2020-07-16 10:54:24 -07:00
Jim 4dfc41514b refactor direct sql into query.go (#192) 2020-07-15 13:32:36 -04:00
Jim 1bebe7a261 Convert option db.WithVersion to *uint32 (#195) 2020-07-15 13:12:15 -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
Jim e1afed75ff fix dbMask and role tests... (#188)
* fix up tests.

* case sensitive dbMask
2020-07-10 20:44:00 -04:00
Todd KnightandJeff Mitchell 847ca1cc78 Grant management added to Roles API and SDK (#185)
* Adding grants related methods to Roles.

* Adding grants back after the merge of Principals.

* Adding tests for Grant related custom methods.

* Improving api handler methods.

* Fixing tests and sdk field.

* Adding todos for adding principals and grants to List and Update Role responses.

* Fix up Set* tests and fix SetPrincipals bug.

* Making AddPrincipals and RemovePrincipals similar to the tests for AddGrants and RemoveGrants.

* Add JSON grants to output (#187)

I also changed canonical_grants to grants_canonical and used
grants_json. I believe that when members are simply different formats of
other members this is the preferred way to have it in the API. Let me
know if you disagree and we can dig in more.

* Regenerate the API role resource.

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2020-07-10 17:42:47 -07:00
JimandJeff Mitchell 260703febe add group member capabilities (#178)
* add group member capabilities

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2020-07-10 19:01:23 -04:00
Jeff MitchellandJim Lambert c657e4b9fc Fix test broken through various merges (#186)
Co-authored-by: Jim Lambert <jlambert@hashicorp.com>
2020-07-10 18:59:39 -04:00
Jeff Mitchell f30d4d08ef Pass grant scope ID through API handlers (#184) 2020-07-10 17:56:33 -04:00
bcdcaffa6f Port over 162 and 165 to master (#176)
Co-authored-by: Jim Lambert <jlambert@hashicorp.com>
Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
2020-07-10 15:46:26 -04:00
Todd KnightandJeff Mitchell 1ddc59f81e Adding principal custom methods to roles handler. (#180)
* Adding Add/Set/Remove principals API calls.

* Add SDK custom methods.

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2020-07-10 11:21:11 -07:00
Jim 136e923583 make iam_role scope_id immutable (#179) 2020-07-10 10:22:38 -04:00
Jeff Mitchell 732c07126d Introduce global scope (#168)
Introduce the global scope, which holds some resources that don't necessarily belong at either the org or project level.
2020-07-08 17:20:20 -04:00
Jim 6c1b45f7f5 add principal roles (users and groups) to iam (#163) 2020-07-08 17:02:01 -04:00
Todd Knight beea32b8c8 Fixing test that was missed with PR #171. (#175) 2020-07-08 16:55:37 -04:00
Todd Knight 2ce9affeea Don't use repo to check impossible token requests and repo doesn't return error on token value mismatch. (#171)
* Remove error when tokens mismatch from public id but log returned errors from repo.
2020-07-08 09:09:09 -07:00