Documentation
¶
Index ¶
- Variables
- type AttributeMapping
- type Crl
- type Handler
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type InMemoryBackend
- func (b *InMemoryBackend) AccountID() string
- func (b *InMemoryBackend) CreateProfile(ctx context.Context, name string, roleArns []string, tags []TagEntry, ...) (*Profile, error)
- func (b *InMemoryBackend) CreateTrustAnchor(ctx context.Context, name string, source TrustAnchorSource, tags []TagEntry, ...) (*TrustAnchor, error)
- func (b *InMemoryBackend) DeleteAttributeMapping(ctx context.Context, profileID, certificateField string, specifiers []string) (*Profile, error)
- func (b *InMemoryBackend) DeleteCrl(ctx context.Context, id string) (*Crl, error)
- func (b *InMemoryBackend) DeleteProfile(ctx context.Context, id string) (*Profile, error)
- func (b *InMemoryBackend) DeleteTrustAnchor(ctx context.Context, id string) (*TrustAnchor, error)
- func (b *InMemoryBackend) DisableCrl(ctx context.Context, id string) (*Crl, error)
- func (b *InMemoryBackend) DisableProfile(ctx context.Context, id string) (*Profile, error)
- func (b *InMemoryBackend) DisableTrustAnchor(ctx context.Context, id string) (*TrustAnchor, error)
- func (b *InMemoryBackend) EnableCrl(ctx context.Context, id string) (*Crl, error)
- func (b *InMemoryBackend) EnableProfile(ctx context.Context, id string) (*Profile, error)
- func (b *InMemoryBackend) EnableTrustAnchor(ctx context.Context, id string) (*TrustAnchor, error)
- func (b *InMemoryBackend) GetAttributeMappings(ctx context.Context, profileID string) []AttributeMapping
- func (b *InMemoryBackend) GetCrl(ctx context.Context, id string) (*Crl, error)
- func (b *InMemoryBackend) GetNotificationSettings(ctx context.Context, trustAnchorID string) []NotificationSetting
- func (b *InMemoryBackend) GetProfile(ctx context.Context, id string) (*Profile, error)
- func (b *InMemoryBackend) GetSubject(ctx context.Context, id string) (*Subject, error)
- func (b *InMemoryBackend) GetTrustAnchor(ctx context.Context, id string) (*TrustAnchor, error)
- func (b *InMemoryBackend) ImportCrl(ctx context.Context, name string, crlData []byte, trustAnchorArn string, ...) (*Crl, error)
- func (b *InMemoryBackend) ListCrls(ctx context.Context, pageToken string, maxResults int) ([]*Crl, string, error)
- func (b *InMemoryBackend) ListProfiles(ctx context.Context, pageToken string, maxResults int) ([]*Profile, string, error)
- func (b *InMemoryBackend) ListSubjects(ctx context.Context, pageToken string, maxResults int) ([]*Subject, string, error)
- func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resourceARN string) ([]TagEntry, error)
- func (b *InMemoryBackend) ListTrustAnchors(ctx context.Context, pageToken string, maxResults int) ([]*TrustAnchor, string, error)
- func (b *InMemoryBackend) PutAttributeMapping(ctx context.Context, profileID, certificateField string, rules []MappingRule) (*Profile, error)
- func (b *InMemoryBackend) PutNotificationSettings(ctx context.Context, trustAnchorID string, settings []NotificationSetting) (*TrustAnchor, error)
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) ResetNotificationSettings(ctx context.Context, trustAnchorID string, keys []NotificationSettingKey) (*TrustAnchor, error)
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) TagResource(ctx context.Context, resourceARN string, tags []TagEntry) error
- func (b *InMemoryBackend) UntagResource(ctx context.Context, resourceARN string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateCrl(ctx context.Context, id, name string, crlData []byte) (*Crl, error)
- func (b *InMemoryBackend) UpdateProfile(ctx context.Context, id, name string, roleArns []string, ...) (*Profile, error)
- func (b *InMemoryBackend) UpdateTrustAnchor(ctx context.Context, id, name string, source *TrustAnchorSource) (*TrustAnchor, error)
- type MappingRule
- type NotificationSetting
- type NotificationSettingKey
- type Profile
- type Provider
- type StorageBackend
- type Subject
- type TagEntry
- type TrustAnchor
- type TrustAnchorSource
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTrustAnchorNotFound is returned when a trust anchor does not exist. ErrTrustAnchorNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound) // ErrProfileNotFound is returned when a profile does not exist. ErrProfileNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound) // ErrCrlNotFound is returned when a CRL does not exist. ErrCrlNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound) // ErrSubjectNotFound is returned when a subject does not exist. ErrSubjectNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound) // ErrResourceNotFound is returned when TagResource/ListTagsForResource is // given a resourceArn that does not match any trust anchor, profile, or // CRL. Unlike the resource-specific NotFound sentinels above, callers of // tag operations address resources purely by ARN, with no dedicated // per-family lookup path. ErrResourceNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound) // ErrValidation is returned on invalid input. ErrValidation = awserr.New("ValidationException", awserr.ErrInvalidParameter) // ErrTooManyTags is returned when TagResource would push a resource's // total tag count past the service's 200-tag limit (the same limit the // real SDK's TagList shape enforces on any single tags list; see // aws-sdk-go-v2/service/rolesanywhere's service-2.json "TagList" shape, // max: 200). ErrTooManyTags = awserr.New("TooManyTagsException", awserr.ErrInvalidParameter) )
var ErrNilAppContext = errors.New("rolesanywhere: nil app context")
ErrNilAppContext is returned when Init is called with a nil AppContext.
Functions ¶
This section is empty.
Types ¶
type AttributeMapping ¶
type AttributeMapping struct {
CertificateField string `json:"certificateField"`
MappingRules []MappingRule `json:"mappingRules"`
}
AttributeMapping maps a certificate field to session attribute rules.
type Crl ¶
type Crl struct {
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
CrlID string `json:"crlId"`
CrlArn string `json:"crlArn"`
Name string `json:"name"`
TrustAnchorArn string `json:"trustAnchorArn"`
CrlData []byte `json:"crlData,omitempty"`
Enabled bool `json:"enabled"`
// contains filtered or unexported fields
}
Crl represents an IAM Roles Anywhere Certificate Revocation List.
type Handler ¶
type Handler struct {
Backend StorageBackend
}
Handler handles Roles Anywhere HTTP requests.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the operation name from the request.
func (*Handler) ExtractResource ¶
ExtractResource extracts the resource identifier from the request.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches Roles Anywhere requests by path.
func (*Handler) Snapshot ¶
Snapshot implements persistence.Persistable by delegating to the backend. Prior to Phase 3.3, Handler had no Snapshot/Restore of its own even though InMemoryBackend fully implemented them: the service registry's persistence setup (see setupPersistence in cli.go) only registers a service.Registerable that also satisfies an inline Snapshot/Restore interface, so RolesAnywhere state was silently never persisted. These two methods close that gap.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend implements StorageBackend using in-memory maps.
trustAnchors, profiles, crls, and subjects were previously map[region]map[id]*T; Phase 3.3 replaces each with a flat *store.Table keyed by the composite "region|id" string (see regionKey), with a companion *store.Index grouping entries by region -- see store_setup.go's registerAllTables doc for the full rationale and why all four are "dirty" (unregistered on registry) tables. tags, attributeMappings, and notificationSettings remain plain region-nested maps: each holds a slice value ([]TagEntry / []AttributeMapping / []NotificationSetting), not a *T, so there is nothing for store.Table to key on.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend constructs a new InMemoryBackend.
func (*InMemoryBackend) AccountID ¶
func (b *InMemoryBackend) AccountID() string
AccountID returns the backend's account ID.
func (*InMemoryBackend) CreateProfile ¶
func (b *InMemoryBackend) CreateProfile( ctx context.Context, name string, roleArns []string, tags []TagEntry, durationSeconds *int32, managedPolicyArns []string, sessionPolicy string, requireInstanceProperties bool, enabled *bool, acceptRoleSessionName *bool, ) (*Profile, error)
CreateProfile creates a new profile. enabled defaults to true when nil, matching the AWS CreateProfileRequest.enabled default (the same pattern CreateTrustAnchor and ImportCrl already use).
Real AWS Roles Anywhere has no uniqueness constraint on profile names (CreateProfile only models ValidationException/AccessDeniedException -- there is no ConflictException shape anywhere in the service), so duplicate names are accepted, matching the real API.
func (*InMemoryBackend) CreateTrustAnchor ¶
func (b *InMemoryBackend) CreateTrustAnchor( ctx context.Context, name string, source TrustAnchorSource, tags []TagEntry, enabled *bool, notificationSettings []NotificationSetting, ) (*TrustAnchor, error)
CreateTrustAnchor creates a new trust anchor. enabled defaults to true when nil, matching the AWS CreateTrustAnchorRequest.enabled default.
Real AWS Roles Anywhere has no uniqueness constraint on trust anchor names (only ResourceNotFoundException/ValidationException/AccessDeniedException are modeled for CreateTrustAnchor -- there is no ConflictException shape anywhere in the service at all), so duplicate names are accepted, matching the real API; the identifier of record is the generated ID/ARN.
func (*InMemoryBackend) DeleteAttributeMapping ¶
func (b *InMemoryBackend) DeleteAttributeMapping( ctx context.Context, profileID, certificateField string, specifiers []string, ) (*Profile, error)
DeleteAttributeMapping removes a certificate field mapping (and optional specifiers) from a profile.
func (*InMemoryBackend) DeleteCrl ¶
DeleteCrl removes a CRL. Its tags (held in a separate ARN-keyed map, not on the Crl struct itself -- see store.go) are cascade-deleted so no ghost row survives the CRL it belonged to.
func (*InMemoryBackend) DeleteProfile ¶
DeleteProfile removes a profile and returns its state immediately before deletion, matching AWS's DeleteProfileResponse.profile. Its attribute mappings and tags (both held in separate ID/ARN-keyed maps, not on the Profile struct itself -- see store.go) are cascade-deleted so no ghost rows survive the profile they belonged to.
func (*InMemoryBackend) DeleteTrustAnchor ¶
func (b *InMemoryBackend) DeleteTrustAnchor(ctx context.Context, id string) (*TrustAnchor, error)
DeleteTrustAnchor removes a trust anchor and returns its state immediately before deletion, matching AWS's DeleteTrustAnchorResponse.trustAnchor. Its notification settings and tags (both held in separate ARN/ID-keyed maps, not on the TrustAnchor struct itself -- see store.go) are cascade-deleted so no ghost rows survive the trust anchor they belonged to.
func (*InMemoryBackend) DisableCrl ¶
DisableCrl disables a CRL.
func (*InMemoryBackend) DisableProfile ¶
DisableProfile disables a profile.
func (*InMemoryBackend) DisableTrustAnchor ¶
func (b *InMemoryBackend) DisableTrustAnchor(ctx context.Context, id string) (*TrustAnchor, error)
DisableTrustAnchor disables a trust anchor.
func (*InMemoryBackend) EnableProfile ¶
EnableProfile enables a profile.
func (*InMemoryBackend) EnableTrustAnchor ¶
func (b *InMemoryBackend) EnableTrustAnchor(ctx context.Context, id string) (*TrustAnchor, error)
EnableTrustAnchor enables a trust anchor.
func (*InMemoryBackend) GetAttributeMappings ¶
func (b *InMemoryBackend) GetAttributeMappings(ctx context.Context, profileID string) []AttributeMapping
GetAttributeMappings returns the attribute mappings for a profile.
func (*InMemoryBackend) GetNotificationSettings ¶
func (b *InMemoryBackend) GetNotificationSettings(ctx context.Context, trustAnchorID string) []NotificationSetting
GetNotificationSettings returns notification settings for a trust anchor.
func (*InMemoryBackend) GetProfile ¶
GetProfile returns the profile with the given ID.
func (*InMemoryBackend) GetSubject ¶
GetSubject returns a subject by ID.
func (*InMemoryBackend) GetTrustAnchor ¶
func (b *InMemoryBackend) GetTrustAnchor(ctx context.Context, id string) (*TrustAnchor, error)
GetTrustAnchor returns the trust anchor with the given ID.
func (*InMemoryBackend) ImportCrl ¶
func (b *InMemoryBackend) ImportCrl( ctx context.Context, name string, crlData []byte, trustAnchorArn string, enabled bool, tags []TagEntry, ) (*Crl, error)
ImportCrl imports a new CRL.
Real AWS Roles Anywhere has no uniqueness constraint on CRL names (ImportCrl only models ValidationException/AccessDeniedException -- there is no ConflictException shape anywhere in the service), so duplicate names are accepted, matching the real API.
func (*InMemoryBackend) ListCrls ¶
func (b *InMemoryBackend) ListCrls(ctx context.Context, pageToken string, maxResults int) ([]*Crl, string, error)
ListCrls returns all CRLs with optional pagination.
func (*InMemoryBackend) ListProfiles ¶
func (b *InMemoryBackend) ListProfiles( ctx context.Context, pageToken string, maxResults int, ) ([]*Profile, string, error)
ListProfiles returns all profiles in the request region.
func (*InMemoryBackend) ListSubjects ¶
func (b *InMemoryBackend) ListSubjects( ctx context.Context, pageToken string, maxResults int, ) ([]*Subject, string, error)
ListSubjects returns all subjects with optional pagination.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resourceARN string) ([]TagEntry, error)
ListTagsForResource returns tags for a resource. Region is resolved from the resource ARN. Real AWS's ListTagsForResource models ResourceNotFoundException, returned when resourceARN matches no trust anchor/profile/CRL (unlike UntagResource, which declares no such error and is left to silently no-op against an unknown ARN).
func (*InMemoryBackend) ListTrustAnchors ¶
func (b *InMemoryBackend) ListTrustAnchors( ctx context.Context, pageToken string, maxResults int, ) ([]*TrustAnchor, string, error)
ListTrustAnchors returns all trust anchors in the request region.
func (*InMemoryBackend) PutAttributeMapping ¶
func (b *InMemoryBackend) PutAttributeMapping( ctx context.Context, profileID, certificateField string, rules []MappingRule, ) (*Profile, error)
PutAttributeMapping adds or replaces a certificate field mapping on a profile.
func (*InMemoryBackend) PutNotificationSettings ¶
func (b *InMemoryBackend) PutNotificationSettings( ctx context.Context, trustAnchorID string, settings []NotificationSetting, ) (*TrustAnchor, error)
PutNotificationSettings sets notification settings on a trust anchor.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the backend's default region.
func (*InMemoryBackend) ResetNotificationSettings ¶
func (b *InMemoryBackend) ResetNotificationSettings( ctx context.Context, trustAnchorID string, keys []NotificationSettingKey, ) (*TrustAnchor, error)
ResetNotificationSettings removes specified notification settings from a trust anchor.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore deserializes backend state from JSON. It implements persistence.Persistable.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serializes backend state to JSON. It implements persistence.Persistable.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(ctx context.Context, resourceARN string, tags []TagEntry) error
TagResource adds tags to a resource. Region is resolved from the resource ARN. Real AWS's TagResource models ResourceNotFoundException (returned when resourceARN matches no trust anchor/profile/CRL) and TooManyTagsException (returned when the resulting tag count on the resource would exceed the service's per-resource limit).
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(ctx context.Context, resourceARN string, tagKeys []string) error
UntagResource removes tags from a resource. Region is resolved from the resource ARN.
func (*InMemoryBackend) UpdateCrl ¶
func (b *InMemoryBackend) UpdateCrl(ctx context.Context, id, name string, crlData []byte) (*Crl, error)
UpdateCrl updates a CRL's name and/or data.
func (*InMemoryBackend) UpdateProfile ¶
func (b *InMemoryBackend) UpdateProfile( ctx context.Context, id, name string, roleArns []string, durationSeconds *int32, managedPolicyArns []string, sessionPolicy string, requireInstanceProperties *bool, acceptRoleSessionName *bool, ) (*Profile, error)
UpdateProfile updates a profile's fields.
func (*InMemoryBackend) UpdateTrustAnchor ¶
func (b *InMemoryBackend) UpdateTrustAnchor( ctx context.Context, id, name string, source *TrustAnchorSource, ) (*TrustAnchor, error)
UpdateTrustAnchor updates name and/or source of a trust anchor.
type MappingRule ¶
type MappingRule struct {
Specifier string `json:"specifier"`
}
MappingRule is a single rule mapping a certificate field specifier to a session attribute.
type NotificationSetting ¶
type NotificationSetting struct {
Threshold *int32 `json:"threshold,omitempty"`
Event string `json:"event"`
Channel string `json:"channel,omitempty"`
ConfiguredBy string `json:"configuredBy,omitempty"`
Enabled bool `json:"enabled"`
}
NotificationSetting holds a notification configuration for a trust anchor.
ConfiguredBy mirrors AWS's NotificationSettingDetail.configuredBy (the principal that configured the setting -- rolesanywhere.amazonaws.com for AWS-default settings, or the account ID for customer-configured ones). gopherstack never seeds default settings, so every setting present here was configured via PutNotificationSettings and ConfiguredBy is always the backend's account ID.
type NotificationSettingKey ¶
type NotificationSettingKey struct {
Event string `json:"event"`
Channel string `json:"channel,omitempty"`
}
NotificationSettingKey identifies a notification setting to reset.
type Profile ¶
type Profile struct {
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DurationSeconds *int32 `json:"durationSeconds,omitempty"`
ProfileID string `json:"profileId"`
ProfileArn string `json:"profileArn"`
Name string `json:"name"`
SessionPolicy string `json:"sessionPolicy,omitempty"`
// CreatedBy is the AWS account that created the profile
// (ProfileDetail.createdBy); this is a single-account emulator, so it is
// always the backend's own account ID.
CreatedBy string `json:"createdBy,omitempty"`
RoleArns []string `json:"roleArns"`
ManagedPolicyArns []string `json:"managedPolicyArns,omitempty"`
RequireInstanceProperties bool `json:"requireInstanceProperties,omitempty"`
Enabled bool `json:"enabled"`
// AcceptRoleSessionName determines whether a custom role session name
// will be accepted in a temporary credential request
// (CreateProfileInput/UpdateProfileInput/ProfileDetail.
// acceptRoleSessionName). Only meaningful to the separate CreateSession
// data-plane API, which gopherstack does not implement, but the field
// itself is stored/echoed for wire parity.
AcceptRoleSessionName bool `json:"acceptRoleSessionName,omitempty"`
// contains filtered or unexported fields
}
Profile represents an IAM Roles Anywhere profile.
Note: like TrustAnchor, this carries no Tags field -- real AWS ProfileDetail has none either; see TrustAnchor's doc comment.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for IAM Roles Anywhere.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the Roles Anywhere service backend and handler.
type StorageBackend ¶
type StorageBackend interface {
// Trust anchor operations
CreateTrustAnchor(
ctx context.Context,
name string,
source TrustAnchorSource,
tags []TagEntry,
enabled *bool,
notificationSettings []NotificationSetting,
) (*TrustAnchor, error)
GetTrustAnchor(ctx context.Context, id string) (*TrustAnchor, error)
ListTrustAnchors(ctx context.Context, pageToken string, maxResults int) ([]*TrustAnchor, string, error)
DeleteTrustAnchor(ctx context.Context, id string) (*TrustAnchor, error)
UpdateTrustAnchor(ctx context.Context, id, name string, source *TrustAnchorSource) (*TrustAnchor, error)
EnableTrustAnchor(ctx context.Context, id string) (*TrustAnchor, error)
DisableTrustAnchor(ctx context.Context, id string) (*TrustAnchor, error)
// Profile operations
CreateProfile(
ctx context.Context,
name string,
roleArns []string,
tags []TagEntry,
durationSeconds *int32,
managedPolicyArns []string,
sessionPolicy string,
requireInstanceProperties bool,
enabled *bool,
acceptRoleSessionName *bool,
) (*Profile, error)
GetProfile(ctx context.Context, id string) (*Profile, error)
ListProfiles(ctx context.Context, pageToken string, maxResults int) ([]*Profile, string, error)
DeleteProfile(ctx context.Context, id string) (*Profile, error)
UpdateProfile(
ctx context.Context,
id, name string,
roleArns []string,
durationSeconds *int32,
managedPolicyArns []string,
sessionPolicy string,
requireInstanceProperties *bool,
acceptRoleSessionName *bool,
) (*Profile, error)
EnableProfile(ctx context.Context, id string) (*Profile, error)
DisableProfile(ctx context.Context, id string) (*Profile, error)
// CRL operations
ImportCrl(
ctx context.Context,
name string,
crlData []byte,
trustAnchorArn string,
enabled bool,
tags []TagEntry,
) (*Crl, error)
GetCrl(ctx context.Context, id string) (*Crl, error)
ListCrls(ctx context.Context, pageToken string, maxResults int) ([]*Crl, string, error)
UpdateCrl(ctx context.Context, id, name string, crlData []byte) (*Crl, error)
DeleteCrl(ctx context.Context, id string) (*Crl, error)
EnableCrl(ctx context.Context, id string) (*Crl, error)
DisableCrl(ctx context.Context, id string) (*Crl, error)
// Subject operations
GetSubject(ctx context.Context, id string) (*Subject, error)
ListSubjects(ctx context.Context, pageToken string, maxResults int) ([]*Subject, string, error)
// Attribute mapping operations
PutAttributeMapping(ctx context.Context, profileID, certificateField string, rules []MappingRule) (*Profile, error)
DeleteAttributeMapping(
ctx context.Context,
profileID, certificateField string,
specifiers []string,
) (*Profile, error)
GetAttributeMappings(ctx context.Context, profileID string) []AttributeMapping
// Notification settings operations
PutNotificationSettings(
ctx context.Context,
trustAnchorID string,
settings []NotificationSetting,
) (*TrustAnchor, error)
ResetNotificationSettings(
ctx context.Context,
trustAnchorID string,
keys []NotificationSettingKey,
) (*TrustAnchor, error)
GetNotificationSettings(ctx context.Context, trustAnchorID string) []NotificationSetting
// Tag operations
TagResource(ctx context.Context, resourceARN string, tags []TagEntry) error
UntagResource(ctx context.Context, resourceARN string, tagKeys []string) error
ListTagsForResource(ctx context.Context, resourceARN string) ([]TagEntry, error)
// Lifecycle
Reset()
Region() string
AccountID() string
Snapshot(ctx context.Context) []byte
Restore(ctx context.Context, data []byte) error
}
StorageBackend defines the interface for Roles Anywhere backend implementations. All mutating methods must be safe for concurrent use.
type Subject ¶
type Subject struct {
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
LastSeenAt time.Time `json:"lastSeenAt"`
SubjectID string `json:"subjectId"`
SubjectArn string `json:"subjectArn"`
X509Subject string `json:"x509Subject"`
Enabled bool `json:"enabled"`
// contains filtered or unexported fields
}
Subject represents an IAM Roles Anywhere subject (authenticating certificate).
type TrustAnchor ¶
type TrustAnchor struct {
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Source TrustAnchorSource `json:"source"`
TrustAnchorID string `json:"trustAnchorId"`
TrustAnchorArn string `json:"trustAnchorArn"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
// contains filtered or unexported fields
}
TrustAnchor represents an IAM Roles Anywhere trust anchor.
Note: real AWS TrustAnchorDetail carries no "tags" field at all -- tags are visible only via ListTagsForResource/TagResource/UntagResource, keyed by ARN in InMemoryBackend.tags (see store.go). This struct therefore has no Tags field of its own; a prior version did, which both invented a non-existent "tags" key on every Create/Get/List/Update/Enable/Disable/ Delete response AND caused the exposed value to permanently desync from TagResource/UntagResource (which write to the separate ARN-keyed map).
type TrustAnchorSource ¶
type TrustAnchorSource struct {
// SourceData is a map of source-type-specific fields.
SourceData map[string]string `json:"sourceData,omitempty"`
SourceType string `json:"sourceType"`
}
TrustAnchorSource defines the source of a trust anchor.
Source Files
¶
- attribute_mappings.go
- crls.go
- errors.go
- handler.go
- handler_attribute_mappings.go
- handler_crls.go
- handler_notification_settings.go
- handler_profiles.go
- handler_subjects.go
- handler_tags.go
- handler_trust_anchors.go
- interfaces.go
- models.go
- notification_settings.go
- persistence.go
- profiles.go
- provider.go
- store.go
- store_setup.go
- subjects.go
- tags.go
- trust_anchors.go