28 lines
624 B
Go
28 lines
624 B
Go
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)
|
|
}
|
|
|
|
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)
|
|
}
|