117 Commits

Author SHA1 Message Date
Jeff Mitchell
8054cc660f Update to api 1.0.1 and sdk 0.1.8 2019-04-15 14:10:07 -04:00
Jeff Mitchell
278bdd1f4e
Switch to go modules (#6585)
* Switch to go modules

* Make fmt
2019-04-13 03:44:06 -04:00
Jeff Mitchell
550e92a5ec Fix build breakages 2019-04-12 22:01:13 -04:00
Jeff Mitchell
7ae6fb56ff Move policyutil to sdk 2019-04-12 18:08:46 -04:00
Jeff Mitchell
cf03949594 Move cidrutil to sdk 2019-04-12 18:03:59 -04:00
Jeff Mitchell
170521481d
Create sdk/ and api/ submodules (#6583) 2019-04-12 17:54:35 -04:00
Jeff Mitchell
c0739a0f23
Add more perf standby guards (#6149) 2019-02-01 16:56:57 -05:00
Jeff Mitchell
47d339fce1 Revert "Refactor common token fields and operations into a helper (#5953)"
This reverts commit 66c226c593bb1cd48cfd8364ac8510cb42b7d67a.
2019-02-01 11:23:40 -05:00
Jeff Mitchell
66c226c593
Refactor common token fields and operations into a helper (#5953) 2019-01-30 16:23:28 -05:00
Jim Kalafut
a54603039d Run goimports across the repository (#6010)
The result will still pass gofmtcheck and won't trigger additional
changes if someone isn't using goimports, but it will avoid the
piecemeal imports changes we've been seeing.
2019-01-08 16:48:57 -08:00
Brian Kassouf
7ab4cc5bda
Update path_role.go (#5820) 2018-11-19 13:40:36 -08:00
Becca Petrin
fb89af7cfa
Run all builtins as plugins (#5536) 2018-11-06 17:21:24 -08:00
Calvin Leung Huang
f63bcdf106
Call wg.Add(1) outside of goroutine (#5716) 2018-11-06 16:36:13 -08:00
Jeff Mitchell
a58d313d2b
Batch tokens (#755) 2018-10-15 12:56:24 -04:00
Becca Petrin
7776f46ee7
Make builtin auth and secret plugins buildable (#5456) 2018-10-09 09:29:20 -07:00
Brian Kassouf
690ad83aae
Fix approle tidy on performance standbys (#5338)
* Fix approle tidy on performance standbys

* Forward PKI and AWS also
2018-09-17 09:53:23 -07:00
Jeff Mitchell
fe309723c9
Add the ability to specify token CIDR restrictions on secret IDs. (#5136)
Fixes #5034
2018-08-21 11:54:04 -04:00
Jeff Mitchell
2335958260
Update path_tidy_user_id_test.go 2018-07-25 03:37:24 -04:00
Jeff Mitchell
fb94d03b75 Fix race in test 2018-07-25 00:18:32 -04:00
Jeff Mitchell
77e61243d0 Modify approle tidy to validate dangling accessors (#4981) 2018-07-24 14:00:53 -07:00
Jeff Mitchell
9003041ef2 Log nil secret IDs instead of swallowing error 2018-07-23 17:46:20 -04:00
Jeff Mitchell
0eebc77263 Fix test 2018-07-12 08:29:04 -04:00
Jeff Mitchell
a831fb4c5a Make single-lease revocation behave like expiration (#4883)
This change makes it so that if a lease is revoked through user action,
we set the expiration time to now and update pending, just as we do with
tokens. This allows the normal retry logic to apply in these cases as
well, instead of just erroring out immediately. The idea being that once
you tell Vault to revoke something it should keep doing its darndest to
actually make that happen.
2018-07-11 15:45:35 -04:00
Becca Petrin
b3a711d717 Add bound cidrs to tokens in AppRole (#4680) 2018-06-19 22:57:11 -04:00
Vishal Nayak
e0c65213a7
return 404 when role does exist on update operations (#4778) 2018-06-18 09:29:05 -04:00
Jeff Mitchell
f493d2436e
Add an idle timeout for the server (#4760)
* Add an idle timeout for the server

Because tidy operations can be long-running, this also changes all tidy
operations to behave the same operationally (kick off the process, get a
warning back, log errors to server log) and makes them all run in a
goroutine.

This could mean a sort of hard stop if Vault gets sealed because the
function won't have the read lock. This should generally be okay
(running tidy again should pick back up where it left off), but future
work could use cleanup funcs to trigger the functions to stop.

* Fix up tidy test

* Add deadline to cluster connections and an idle timeout to the cluster server, plus add readheader/read timeout to api server
2018-06-16 18:21:33 -04:00
Vishal Nayak
0c83eae6fb
Fix panic due to metadata being nil (#4719)
* Fix panic due to metadata being nil

* added a nil check

* Added a test

* ensure metadata is never nil

* Remove unnecessary allocation

* revert back to early initialization
2018-06-11 11:22:26 -04:00
Jeff Mitchell
e1a89e0d55
Some atomic cleanup (#4732)
Taking inspiration from
https://github.com/golang/go/issues/17604#issuecomment-256384471
suggests that taking the address of a stack variable for use in atomics
works (at least, the race detector doesn't complain) but is doing it
wrong.

The only other change is a change in Leader() detecting if HA is enabled
to fast-path out. This value never changes after NewCore, so we don't
need to grab the read lock to check it.
2018-06-09 15:35:22 -04:00
Vishal Nayak
818218637c approle: Fix role name case sensitivity issue 2018-06-05 18:53:27 -04:00
Vishal Nayak
977171dbbe
approle: Make invalid role_id a 400 error instead of 500 (#4470)
* make invalid role_id a 400 error

* remove single-use validateCredentials function

* remove single-use validateBindSecretID function

* adjust the error message for CIDR check failure

* locking updates as review feedback
2018-05-04 10:15:16 -04:00
vishalnayak
a030db2af8 s/enable_local_secret_ids/local_secret_ids 2018-04-24 17:52:42 -04:00
vishalnayak
3c49d7b480 remove unneeded comments 2018-04-24 16:28:25 -04:00
vishalnayak
419e70c1e2 refactor to be able to defer lock.Unlock() 2018-04-24 16:17:24 -04:00
vishalnayak
417b004697 fix typo 2018-04-24 16:03:18 -04:00
vishalnayak
3f92d9c8ca remove unneeded setting of secret ID prefix 2018-04-24 15:55:40 -04:00
vishalnayak
33256ab446 Add field read test 2018-04-24 15:48:07 -04:00
vishalnayak
0962457bc8 Fix api path for reading the field 2018-04-24 14:28:03 -04:00
vishalnayak
42e95d4630 Add tests 2018-04-24 11:02:11 -04:00
vishalnayak
f39f4052a1 Add immutability test 2018-04-24 10:05:17 -04:00
vishalnayak
83aabbba05 Add enable_local_secret_ids to role read response 2018-04-24 09:53:36 -04:00
vishalnayak
20c7f20265 error on enable_local_secret_ids update after role creation 2018-04-23 17:05:53 -04:00
vishalnayak
b929187362 naming changes 2018-04-23 16:52:09 -04:00
vishalnayak
184dac8cfc Upgrade secret ID prefix and fix tests 2018-04-23 16:31:51 -04:00
vishalnayak
3d7e704f3f segregate local and non-local accessor entries 2018-04-23 16:19:05 -04:00
vishalnayak
52efa5e608 Fix the tidy operation to consider both local and non-local secretID cleanups 2018-04-23 16:02:55 -04:00
vishalnayak
4ee66b5958 fix path regex and role storage 2018-04-23 14:08:30 -04:00
vishalnayak
f8055c8e06 add prefix to LocalStorage 2018-04-23 14:08:30 -04:00
vishalnayak
953c7fbeca local secret IDs 2018-04-23 14:08:30 -04:00
Vishal Nayak
e2bb2ec3b9
Errwrap everywhere (#4252)
* package api

* package builtin/credential

* package builtin/logical

* package command

* package helper

* package http and logical

* package physical

* package shamir

* package vault

* package vault

* address feedback

* more fixes
2018-04-05 11:49:21 -04:00
Chris Hoffman
def6e525be
Fix a few missing TTL core changes (#4265)
* Fix missing ttl handling in backends

* fix test
2018-04-04 06:43:21 -04:00