diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6c68bfa --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +vault +vault-gatekeeper-mesos +vltgatekeeper +.DS_Store +.minimesos/ +dist/builds/ +dist/release/ +.git/ \ No newline at end of file diff --git a/dockerfile/Dockerfile b/Dockerfile similarity index 100% rename from dockerfile/Dockerfile rename to Dockerfile diff --git a/gatekeeper/gatekeeper.go b/gatekeeper/gatekeeper.go index c1203f9..1947758 100644 --- a/gatekeeper/gatekeeper.go +++ b/gatekeeper/gatekeeper.go @@ -162,10 +162,21 @@ func (c *Client) requestPermToken(tempToken string) (string, error) { return "", err } - cubbyholeSecret := &cubbyholeSecret{} - if err := json.NewDecoder(vaultResp.Body).Decode(cubbyholeSecret); err != nil { + var vaultWrappedResp vaultWrappedResponse + + if err := json.NewDecoder(vaultResp.Body).Decode(&vaultWrappedResp); err != nil { + return "", err + } + + secretResp := struct { + Auth struct { + ClientToken string `json:"client_token"` + } `json:"auth"` + }{} + + if err := vaultWrappedResp.Unwrap(&secretResp); err != nil { return "", err } - return cubbyholeSecret.Data.WrappedSecret.Token, nil + return secretResp.Auth.ClientToken, nil }