aws

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolValue

func BoolValue(x *bool) bool

func Int64Value

func Int64Value(x *int64) int64

func StringValue

func StringValue(x *string) string

Types

type AnyOrList

type AnyOrList struct {
	Item *Item   `@@`
	List []*Item `| "[" @@ ( ( "," @@ )* )? "]"`
}

type AwsParser

type AwsParser struct {
	Trace bool
	// contains filtered or unexported fields
}

func NewAwsPolicyParser

func NewAwsPolicyParser(policyText string, escaped bool) (*AwsParser, error)

func (*AwsParser) GetPolicy

func (a *AwsParser) GetPolicy() ([]*policy.Policy, error)

func (*AwsParser) Json

func (a *AwsParser) Json() ([]byte, error)

func (*AwsParser) Parse

func (a *AwsParser) Parse() error

func (*AwsParser) WriteJson

func (a *AwsParser) WriteJson(filename string) error

type AwsPolicy

type AwsPolicy struct {
	Block *Block `"{" @@ "}"`
}

type Block

type Block struct {
	Properties []*BlockProperty `@@ (("," @@)*)?`
	// contains filtered or unexported fields
}

func (*Block) GetProperty

func (b *Block) GetProperty(key string) *BlockProperty

type BlockProperty

type BlockProperty struct {
	Key   string     `@String ":"`
	Value BlockValue `@@`
}

type BlockStatement

type BlockStatement struct {
	Statement []*Statement `"[" "{" @@ "}" ( ( "," "{" @@ "}" )* )? "]"`
}

type BlockString

type BlockString struct {
	String string `@String`
}

type BlockValue

type BlockValue interface {
	// contains filtered or unexported methods
}

type Condition

type Condition struct {
	ConditionList []*ConditionList `"{" @@ ( ( (",") @@ )* )? "}"`
}

type ConditionList

type ConditionList struct {
	Operation    *string         `@String ":"`
	KeyValueList []*KeyValueList `"{" @@ ( ( "," @@)*)? "}"`
}

type Elements

type Elements struct {
	Sid          *string    `"Sid" ":" @String`
	Effect       *string    `| "Effect" ":" @String`
	Principal    *Principal `| "Principal" ":" @@`
	NotPrincipal *Principal `| "NotPrincipal" ":" @@`
	Action       *AnyOrList `| "Action" ":" @@`
	NotAction    *AnyOrList `| "NotAction" ":" @@`
	Resource     *AnyOrList `| "Resource" ":" @@`
	NotResource  *AnyOrList `| "NotResource" ":" @@`
	Condition    *Condition `| "Condition" ":" @@`
}

type Item

type Item struct {
	Any bool    `@("*")`
	One *string `| @String`
}

type KeyValueList

type KeyValueList struct {
	Key   *string    `@String ":"`
	Value *ValueList `@@`
}

type Principal

type Principal struct {
	Any  bool             `@("*")`
	List []*PrincipalList `| "{" @@ ( ("," @@ )* )? "}"`
}

type PrincipalList

type PrincipalList struct {
	Aws       *AnyOrList `"AWS" ":" @@`
	Federated *AnyOrList `| "Federated" ":" @@`
	Canonical *AnyOrList `| "CanonicalUser" ":" @@`
	Service   *AnyOrList `| "Service" ":" @@`
}

type Statement

type Statement struct {
	Elements []*Elements `@@ ("," @@)*`
}

type Value

type Value struct {
	OneString *string `@String`
	OneNumber *int64  `| @Int`
	BoolTrue  *bool   `| @"true"`
	BoolFalse *bool   `| @"false"`
}

type ValueList

type ValueList struct {
	One  *Value   `@@`
	List []*Value `| "[" @@ ( ("," @@ )* )? "]"`
}

Jump to

Keyboard shortcuts

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