-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'oss/master' into db-cred-rotate
* oss/master: (178 commits) Cut version 0.9.4 Remove netbsd/arm as it won't compile Bump files for new version Update plugins Update go-plugin changelog++ Handling nomad maxTokenNameLength = 64 (#4009) Remove unneeded looping since Go 1.10 cover it already (#4010) Fix test statement with formatting in fatal call Fix PKI tests by generating on-demand Sanitize pem encoding to Go default of a newline at the end rather than break backwards compat Remove now-unneeded PKCS8 code and update certutil tests for Go 1.10 Kick Travis Bump Travis to Go 1.10 Fix bug with vault cli when reading an individual field containing a Printf formatting verb (#4005) Adding path roles test coverage for storing PKIX fields (#4003) Add test coverage for recently-added PKIX fields. (#4002) Fix missing CommonName in subject generation changelog++ Handle missed error case in seal status output format (#4001) ...
- Loading branch information
Showing
723 changed files
with
85,153 additions
and
41,102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ services: | |
- docker | ||
|
||
go: | ||
- 1.9.1 | ||
- "1.10" | ||
|
||
matrix: | ||
allow_failures: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package approle | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/hashicorp/vault/logical" | ||
) | ||
|
||
func TestAppRole_TidyDanglingAccessors(t *testing.T) { | ||
var resp *logical.Response | ||
var err error | ||
b, storage := createBackendWithStorage(t) | ||
|
||
// Create a role | ||
createRole(t, b, storage, "role1", "a,b,c") | ||
|
||
// Create a secret-id | ||
roleSecretIDReq := &logical.Request{ | ||
Operation: logical.UpdateOperation, | ||
Path: "role/role1/secret-id", | ||
Storage: storage, | ||
} | ||
resp, err = b.HandleRequest(context.Background(), roleSecretIDReq) | ||
if err != nil || (resp != nil && resp.IsError()) { | ||
t.Fatalf("err:%v resp:%#v", err, resp) | ||
} | ||
|
||
accessorHashes, err := storage.List(context.Background(), "accessor/") | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
if len(accessorHashes) != 1 { | ||
t.Fatalf("bad: len(accessorHashes); expect 1, got %d", len(accessorHashes)) | ||
} | ||
|
||
entry1, err := logical.StorageEntryJSON( | ||
"accessor/invalid1", | ||
&secretIDAccessorStorageEntry{ | ||
SecretIDHMAC: "samplesecretidhmac", | ||
}, | ||
) | ||
err = storage.Put(context.Background(), entry1) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
entry2, err := logical.StorageEntryJSON( | ||
"accessor/invalid2", | ||
&secretIDAccessorStorageEntry{ | ||
SecretIDHMAC: "samplesecretidhmac2", | ||
}, | ||
) | ||
err = storage.Put(context.Background(), entry2) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
accessorHashes, err = storage.List(context.Background(), "accessor/") | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
if len(accessorHashes) != 3 { | ||
t.Fatalf("bad: len(accessorHashes); expect 3, got %d", len(accessorHashes)) | ||
} | ||
|
||
err = b.tidySecretID(context.Background(), storage) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
accessorHashes, err = storage.List(context.Background(), "accessor/") | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
if len(accessorHashes) != 1 { | ||
t.Fatalf("bad: len(accessorHashes); expect 1, got %d", len(accessorHashes)) | ||
} | ||
} |
Oops, something went wrong.