Skip to content

Commit

Permalink
Merge pull request #438 from fuller-inc/migrate-to-goat
Browse files Browse the repository at this point in the history
migrate to shogo82148/goat
  • Loading branch information
shogo82148 authored Oct 19, 2022
2 parents 7b24365 + a295d0f commit e0e13c2
Show file tree
Hide file tree
Showing 27 changed files with 73 additions and 2,520 deletions.
4 changes: 2 additions & 2 deletions provider/assume-role/assume-role.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ func (h *Handler) assumeRole(ctx context.Context, nextIDFormat bool, idToken *gi
var tags []types.Tag
if req.RoleSessionTagging {
if idToken != nil {
// Get the information from the id token if it's avaliable.
// Get the information from the id token if it's available.
// They are more trustworthy because they are digitally signed.
subject := idToken.Subject
if req.UseNodeID {
Expand All @@ -400,7 +400,7 @@ func (h *Handler) assumeRole(ctx context.Context, nextIDFormat bool, idToken *gi
tags = []types.Tag{
{
Key: aws.String("Audience"),
Value: aws.String(sanitizeTagValue(idToken.Audience)),
Value: aws.String(sanitizeTagValue(idToken.Audience[0])),
},
{
Key: aws.String("Subject"),
Expand Down
9 changes: 6 additions & 3 deletions provider/assume-role/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os"
"strings"

"github.com/fuller-inc/actions-aws-assume-role/provider/assume-role/github/oidc"
"github.com/shogo82148/goat/oidc"
)

const (
Expand Down Expand Up @@ -59,11 +59,14 @@ func NewClient(httpClient *http.Client) (*Client, error) {
httpClient = http.DefaultClient
}

oidcClient, err := oidc.NewClient(httpClient, oidcIssuer)
oidcClient, err := oidc.NewClient(&oidc.ClientConfig{
Doer: httpClient,
Issuer: oidcIssuer,
UserAgent: githubUserAgent,
})
if err != nil {
return nil, err
}

return &Client{
baseURL: apiBaseURL,
httpClient: httpClient,
Expand Down
51 changes: 0 additions & 51 deletions provider/assume-role/github/jwk/base64.go

This file was deleted.

181 changes: 0 additions & 181 deletions provider/assume-role/github/jwk/ecdsa.go

This file was deleted.

Loading

0 comments on commit e0e13c2

Please sign in to comment.