condeval

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package condeval holds IAM policy / STS trust-policy condition-operator logic shared between services/iam and services/sts: ARN segment-wise matching (ArnEquals/ArnLike/ArnNotEquals/ArnNotLike) and Date operand parsing/comparison (DateEquals/.../DateGreaterThanEquals). Each caller keeps its own wildcard matcher and its own operator-dispatch/IfExists/ set-qualifier plumbing; only the AWS-documented matching rules that were starting to be copy-pasted verbatim between the two packages live here.

Index

Constants

View Source
const ArnSegmentCount = 6

ArnSegmentCount is the number of colon-delimited components in an ARN (arn:partition:service:region:account-id:resource).

Variables

This section is empty.

Functions

func AnyArnMatch

func AnyArnMatch(patterns []string, value string, match func(pattern, value string) bool) bool

AnyArnMatch reports whether value matches any ARN pattern in patterns.

func ArnMatch

func ArnMatch(pattern, value string, match func(pattern, value string) bool) bool

ArnMatch implements ArnEquals/ArnLike, which AWS documents as behaving identically: case-sensitive, with each of the six colon-delimited ARN components wildcard-matched separately via match, rather than one glob over the whole string (which would let a wildcard span a segment boundary). https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_ARN

func CompareDate

func CompareDate(op string, actual, candidate time.Time) bool

CompareDate evaluates one of the six Date condition operators (already lower-cased and IfExists-stripped) for a single actual/candidate pair. Unrecognized operators return false.

func ParseDate

func ParseDate(v string) (time.Time, bool)

ParseDate parses a Date condition operand, accepting both ISO 8601 and epoch (UNIX) seconds, as AWS documents for aws:CurrentTime/aws:EpochTime.

Types

This section is empty.

Jump to

Keyboard shortcuts

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