Skip to content

Commit

Permalink
refactor: ♻️ rename internal struct
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesChung committed Apr 10, 2023
1 parent df57365 commit 83eee5d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/util/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"github.com/JamesChung/cprl/pkg/client"
)

type credentials struct {
AccessKeyID string `json:"sessionId"`
SecretAccessKey string `json:"sessionKey"`
SessionToken string `json:"sessionToken"`
type sessionCredentials struct {
SessionID string `json:"sessionId"`
SessionKey string `json:"sessionKey"`
SessionToken string `json:"sessionToken"`
}

func GetCredentials(profile string) (aws.Credentials, error) {
Expand Down Expand Up @@ -149,10 +149,10 @@ func StringifyCredentials(creds aws.Credentials) (string, error) {
}

func StringifySessionCredentials(creds aws.Credentials) (string, error) {
b, err := json.Marshal(credentials{
AccessKeyID: creds.AccessKeyID,
SecretAccessKey: creds.SecretAccessKey,
SessionToken: creds.SessionToken,
b, err := json.Marshal(sessionCredentials{
SessionID: creds.AccessKeyID,
SessionKey: creds.SecretAccessKey,
SessionToken: creds.SessionToken,
})
if err != nil {
return "", err
Expand Down

0 comments on commit 83eee5d

Please sign in to comment.