accessmanagement

package
v0.0.0-...-2575faf Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package accessmanagement for access management

Index

Constants

View Source
const (
	PolicyV20220721 PolicyVersionString = "2022-07-21"

	PolicyACLType PolicyTypeString = "ACL"

	PolicyTrustIdentityType PolicyTypeString = "PTI"
)

Variables

View Source
var (
	// ErrAccessManagementUnsupportedBuilder is returned wether the builder is unsupported.
	ErrAccessManagementUnsupportedBuilder = errors.Join(errors.New("accessmanagement: unsupported builder"), core.ErrCodeUnsupportedFeature)
	// ErrAccessManagementUnsupportedDataType is returned wether the data type is not supported.
	ErrAccessManagementUnsupportedDataType = errors.Join(errors.New("accessmanagement: unsupported data type"), core.ErrCodeUnsupportedDataType)
	// ErrAccessManagementInvalidDataType is returned wether the data type is invalid.
	ErrAccessManagementInvalidDataType = errors.Join(errors.New("accessmanagement: invalid data type"), core.ErrCodeInvalidDataType)
	// ErrAccessManagementUnsupportedSyntax is returned wether the string implement an unsupported syntax.
	ErrAccessManagementUnsupportedSyntax = errors.Join(errors.New("accessmanagement: unsupported syntax"), core.ErrCodeBadSyntax)
	// ErrAccessManagementInvalidARN is returned wether the action string is invalid or unsupported.
	ErrAccessManagementInvalidARN = errors.Join(errors.New("accessmanagement: invalid or unsupported uur syntax"), core.ErrCodeBadSyntax)
	// ErrAccessManagementInvalidAction is returned wether the action string is invalid or unsupported.
	ErrAccessManagementInvalidAction = errors.Join(errors.New("accessmanagement: invalid or unsupported action syntax"), core.ErrCodeBadSyntax)
	// ErrAccessManagementUnsupportedVersion is returned wether required version is not supported.
	ErrAccessManagementUnsupportedVersion = errors.Join(errors.New("accessmanagement: unsupported version"), core.ErrCodeUnsupportedVersion)
	// ErrAccessManagementJSONSchemaValidation is returned wether the json schema validation failed.
	ErrAccessManagementJSONSchemaValidation = errors.Join(errors.New("accessmanagement: json schema validation failed"), core.ErrCodeJSONSchemaValidation)
)

Functions

This section is empty.

Types

type ACLPolicy

type ACLPolicy struct {
	Policy
	Label       PolicyLabelString `json:"Label,omitempty"`
	Description string            `json:"Description,omitempty"`
	Permit      []PolicyStatement `json:"Permit,omitempty"`
	Forbid      []PolicyStatement `json:"Forbid,omitempty"`
}

type ARNString

type ARNString core.WildcardString

func (ARNString) IsValid

func (a ARNString) IsValid(version PolicyVersionString) (bool, error)

func (ARNString) Parse

func (a ARNString) Parse(version PolicyVersionString) (*UUR, error)

type Action

type Action struct {
	Resource core.WildcardString
	Action   core.WildcardString
}

type ActionString

type ActionString core.WildcardString

func (ActionString) IsValid

func (a ActionString) IsValid(version PolicyVersionString) (bool, error)

func (ActionString) Parse

func (a ActionString) Parse(version PolicyVersionString) (*Action, error)

type PermissionsEngine

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

func NewPermissionsEngine

func NewPermissionsEngine() (*PermissionsEngine, error)

func (*PermissionsEngine) BuildPermissions

func (d *PermissionsEngine) BuildPermissions(bData []byte) (*PermissionsState, error)

type PermissionsState

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

func (*PermissionsState) AllowACLPolicyStatements

func (b *PermissionsState) AllowACLPolicyStatements(policyStatements []PolicyStatement) error

func (*PermissionsState) DenyACLPolicyStatements

func (b *PermissionsState) DenyACLPolicyStatements(policyStatements []PolicyStatement) error

type Policy

type Policy struct {
	Version PolicyVersionString `json:"Version"`
	Type    PolicyTypeString    `json:"Type"`
}

type PolicyLabelString

type PolicyLabelString string

PolicyLabelString represents a valid policy label

func (PolicyLabelString) IsValid

func (p PolicyLabelString) IsValid(version PolicyVersionString) (bool, error)

type PolicyStatement

type PolicyStatement struct {
	Label     PolicyLabelString `json:"Label,omitempty"`
	Actions   []ActionString    `json:"Actions"`
	Resources []ARNString       `json:"Resources"`
}

type PolicyTypeString

type PolicyTypeString string

PolicyTypeString represents a valid policy type

func (PolicyTypeString) IsValid

func (p PolicyTypeString) IsValid(version PolicyVersionString) (bool, error)

type PolicyVersionString

type PolicyVersionString string

PolicyVersionString represents a valid policy version

func (PolicyVersionString) IsValid

func (p PolicyVersionString) IsValid() bool

type UUR

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

Jump to

Keyboard shortcuts

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