Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

AWS polish #117

Merged
merged 36 commits into from
Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
58b8906
Implement configdir package to handle location of configuration files
jpcoenen Aug 27, 2019
49c7397
Implement new credentials.Creator interface
jpcoenen Aug 27, 2019
2a96e57
Remove unused function
jpcoenen Aug 27, 2019
f2fafdf
Use readKey() in UseKey()
jpcoenen Aug 27, 2019
3408dbf
Use a custom Reader interface for reading credentials
jpcoenen Aug 27, 2019
9adb23a
Move finding default credentials to Client
jpcoenen Aug 27, 2019
0a18f68
Handle cases where no passphrase is given
jpcoenen Aug 27, 2019
30a1b0f
Fix tests
jpcoenen Aug 27, 2019
c214dbc
Add GoDoc to configdir package
mackenbach Aug 27, 2019
f6f2d76
Add godoc to WithConfigDir option
mackenbach Aug 27, 2019
25755ca
Add/improve godoc for credential readers
mackenbach Aug 27, 2019
12df21a
Add package godoc for credentials package
mackenbach Aug 27, 2019
7e47dfd
Add/amend comments for credential creators
mackenbach Aug 27, 2019
6d1d24b
Add/improve secrethub.Client godoc
mackenbach Aug 27, 2019
231e49d
Add godoc for Client.DefaultCredential
mackenbach Aug 27, 2019
27e6a00
Run gofmt
mackenbach Aug 27, 2019
ca1e134
Let configdir.Dir implement Stringer interface
jpcoenen Aug 27, 2019
6dd978e
Extract setting options on Client to separate function
jpcoenen Aug 27, 2019
99a643e
Initialize ConfigDir to nil
jpcoenen Aug 27, 2019
bd89778
Remove readKey() in favour of already existing ImportKey()
jpcoenen Aug 27, 2019
fba9d15
Rearrange functions for clarity and remove duplication
jpcoenen Aug 27, 2019
e2d6d28
Make function clearer
jpcoenen Aug 27, 2019
4400bc8
Export error for non-existing credential file
jpcoenen Aug 27, 2019
11f0cda
Set filemode to previously used defaults
jpcoenen Aug 27, 2019
8a84569
Fix missing/wrong comments
jpcoenen Aug 27, 2019
0e84a45
Use bytes functions instead of strings
jpcoenen Aug 27, 2019
a035e0b
Add missing comments
jpcoenen Aug 27, 2019
b399490
Merge remote-tracking branch 'origin/feature/aws-integration-merge' i…
SimonBarendse Aug 28, 2019
9a15196
Rename encodeCredentialPartsToString => encodeCredentialParts
SimonBarendse Aug 28, 2019
7191415
Change encodeCredentialParts test to expect bytes
SimonBarendse Aug 28, 2019
d909589
Make path in configdir private
jpcoenen Aug 28, 2019
737803b
Retry getting passphrase if none is provided
jpcoenen Aug 28, 2019
06bbef3
Combine Fingerprint and Verifier in Export method
SimonBarendse Aug 28, 2019
c3e4ef9
Rename Export() to Encode() for keys
jpcoenen Aug 28, 2019
72be34a
Fix incorrect comment
jpcoenen Aug 28, 2019
c2bfdd3
Merge pull request #120 from secrethub/feature/verifier-export
jpcoenen Aug 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/secrethub/credentials/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type EncodableCredential interface {
type encodedCredential struct {
// Raw is the raw credential string.
// Populated when you Parse a credential.
Raw string
Raw []byte
// Header is the decoded first part of the credential string.
Header map[string]interface{}
// RawHeader is the first part of the credential string, encoded as json.
Expand Down Expand Up @@ -168,8 +168,8 @@ func newParser(decoders []Decoder) parser {
}

// parse parses a credential string.
func (p parser) parse(raw string) (*encodedCredential, error) {
parts := strings.Split(raw, ".")
func (p parser) parse(raw []byte) (*encodedCredential, error) {
parts := strings.Split(string(raw), ".")
SimonBarendse marked this conversation as resolved.
Show resolved Hide resolved
if len(parts) != 2 {
return nil, ErrInvalidNumberOfCredentialSegments(len(parts))
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/secrethub/credentials/encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func TestParser(t *testing.T) {
"valid_rsa": {
raw: raw,
expected: &encodedCredential{
Raw: raw,
Raw: []byte(raw),
Header: header,
RawHeader: headerBytes,
Payload: payload,
Expand All @@ -138,7 +138,7 @@ func TestParser(t *testing.T) {
"valid_rsa_encrypted": {
raw: rawEncrypted,
expected: &encodedCredential{
Raw: rawEncrypted,
Raw: []byte(rawEncrypted),
Header: headerEncrypted,
RawHeader: headerEncryptedBytes,
Payload: payload,
Expand Down Expand Up @@ -209,7 +209,7 @@ func TestParser(t *testing.T) {
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
// Act
actual, err := parser.parse(tc.raw)
actual, err := parser.parse([]byte(tc.raw))

// Assert
assert.Equal(t, err, tc.err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/secrethub/credentials/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func readKey(credentialReader, passphraseReader Reader) (Key, error) {
if err != nil {
return Key{}, err
}
encoded, err := defaultParser.parse(string(bytes))
encoded, err := defaultParser.parse(bytes)
if err != nil {
return Key{}, err
}
Expand Down