Documentation ¶
Index ¶
- Constants
- type AccessLevel
- type Action
- type ActionData
- type ActionDefinition
- type ActionResourceType
- type ConditionKey
- type Definitions
- func (d *Definitions) GetActionData(action Action) []*ActionData
- func (d *Definitions) GetActions(input *GetActionsInput) []Action
- func (d *Definitions) GetServiceDefinition(prefix string) *ServiceDefinition
- func (d *Definitions) Save(filename string, gzipFile bool) error
- func (d *Definitions) ServicePrefixes() []string
- type Effect
- type ExternalIDCondition
- type GetActionsInput
- type PolicyDocument
- type PricipalValue
- type Principal
- type Resource
- type ResourceType
- type ServiceDefinition
- type Statement
- type StatementValue
Constants ¶
View Source
const (
BaseURL = "https://docs.aws.amazon.com/service-authorization/latest/reference"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessLevel ¶ added in v0.0.11
type AccessLevel string
const ( AccessLevelWrite AccessLevel = "Write" AccessLevelRead AccessLevel = "Read" AccessLevelTagging AccessLevel = "Tagging" AccessLevelPermissionsManagement AccessLevel = "Permissions management" AccessLevelList AccessLevel = "List" )
type ActionData ¶ added in v0.0.11
type ActionDefinition ¶
type ActionResourceType ¶
type ConditionKey ¶
type Definitions ¶
type Definitions struct {
// contains filtered or unexported fields
}
func NewDefinitionFromReference ¶
func NewDefinitionFromReference() (*Definitions, error)
func NewDefinitions ¶
func NewDefinitions() (*Definitions, error)
func NewDefinitionsFromFS ¶
func (*Definitions) GetActionData ¶ added in v0.0.11
func (d *Definitions) GetActionData(action Action) []*ActionData
GetActionData gets details about an IAM Action
func (*Definitions) GetActions ¶
func (d *Definitions) GetActions(input *GetActionsInput) []Action
func (*Definitions) GetServiceDefinition ¶ added in v0.0.11
func (d *Definitions) GetServiceDefinition(prefix string) *ServiceDefinition
func (*Definitions) ServicePrefixes ¶
func (d *Definitions) ServicePrefixes() []string
type ExternalIDCondition ¶ added in v0.0.20
type ExternalIDCondition struct { StringEquals struct { StsExternalID string `json:"sts:ExternalId"` } `json:"StringEquals"` }
func ConvertToExternalIDCondition ¶ added in v0.0.20
func ConvertToExternalIDCondition(rawCondition []byte) (*ExternalIDCondition, error)
type GetActionsInput ¶
type GetActionsInput struct { ServicePrefix string AccessLevel AccessLevel ResourceTypeName string // * => wildcard arns only NamePattern string // supports wildcards: '*', '?' }
type PolicyDocument ¶
type PolicyDocument struct { ID string `json:"Id,omitempty"` Version string `json:"Version"` Statements []Statement `json:"Statement"` }
func ConvertToPolicyDocument ¶
func ConvertToPolicyDocument(encoded string) (*PolicyDocument, error)
type PricipalValue ¶
func (*PricipalValue[T]) UnmarshalJSON ¶
func (value *PricipalValue[T]) UnmarshalJSON(b []byte) error
type ResourceType ¶
type ServiceDefinition ¶
type ServiceDefinition struct { Name string Prefix string AuthorizationURL string Actions map[string]*ActionDefinition ResourceTypes map[string]*ResourceType ConditionKeys map[string]*ConditionKey }
type Statement ¶
type Statement struct { Sid string `json:"Sid,omitempty"` // statement ID, service specific Effect Effect `json:"Effect"` // Allow or Deny Principal PricipalValue[Principal] `json:"Principal,omitempty"` // principal that is allowed or denied NotPrincipal PricipalValue[Principal] `json:"NotPrincipal,omitempty"` // exception to a list of principals Action StatementValue[Action] `json:"Action"` // allowed or denied action NotAction StatementValue[Action] `json:"NotAction,omitempty"` // matches everything except Resource StatementValue[Resource] `json:"Resource,omitempty"` // object or objects that the statement covers NotResource StatementValue[Resource] `json:"NotResource,omitempty"` // matches everything except Condition json.RawMessage `json:"Condition,omitempty"` // conditions for when a policy is in effect }
type StatementValue ¶
type StatementValue[T ~string] []T
AWS allows string or []string as value, we convert everything to []T to avoid casting
func (*StatementValue[T]) UnmarshalJSON ¶
func (value *StatementValue[T]) UnmarshalJSON(b []byte) error
Click to show internal directories.
Click to hide internal directories.