mirror of
https://github.com/hashicorp/vault.git
synced 2025-11-29 14:41:09 +01:00
Fixing printf (and similar) issues (#2666)
This commit is contained in:
parent
bf9ef7c302
commit
f80c851681
@ -104,7 +104,7 @@ func TestAppRole_RoleConstraints(t *testing.T) {
|
|||||||
roleData["bind_secret_id"] = false
|
roleData["bind_secret_id"] = false
|
||||||
resp, err = b.HandleRequest(roleReq)
|
resp, err = b.HandleRequest(roleReq)
|
||||||
if resp != nil && resp.IsError() {
|
if resp != nil && resp.IsError() {
|
||||||
t.Fatalf("resp:%#v", err, resp)
|
t.Fatalf("err:%v, resp:%#v", err, resp)
|
||||||
}
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatalf("expected an error")
|
t.Fatalf("expected an error")
|
||||||
@ -433,7 +433,7 @@ func TestAppRole_RoleSecretIDAccessorReadDelete(t *testing.T) {
|
|||||||
hmacReq.Operation = logical.ReadOperation
|
hmacReq.Operation = logical.ReadOperation
|
||||||
resp, err = b.HandleRequest(hmacReq)
|
resp, err = b.HandleRequest(hmacReq)
|
||||||
if resp != nil && resp.IsError() {
|
if resp != nil && resp.IsError() {
|
||||||
t.Fatalf("error response:%#v", err, resp)
|
t.Fatalf("err:%v resp:%#v", err, resp)
|
||||||
}
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatalf("expected an error")
|
t.Fatalf("expected an error")
|
||||||
|
|||||||
@ -352,7 +352,7 @@ func (b *backend) nonLockedSecretIDStorageEntry(s logical.Storage, roleNameHMAC,
|
|||||||
|
|
||||||
if persistNeeded {
|
if persistNeeded {
|
||||||
if err := b.nonLockedSetSecretIDStorageEntry(s, roleNameHMAC, secretIDHMAC, &result); err != nil {
|
if err := b.nonLockedSetSecretIDStorageEntry(s, roleNameHMAC, secretIDHMAC, &result); err != nil {
|
||||||
return nil, fmt.Errorf("failed to upgrade role storage entry", err)
|
return nil, fmt.Errorf("failed to upgrade role storage entry %s", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -249,17 +249,18 @@ func TestBackend_pathIam(t *testing.T) {
|
|||||||
|
|
||||||
// generate a second role, ensure we're able to list both
|
// generate a second role, ensure we're able to list both
|
||||||
data["bound_ami_id"] = "ami-abcd123"
|
data["bound_ami_id"] = "ami-abcd123"
|
||||||
resp, err = b.HandleRequest(&logical.Request{
|
secondRole := &logical.Request{
|
||||||
Operation: logical.CreateOperation,
|
Operation: logical.CreateOperation,
|
||||||
Path: "role/MyOtherRoleName",
|
Path: "role/MyOtherRoleName",
|
||||||
Data: data,
|
Data: data,
|
||||||
Storage: storage,
|
Storage: storage,
|
||||||
})
|
}
|
||||||
|
resp, err = b.HandleRequest(secondRole)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
if resp != nil && resp.IsError() {
|
if resp != nil && resp.IsError() {
|
||||||
t.Fatalf("failed to create additional role: %s")
|
t.Fatalf("failed to create additional role: %v", *secondRole)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err = b.HandleRequest(&logical.Request{
|
resp, err = b.HandleRequest(&logical.Request{
|
||||||
|
|||||||
@ -400,7 +400,7 @@ func (c *ConfigEntry) DialLDAP() (*ldap.Conn, error) {
|
|||||||
}
|
}
|
||||||
conn, err = ldap.DialTLS("tcp", net.JoinHostPort(host, port), tlsConfig)
|
conn, err = ldap.DialTLS("tcp", net.JoinHostPort(host, port), tlsConfig)
|
||||||
default:
|
default:
|
||||||
retErr = multierror.Append(retErr, fmt.Errorf("invalid LDAP scheme in url %q"))
|
retErr = multierror.Append(retErr, fmt.Errorf("invalid LDAP scheme in url %q", net.JoinHostPort(host, port)))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|||||||
@ -48,7 +48,7 @@ func (c *CredentialsConfig) GenerateCredentialChain() (*credentials.Credentials,
|
|||||||
SecretAccessKey: c.SecretKey,
|
SecretAccessKey: c.SecretKey,
|
||||||
SessionToken: c.SessionToken,
|
SessionToken: c.SessionToken,
|
||||||
}})
|
}})
|
||||||
case c.AccessKey == "" && c.AccessKey == "":
|
case c.AccessKey == "" && c.SecretKey == "":
|
||||||
// Attempt to get credentials from the IAM instance role below
|
// Attempt to get credentials from the IAM instance role below
|
||||||
|
|
||||||
default: // Have one or the other but not both and not neither
|
default: // Have one or the other but not both and not neither
|
||||||
|
|||||||
@ -248,7 +248,7 @@ func (lm *LockManager) getPolicyCommon(req PolicyRequest, lockType bool) (*Polic
|
|||||||
|
|
||||||
case KeyType_ECDSA_P256:
|
case KeyType_ECDSA_P256:
|
||||||
if req.Derived || req.Convergent {
|
if req.Derived || req.Convergent {
|
||||||
return nil, nil, false, fmt.Errorf("key derivation and convergent encryption not supported for keys of type %s", KeyType_ECDSA_P256)
|
return nil, nil, false, fmt.Errorf("key derivation and convergent encryption not supported for keys of type %v", KeyType_ECDSA_P256)
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@ -95,7 +95,7 @@ func TestRouter_Mount(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if v := r.MatchingStorageView("prod/aws/foo"); v != view {
|
if v := r.MatchingStorageView("prod/aws/foo"); v != view {
|
||||||
t.Fatalf("bad: %s", v)
|
t.Fatalf("bad: %v", v)
|
||||||
}
|
}
|
||||||
|
|
||||||
if path := r.MatchingMount("stage/aws/foo"); path != "" {
|
if path := r.MatchingMount("stage/aws/foo"); path != "" {
|
||||||
@ -103,7 +103,7 @@ func TestRouter_Mount(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if v := r.MatchingStorageView("stage/aws/foo"); v != nil {
|
if v := r.MatchingStorageView("stage/aws/foo"); v != nil {
|
||||||
t.Fatalf("bad: %s", v)
|
t.Fatalf("bad: %v", v)
|
||||||
}
|
}
|
||||||
|
|
||||||
mount, prefix, ok := r.MatchingStoragePrefix("logical/foo")
|
mount, prefix, ok := r.MatchingStoragePrefix("logical/foo")
|
||||||
|
|||||||
@ -2173,7 +2173,7 @@ func (ts *TokenStore) tokenStoreRoleCreateUpdate(
|
|||||||
}
|
}
|
||||||
resp.AddWarning(fmt.Sprintf(
|
resp.AddWarning(fmt.Sprintf(
|
||||||
"Given explicit max TTL of %d is greater than system/mount allowed value of %d seconds; until this is fixed attempting to create tokens against this role will result in an error",
|
"Given explicit max TTL of %d is greater than system/mount allowed value of %d seconds; until this is fixed attempting to create tokens against this role will result in an error",
|
||||||
entry.ExplicitMaxTTL.Seconds(), sysView.MaxLeaseTTL().Seconds()))
|
int64(entry.ExplicitMaxTTL.Seconds()), int64(sysView.MaxLeaseTTL().Seconds())))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user