"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "builtin/credential/aws/backend_test.go" between
vault-1.8.1.tar.gz and vault-1.8.2.tar.gz

About: vault is a tool for secrets management, encryption as a service, and privileged access management.

backend_test.go  (vault-1.8.1):backend_test.go  (vault-1.8.2)
skipping to change at line 1132 skipping to change at line 1132
Operation: logical.UpdateOperation, Operation: logical.UpdateOperation,
Storage: storage, Storage: storage,
Path: "config/client", Path: "config/client",
Data: clientConfig, Data: clientConfig,
}) })
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
} }
// Configure additional metadata to be returned for ec2 logins.
identity := map[string]interface{}{
"ec2_metadata": []string{"instance_id", "region", "ami_id
"},
}
// store the identity
_, err = b.HandleRequest(context.Background(), &logical.Request{
Operation: logical.UpdateOperation,
Storage: storage,
Path: "config/identity",
Data: identity,
})
if err != nil {
t.Fatal(err)
}
loginInput := map[string]interface{}{ loginInput := map[string]interface{}{
"pkcs7": pkcs7, "pkcs7": pkcs7,
"nonce": "vault-client-nonce", "nonce": "vault-client-nonce",
} }
parsedIdentityDoc, err := b.parseIdentityDocument(context.Backgro und(), storage, pkcs7) parsedIdentityDoc, err := b.parseIdentityDocument(context.Backgro und(), storage, pkcs7)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
skipping to change at line 1244 skipping to change at line 1260
t.Fatal(err) t.Fatal(err)
} }
if resp == nil || resp.Auth == nil || resp.IsError() { if resp == nil || resp.Auth == nil || resp.IsError() {
t.Fatalf("bad: failed to login: resp:%#v\nerr:%v", resp, err) t.Fatalf("bad: failed to login: resp:%#v\nerr:%v", resp, err)
} }
// Attempt to re-login with the identity signature // Attempt to re-login with the identity signature
delete(loginInput, "pkcs7") delete(loginInput, "pkcs7")
loginInput["identity"] = identityDoc loginInput["identity"] = identityDoc
loginInput["signature"] = identityDocSig loginInput["signature"] = identityDocSig
resp, err = b.HandleRequest(context.Background(), loginRequest) resp, err = b.HandleRequest(context.Background(), loginRequest)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
if resp == nil || resp.Auth == nil || resp.IsError() { if resp == nil || resp.Auth == nil || resp.IsError() {
t.Fatalf("bad: failed to login: resp:%#v\nerr:%v", resp, err) t.Fatalf("bad: failed to login: resp:%#v\nerr:%v", resp, err)
} }
// verify the presence of instance_id in the response object. // verify the presence of instance_id in the response object.
instanceID := resp.Auth.Metadata["instance_id"] instanceID := resp.Auth.Metadata["instance_id"]
 End of changes. 2 change blocks. 
0 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)