283 Commits

Author SHA1 Message Date
Caleb Tennis
1621f5e405 This adds a new error class which can be used by logical backends to
specify more concrete error cases to make their way back up the stack.

Over time there is probably a cleaner way of doing this, but that's
looking like a more massive rewrite and this solves some issues in
the meantime.

Use a CodedError to return a more concrete HTTP return code for
operations you want to do so.  Returning a regular error leaves
the existing behavior in place.
2015-08-10 13:27:25 -04:00
Nate Brown
74013ac751 Fixing key-status if audit logging is on 2015-06-24 10:57:05 -07:00
Armon Dadgar
81df0d6e49 vault: allow increment to be duration string. Fixes #340 2015-06-17 15:58:20 -07:00
Armon Dadgar
fa9c85dbaf vault: create upgrade path in HA mode 2015-05-28 16:43:15 -07:00
Armon Dadgar
7e1f7d8c1c vault: prevent raw access to protected paths 2015-05-28 10:24:41 -07:00
Armon Dadgar
ba66058408 vault: more logging around rotate 2015-05-27 17:56:55 -07:00
Armon Dadgar
0fa3e06cde vault: adding sys/key-status and sys/rotate 2015-05-27 17:53:42 -07:00
Armon Dadgar
b1dc1bb0ce vault: Adding more logging 2015-05-15 17:19:32 -07:00
Armon Dadgar
9f577b39b4 Replace VaultID with LeaseID for terminology simplification 2015-04-08 13:35:32 -07:00
Mitchell Hashimoto
65159bd9c8 logical/framework: make help look nicer 2015-04-03 21:00:23 -07:00
Armon Dadgar
10f6308ab9 vault: TODO cleanups 2015-04-01 22:13:08 -07:00
Armon Dadgar
8d11e10892 vault: Adding the raw/ endpoints to sys 2015-04-01 17:45:00 -07:00
Armon Dadgar
ceeebcb5b7 vault: Simpify token checking logic 2015-04-01 14:03:17 -07:00
Armon Dadgar
657f847790 vault: Adding sys/ paths to enable/disable audit backends 2015-03-31 16:45:08 -07:00
Mitchell Hashimoto
d93bdacbbd vault: require root token for seal 2015-03-31 09:59:02 -07:00
Mitchell Hashimoto
32d603d0ae vault: add seal to the sys backend 2015-03-31 09:36:13 -07:00
Mitchell Hashimoto
77e35fd5f4 logical: move cred stuff over here 2015-03-30 17:46:18 -07:00
Armon Dadgar
200bc60e71 vault: Support policy CRUD 2015-03-23 14:43:31 -07:00
Armon Dadgar
972fc8238b vault: implement the sys/auth* endpoints 2015-03-20 12:48:19 -07:00
Mitchell Hashimoto
e6ab3a3771 vault: clean up VaultID duplications, make secret responses clearer
/cc @armon - This is a reasonably major refactor that I think cleans up
a lot of the logic with secrets in responses. The reason for the
refactor is that while implementing Renew/Revoke in logical/framework I
found the existing API to be really awkward to work with.

Primarily, we needed a way to send down internal data for Vault core to
store since not all the data you need to revoke a key is always sent
down to the user (for example the user than AWS key belongs to).

At first, I was doing this manually in logical/framework with
req.Storage, but this is going to be such a common event that I think
its something core should assist with. Additionally, I think the added
context for secrets will be useful in the future when we have a Vault
API for returning orphaned out keys: we can also return the internal
data that might help an operator.

So this leads me to this refactor. I've removed most of the fields in
`logical.Response` and replaced it with a single `*Secret` pointer. If
this is non-nil, then the response represents a secret. The Secret
struct encapsulates all the lease info and such.

It also has some fields on it that are only populated at _request_ time
for Revoke/Renew operations. There is precedent for this sort of
behavior in the Go stdlib where http.Request/http.Response have fields
that differ based on client/server. I copied this style.

All core unit tests pass. The APIs fail for obvious reasons but I'll fix
that up in the next commit.
2015-03-19 23:11:42 +01:00
Mitchell Hashimoto
813873b115 vault: convert to new callback style 2015-03-19 15:05:22 +01:00
Mitchell Hashimoto
801260bf0f vault: TODOs 2015-03-17 20:54:38 -05:00
Mitchell Hashimoto
a65f6544e0 vault: use RWMutex on MountTable itself 2015-03-17 20:39:45 -05:00
Armon Dadgar
5bcd5ac389 vault: Support sys/revoke-prefix/ 2015-03-16 16:33:48 -07:00
Armon Dadgar
68457c9b2d vault: Adding sys/revoke 2015-03-16 16:26:34 -07:00
Armon Dadgar
770ac11c30 vault: Test renew of bad ID 2015-03-16 16:14:53 -07:00
Armon Dadgar
93b7508dee vault: Testing sys/renew 2015-03-16 16:11:55 -07:00
Mitchell Hashimoto
52a7c8bf11 vault: change to /sys/mounts 2015-03-16 10:52:35 -07:00
Mitchell Hashimoto
920938a862 http: /v1/sys/mount endpoint 2015-03-16 10:36:43 -07:00
Mitchell Hashimoto
1be431df51 vault: system using the framework 2015-03-15 17:35:59 -07:00
Mitchell Hashimoto
69f62d8872 vault: rename SystemBackend2 to SystemBackend 2015-03-15 14:54:49 -07:00
Mitchell Hashimoto
9b42fe3c99 vault: convert to logical.Request and friends 2015-03-15 14:53:41 -07:00
Mitchell Hashimoto
4811f2453b vault: convert system to logical.Backend 2015-03-15 14:42:05 -07:00