Commit Graph
65 Commits
Author SHA1 Message Date
Jeff Mitchell 22d5c88a0b Add Output Fields support (#1192) 2021-05-04 20:57:35 -04:00
Jim 8d317023f8 OIDC: make callback URL paths deterministic. (#1188) 2021-05-02 15:25:29 -04:00
Todd Knight 61e236f76d OIDC Callback Error Redirect (#1174) 2021-04-29 14:47:13 -07:00
Jeff Mitchell 7062bc70f0 Fix bug causing CORS to accept all origins by default (#1134) 2021-04-15 13:33:52 -04:00
Jeff Mitchell ca57e50516 Add more OIDC error output. (#1108)
Some of this is in the form of logging, and some via returning error
messages to users.

Also cleans a couple of linter complaints.
2021-04-13 19:07:50 -04:00
dd0f34bc35 Add new OIDC auth method. (#1090)
Co-authored-by: Todd Knight <T.Alan.Knight@gmail.com>
Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
2021-04-08 20:54:32 -04:00
Jeff Mitchell 0993747702 Change server default allowed origin (#931) 2021-02-12 11:04:09 -05:00
Jeff Mitchell e9da3a871d Switch on CORS by default if not specified (#928) 2021-02-11 20:10:48 -05:00
Todd Knight aa4157639c Change Format of API Error (#784)
This is a wire breaking change for json errors since we have removed and renamed a few fields, and changed part of the structure of the returned json error.

* Remove redundant fields in Status, details.error_id, details.TraceId and details.request_id from API errors.

* Added wrapped errors and "ops" field to indicate the internal operation of the errors returned by the API.

* Added error cli error reporting of Op and wrapped errors.
2020-12-07 14:25:16 -07:00
Jeff Mitchell 61e312db47 Add printable checks to request path and name/desc (#740) 2020-10-21 13:07:09 -04:00
Jeff Mitchell dd8973dd9f Move authenticate service into auth method service (#635)
This was always an RPC-only distinction and from that perspective it
makes sense; however it causes the generated docs to treat it as an
entirely separate service even though it's under the same collection
path as auth methods and this is confusing.
2020-10-12 18:03:15 -04:00
Christian Frichot 3940842c4d Remove legacy references to Vault's API (#426) 2020-09-24 12:55:06 -04:00
Todd Knight e937b0ea27 Sessions Read/List/Cancel API and SDK (#369) 2020-09-20 20:22:57 -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
Jim 611288bdc7 basic sessions (#337) 2020-09-16 12:02:02 -04:00
Jeff Mitchell a67d5c8abb When logging urls, also log method 2020-09-16 10:21:35 -04:00
Jeff Mitchell 6201357902 Use scope-specific token DEKs (#342) 2020-09-14 12:30:11 -04:00
Todd Knight 33e7b4538e WorkerCoordination and GetSession API refactoring (#354)
* Possible api changes.

* Worker API update.

* Updating import alias name.

* Moving session down a level as a member of the GetSessionResponse.

* Marshal the auth flag into the GetSessionResponse proto instead of the session.
2020-09-12 21:54:18 -07:00
Jeff Mitchell 2914b4c14c Use base58 for a few more user-facing values (#356) 2020-09-12 21:43:08 -04:00
Jeff Mitchell f8237fb945 Move some packages into SDK, out of internal 2020-09-09 01:24:25 -04:00
Jeff Mitchell f94f21fd97 Update API codes (#336) 2020-09-08 23:57:26 -04:00
Todd Knight 1c2c078e0a Adding Authz checks that support new pathing (#328) 2020-09-04 14:48:11 -07:00
Jeff Mitchell 23156afa11 Add in most of the proxy flow (#326) 2020-09-03 13:24:34 -04:00
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
Todd Knight 0aba6db720 Enable Split Cookies (#318) 2020-09-01 09:23:41 -07: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 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 ac4d9fa311 Add nonce storage and replay prevention test (#293) 2020-08-24 13:22:10 -04:00
Todd Knight c4d3414016 Add Host Set CUDLR handler and SDK (#290) 2020-08-21 10:57:30 -07: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 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
Todd Knight f84991c0f1 Use authenticate and Auth Method repo functions (#242) 2020-08-07 10:18:40 -07:00
Todd Knight b5acf6afdf Connecting the auth method service to the api handler. (#241) 2020-08-06 13:26:55 -07:00
Todd Knight b7bf76a9ba Auth Method API Handler for CRUDL (not updating password specific fields)(#239) 2020-08-06 12:50:20 -07:00
Todd Knight e5ec1f48b2 Account API handler for CRDL operations (#228) 2020-08-05 10:19:55 -07: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 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 388a13b10d Convert scopes to the new paradigm (#206) 2020-07-22 00:14:28 -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
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
Jeff Mitchell 8987d8d435 Separate out ui handler under build tag (#170) 2020-07-07 16:57:54 -07:00
Todd Knight c44a4c4795 Tools for auth token interception and authentication (#152) 2020-07-07 12:14:26 -07: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
Jeff Mitchell 9d1d0ba08e Simplify UI passthrough logic (#148)
I realized we can handle the special case of `/index.html` by ensuring
that `/` does the right thing because that's _also_ standard behavior to
fetch `/index.html`. As a result this allows a lot of simplification.
2020-06-25 15:03:03 -04:00