Commit Graph

27 Commits

Author SHA1 Message Date
vishalnayak
f59a69bc52 Remove Unix() invocations on 'time.Time' objects and removed conversion of time to UTC 2016-07-08 18:30:18 -04:00
vishalnayak
116e2cf024 Fix framework rollback manager tests 2016-05-14 19:35:36 -04:00
Jeff Mitchell
bde65134e6 Adjust framework unit tests for new LeaseExtend 2016-01-29 19:31:37 -05:00
Jeff Mitchell
45e32756ea WriteOperation -> UpdateOperation 2016-01-08 13:03:03 -05:00
Jeff Mitchell
e7f2a54720 Rejig Lease terminology internally; also, put a few JSON names back to their original values 2015-08-20 22:27:01 -07:00
Jeff Mitchell
97112665e8 Internally refactor Lease/LeaseGracePeriod into TTL/GracePeriod 2015-08-20 18:00:51 -07:00
Caleb Tennis
d8d76a5304 Add a validation step in field data to error more quickly vs. allowing panics to happen when we go to get the data and convert it 2015-08-11 12:34:14 -04:00
Armon Dadgar
dcb45874bf logical/framework: adding a new duration type to convert to seconds 2015-06-17 15:56:26 -07:00
Armon Dadgar
daf94d6721 logical/framework: allow the lease max to come from existing lease 2015-06-17 14:24:12 -07:00
Mitchell Hashimoto
9af81182f0 logical/framework: secret lease tests 2015-04-13 15:18:27 -07:00
Mitchell Hashimoto
0822286acb logical/framework: AuthRenew callback, add LeaseExtend
/cc @armon - Going with this "standard library" of callbacks approach
to make extending leases in a customizable way easy. See the docs/tests
above.
2015-04-11 14:46:09 -07:00
Mitchell Hashimoto
e56b16b6d7 logical/framework: support root help 2015-04-03 20:36:47 -07:00
Armon Dadgar
67bffd5f14 logical/framework: automatically anchor 2015-04-01 17:53:02 -07:00
Mitchell Hashimoto
26583fb05f logical/framework: auto-extend leases if requested 2015-03-21 16:20:30 +01:00
Mitchell Hashimoto
c872e0f788 logical/framework: rollback should return error, easier API 2015-03-21 11:08:13 +01:00
Mitchell Hashimoto
c9e64725d7 logical/framework: rollback needs to have access to request for storage 2015-03-21 11:03:59 +01:00
Mitchell Hashimoto
2ce92edd0f logical/framework: can specify InternalData for secret 2015-03-20 17:59:48 +01: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
163bfa62a6 logical/framework: support renew 2015-03-19 20:20:57 +01:00
Mitchell Hashimoto
b54dc20aff logical/framework: revoke support 2015-03-19 19:41:41 +01:00
Mitchell Hashimoto
b5757ae49a logical/framework: add methods to look up secret and gen response 2015-03-19 14:59:01 +01:00
Mitchell Hashimoto
ef56daa3bc logical/framework: use custom request wrapper 2015-03-19 14:39:25 +01:00
Mitchell Hashimoto
f4cc32e126 logical/framework: test for minimum age 2015-03-17 20:42:35 -05:00
Mitchell Hashimoto
56fb620b2d logical/framework: only rollback old enough WAL entries 2015-03-17 20:39:46 -05:00
Mitchell Hashimoto
93f828ec0d logical/framework: WAL entry supports "kind" 2015-03-17 20:39:46 -05:00
Mitchell Hashimoto
e77f79b317 logical/framework: rollback support 2015-03-17 20:39:46 -05:00
Mitchell Hashimoto
12566c645c logical/framework, logical/testing 2015-03-15 16:39:49 -07:00