Skip to content

Commit

Permalink
Add String() to PolicyDocument
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrisker committed Jun 16, 2022
1 parent 35af8a3 commit 8e73563
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/aws/policy_document.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ func (p *PolicyDocument) IsActionAllowed(wanted string) bool {
return false
}

func (p PolicyDocument) String() string {
res, err := json.Marshal(p)
if err != nil {
return fmt.Sprintf("Error marshalling policy document: %v", err)
}
return string(res)
}

func updateAssumeRolePolicyPrincipals(policy string, role *iam.Role) (string, bool, error) {
oldPolicy, err := url.QueryUnescape(aws.StringValue(role.AssumeRolePolicyDocument))
if err != nil {
Expand Down

0 comments on commit 8e73563

Please sign in to comment.