roleauth

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package roleauth authorizes AWS-service-initiated calls against the customer role the service acts as.

Index

Constants

View Source
const (
	PrincipalStates    = "states.amazonaws.com"
	PrincipalEvents    = "events.amazonaws.com"
	PrincipalScheduler = "scheduler.amazonaws.com"
	PrincipalPipes     = "pipes.amazonaws.com"
	PrincipalFirehose  = "firehose.amazonaws.com"
	PrincipalLogs      = "logs.amazonaws.com"
	PrincipalIoT       = "iot.amazonaws.com"
	PrincipalSNS       = "sns.amazonaws.com"
	PrincipalS3        = "s3.amazonaws.com"
	PrincipalRDS       = "rds.amazonaws.com"
	PrincipalLambda    = "lambda.amazonaws.com"
)

Service principals documented as the trusted principal of each service's execution role.

Variables

View Source
var (
	// ErrNotAssumable means the service principal may not assume the role.
	ErrNotAssumable = errors.New("role cannot be assumed by the service")
	// ErrAccessDenied means the role's policies do not allow the action.
	ErrAccessDenied = errors.New("AccessDeniedException")
)

Functions

func Authorize

func Authorize(a Authorizer, servicePrincipal, roleArn, action, resource string) error

Authorize is a nil-safe call: a nil Authorizer allows everything (enforcement off).

func AuthorizeResource

func AuthorizeResource(a Authorizer, servicePrincipal, action, resource, sourceARN string) error

AuthorizeResource is nil-safe; an Authorizer without resource-policy support allows everything.

func ResourcePolicyAction

func ResourcePolicyAction(arn string) (string, bool)

ResourcePolicyAction maps a destination ARN to the action a service principal needs on it.

func TargetAction

func TargetAction(targetARN string) (string, bool)

TargetAction maps a rule/schedule/pipe target ARN to the IAM action its execution role needs.

Types

type Authorizer

type Authorizer interface {
	AuthorizeRole(servicePrincipal, roleArn, action, resource string) error
}

Authorizer answers whether servicePrincipal, acting as roleArn, may perform action on resource.

type ResourceAuthorizer

type ResourceAuthorizer interface {
	AuthorizeServiceResource(servicePrincipal, action, resource, sourceARN string) error
}

ResourceAuthorizer answers whether a service principal may act on a resource under that resource's own policy (Lambda, SQS, SNS, S3), given the source ARN and account conditions.

Jump to

Keyboard shortcuts

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