weed

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSPolicyPermissionStatement

type AWSPolicyPermissionStatement struct {
	Effect   string         `json:"Effect"`
	Action   ArrayOfStrings `json:"Action"`
	Resource ArrayOfStrings `json:"Resource"`
}

type ArrayOfStrings

type ArrayOfStrings []string

func (*ArrayOfStrings) UnmarshalJSON

func (aos *ArrayOfStrings) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

type AwsService

type AwsService struct {
	// contains filtered or unexported fields
}

func NewAwsService

func NewAwsService(profile string) (service AwsService, err error)

func (AwsService) RolePermissions

func (svc AwsService) RolePermissions(roleArn string) (permissions []string, err error)

type Client

type Client struct {
	AwsService AwsService
}

func New

func New(profile string) (client Client, err error)

func (*Client) Find

func (c *Client) Find(desiredPermissions []string, iamRole string) (weed Weed, err error)

type IIamClient

type IIamClient interface {
	ListRolePolicies(ctx context.Context, params *iam.ListRolePoliciesInput, optFns ...func(*iam.Options)) (*iam.ListRolePoliciesOutput, error)
	GetRolePolicy(ctx context.Context, params *iam.GetRolePolicyInput, optFns ...func(*iam.Options)) (*iam.GetRolePolicyOutput, error)
	ListAttachedRolePolicies(ctx context.Context, params *iam.ListAttachedRolePoliciesInput, optFns ...func(*iam.Options)) (*iam.ListAttachedRolePoliciesOutput, error)
	GetPolicy(ctx context.Context, params *iam.GetPolicyInput, optFns ...func(*iam.Options)) (*iam.GetPolicyOutput, error)
	GetPolicyVersion(ctx context.Context, params *iam.GetPolicyVersionInput, optFns ...func(*iam.Options)) (*iam.GetPolicyVersionOutput, error)
}

type PolicyPermission

type PolicyPermission struct {
	Version   string                         `json:"Version"`
	Statement []AWSPolicyPermissionStatement `json:"Statement"`
}

type Weed

type Weed struct {
	Missing     []string
	Unnecessary []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL