Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Client: Gatekeeper wasn't merged correctly; fix dockerfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
nemosupremo committed Sep 2, 2016
1 parent c75d624 commit 928e2c8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
vault
vault-gatekeeper-mesos
vltgatekeeper
.DS_Store
.minimesos/
dist/builds/
dist/release/
.git/
File renamed without changes.
17 changes: 14 additions & 3 deletions gatekeeper/gatekeeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 928e2c8

Please sign in to comment.