2015-04-01 02:21:02 +00:00
|
|
|
package http
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/hashicorp/vault/vault"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestSysRevoke(t *testing.T) {
|
|
|
|
core, _, token := vault.TestCoreUnsealed(t)
|
|
|
|
ln, addr := TestServer(t, core)
|
|
|
|
defer ln.Close()
|
|
|
|
TestServerAuth(t, addr, token)
|
|
|
|
|
|
|
|
resp := testHttpPut(t, addr+"/v1/sys/revoke/secret/foo/1234", nil)
|
|
|
|
testResponseStatus(t, resp, 204)
|
|
|
|
}
|
2015-04-01 02:23:32 +00:00
|
|
|
|
|
|
|
func TestSysRevokePrefix(t *testing.T) {
|
|
|
|
core, _, token := vault.TestCoreUnsealed(t)
|
|
|
|
ln, addr := TestServer(t, core)
|
|
|
|
defer ln.Close()
|
|
|
|
TestServerAuth(t, addr, token)
|
|
|
|
|
|
|
|
resp := testHttpPut(t, addr+"/v1/sys/revoke-prefix/secret/foo/1234", nil)
|
|
|
|
testResponseStatus(t, resp, 204)
|
|
|
|
}
|