ram

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 24 Imported by: 0

README

Resource Access Manager

Parity grade: A · SDK aws-sdk-go-v2/service/ram@v1.36.1 · last audited 2026-07-13 (8d42b940)

Coverage

Metric Value
Operations audited 37 (33 ok, 2 partial, 2 gap)
Feature families 2 (2 ok)
Known gaps 7
Deferred items 1
Resource leaks clean
Known gaps
  • DisassociateResourceShare hard-deletes matching associations from the in-memory slice instead of soft-deleting them (Status=DISASSOCIATED, kept in place) the way DeleteResourceShare does. This means GetResourceShareAssociations(associationStatus=DISASSOCIATED) can never show an entry produced via DisassociateResourceShare (only via DeleteResourceShare). Existing test TestRAM_Backend_DisassociateResourceShare_RemovesFromSlice pins the current (hard-delete) behavior intentionally, and AssociateResourceShare's re-association dedup logic (the existing set built from all associations regardless of status) would need a matching status-aware fix to allow re-associating a previously-disassociated entity without producing duplicate rows. Left unfixed this sweep due to blast radius; needs a bd issue to redesign both together.
  • GetResourceShares does not support the permissionArn/permissionVersion request filters that real AWS exposes (filter resource shares by an associated managed permission). Not implemented; would need to reuse the sharePermissions map.
  • DisassociateResourceSharePermission does not enforce AWS's rule that you cannot disassociate the last managed permission associated with a resource type still present in the share's resources. Requires cross-referencing sharePermissions against the resource types of active RESOURCE associations for the share.
  • CreateResourceShare / AssociateResourceShare do not auto-associate the default AWS-managed permission for a resource's type when no permissionArns are given (real AWS attaches e.g. AWSRAMDefaultPermissionEC2Subnet automatically). ListResourceSharePermissions returns empty for such shares even though real AWS would show the default permission. resourceTypeFromARN + awsBuiltInPermissions already contain enough data to build the resourceType -> default permission ARN mapping needed to close this gap.
  • ListReplacePermissionAssociationsWork and ListSourceAssociations are permanently-empty stubs (documented honestly in code comments, not disguised). ReplacePermissionAssociations work items and source associations are not tracked anywhere in the backend.
  • Several "This member is required" SDK input fields (ResourceOwner on GetResourceShares/ListResources/ListPrincipals, AssociationType on GetResourceShareAssociations) are not validated as required -- missing them is silently treated as an empty-string default rather than erroring. Consistent with this codebase's generally permissive input handling; not fixed this sweep.
  • permissionSummaryObject/permissionDetailObject emit a resourceRegionScope field that does not exist on the real ResourceSharePermissionSummary/ResourceSharePermissionDetail SDK types (harmless: the restjson1 deserializer ignores unrecognized fields, confirmed by reading deserializers.go). Not removed since it's a no-op field, not a bug.
Deferred
  • PromoteResourceShareCreatedFromPolicy's featureSet state machine (CREATED_FROM_POLICY -> PROMOTING_TO_STANDARD -> STANDARD) is not modeled; every share created here is already STANDARD so this hasn't caused observed drift, but if CREATED_FROM_POLICY share creation is ever added, this needs revisiting.

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrValidation is returned when a request contains an invalid or missing parameter.
	ErrValidation = awserr.New("MalformedQueryStringException", awserr.ErrInvalidParameter)
	// ErrNotFound is returned when a resource share does not exist.
	ErrNotFound = awserr.New("UnknownResourceException", awserr.ErrNotFound)
	// ErrAlreadyExists is returned when a resource share already exists.
	ErrAlreadyExists = awserr.New("ResourceShareAlreadyExistsException", awserr.ErrConflict)
	// ErrPermissionNotFound is returned when a permission does not exist.
	ErrPermissionNotFound = awserr.New("InvalidParameterException", awserr.ErrNotFound)
	// ErrInvitationNotFound is returned when an invitation does not exist.
	ErrInvitationNotFound = awserr.New(
		"ResourceShareInvitationArnNotFoundException",
		awserr.ErrNotFound,
	)
	// ErrInvitationAlreadyAccepted is returned when accepting an already-accepted invitation.
	ErrInvitationAlreadyAccepted = awserr.New(
		"ResourceShareInvitationAlreadyAcceptedException",
		awserr.ErrConflict,
	)
	// ErrInvitationAlreadyRejected is returned when accepting or rejecting an already-rejected invitation.
	ErrInvitationAlreadyRejected = awserr.New(
		"ResourceShareInvitationAlreadyRejectedException",
		awserr.ErrConflict,
	)
	// ErrInvitationExpired is returned when acting on an expired invitation.
	ErrInvitationExpired = awserr.New(
		"ResourceShareInvitationExpiredException",
		awserr.ErrConflict,
	)
	// ErrPermissionVersionNotFound is returned when a permission version does not exist.
	ErrPermissionVersionNotFound = awserr.New("InvalidParameterException", awserr.ErrNotFound)
	// ErrOperationNotPermitted is returned when an operation is not permitted on an AWS-managed resource.
	ErrOperationNotPermitted = awserr.New("OperationNotPermittedException", awserr.ErrConflict)
	// ErrPermissionInUse is returned when deleting a permission that is associated with active shares.
	ErrPermissionInUse = awserr.New("PermissionInUseException", awserr.ErrConflict)
	// ErrInvalidParameter is returned when a parameter value is out of the allowed range.
	ErrInvalidParameter = awserr.New("InvalidParameterException", awserr.ErrInvalidParameter)
)
View Source
var ErrNilAppContext = errors.New("ram: nil AppContext")

ErrNilAppContext is returned when the AppContext passed to Init is nil.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Backend   StorageBackend
	AccountID string
	Region    string
}

Handler is the HTTP handler for the AWS RAM REST API.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new RAM handler.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this handler handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the operation name from the request path.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the resource share ARN from the request body or query.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported RAM operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function for RAM requests.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all in-memory state from the backend. It is used by the POST /_gopherstack/reset endpoint for CI pipelines and rapid local development.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function that matches RAM API requests. All path-based matches are gated on the SigV4 service name to prevent routing conflicts with other services that share similar REST paths.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

type InMemoryBackend

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

InMemoryBackend is an in-memory store for AWS RAM resources.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new in-memory RAM backend seeded with AWS-managed permissions.

func (*InMemoryBackend) AcceptResourceShareInvitation

func (b *InMemoryBackend) AcceptResourceShareInvitation(
	invitationARN string,
) (*ResourceShareInvitation, error)

AcceptResourceShareInvitation accepts a pending resource share invitation.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

func (*InMemoryBackend) AddInvitationInternal

func (b *InMemoryBackend) AddInvitationInternal(inv *ResourceShareInvitation)

AddInvitationInternal adds a pre-built invitation for testing or seeding.

func (*InMemoryBackend) AddPermissionInternal

func (b *InMemoryBackend) AddPermissionInternal(p *Permission)

AddPermissionInternal inserts a permission directly, bypassing validation. Useful for seeding test state.

func (*InMemoryBackend) AddResourceShareInternal

func (b *InMemoryBackend) AddResourceShareInternal(rs *ResourceShare)

AddResourceShareInternal inserts a resource share directly, bypassing validation. Useful for seeding test state.

func (*InMemoryBackend) AssociateResourceShare

func (b *InMemoryBackend) AssociateResourceShare(
	shareARN string,
	principals, resourceARNs []string,
) ([]*ResourceShareAssociation, error)

AssociateResourceShare associates principals or resource ARNs with a resource share. Entities that are already associated are silently skipped (idempotent), matching AWS behavior. Returns deep copies of the new associations so callers cannot mutate backend state.

func (*InMemoryBackend) AssociateResourceSharePermission

func (b *InMemoryBackend) AssociateResourceSharePermission(
	shareARN, permissionARN string,
	replace bool,
	permissionVersion *int32,
) error

AssociateResourceSharePermission associates a managed permission with a resource share.

func (*InMemoryBackend) CreateInvitation

func (b *InMemoryBackend) CreateInvitation(
	shareARN, shareNm, senderAcctID, receiverAcctID string,
) *ResourceShareInvitation

CreateInvitation creates a pending invitation for a resource share. This is a helper for the mock that mirrors what AWS does when AssociateResourceShare is called with principals.

func (*InMemoryBackend) CreatePermission

func (b *InMemoryBackend) CreatePermission(
	name, resourceType, policyTemplate string,
	tags map[string]string,
) (*Permission, error)

CreatePermission creates a new customer-managed RAM permission.

func (*InMemoryBackend) CreatePermissionVersion

func (b *InMemoryBackend) CreatePermissionVersion(
	permissionARN, policyTemplate string,
) (*Permission, error)

CreatePermissionVersion creates a new version of an existing customer-managed RAM permission.

func (*InMemoryBackend) CreateResourceShare

func (b *InMemoryBackend) CreateResourceShare(
	name string,
	allowExternalPrincipals bool,
	tags map[string]string,
	principals, resourceARNs []string,
) (*ResourceShare, error)

CreateResourceShare creates a new resource share.

func (*InMemoryBackend) DeletePermission

func (b *InMemoryBackend) DeletePermission(permissionARN string) error

DeletePermission soft-deletes a customer-managed RAM permission and removes it from all shares. AWS-managed permissions cannot be deleted.

func (*InMemoryBackend) DeletePermissionVersion

func (b *InMemoryBackend) DeletePermissionVersion(
	permissionARN string,
	permissionVersion int32,
) error

DeletePermissionVersion deletes a specific version of a customer-managed RAM permission. The default version cannot be deleted. If the latest version is deleted, LatestVersion is updated to the next-highest remaining version.

func (*InMemoryBackend) DeleteResourceShare

func (b *InMemoryBackend) DeleteResourceShare(shareARN string) error

DeleteResourceShare deletes a resource share and removes it from the store. Associations for the share are disassociated before the share is removed so that ListResources / ListPrincipals no longer return them.

func (*InMemoryBackend) DisassociateResourceShare

func (b *InMemoryBackend) DisassociateResourceShare(
	shareARN string,
	principals, resourceARNs []string,
) ([]*ResourceShareAssociation, error)

DisassociateResourceShare removes principals or resource ARNs from a resource share.

func (*InMemoryBackend) DisassociateResourceSharePermission

func (b *InMemoryBackend) DisassociateResourceSharePermission(
	shareARN, permissionARN string,
) error

DisassociateResourceSharePermission removes a managed permission from a resource share.

func (*InMemoryBackend) GetPermission

func (b *InMemoryBackend) GetPermission(
	permissionARN string,
	permissionVersion *int32,
) (*Permission, *PermissionVersion, error)

GetPermission returns the details of a RAM permission, optionally at a specific version.

func (*InMemoryBackend) GetResourcePolicies

func (b *InMemoryBackend) GetResourcePolicies(resourceARNs []string) []string

GetResourcePolicies returns resource-based policy documents for shared resources. Only ARNs that are actively associated with a resource share receive a policy entry; ARNs not in any share are omitted, matching real AWS behaviour.

func (*InMemoryBackend) GetResourceShare

func (b *InMemoryBackend) GetResourceShare(shareARN string) (*ResourceShare, error)

GetResourceShare returns a resource share by ARN.

func (*InMemoryBackend) GetResourceShareAssociations

func (b *InMemoryBackend) GetResourceShareAssociations(
	associationType string,
	shareARNs []string,
) []*ResourceShareAssociation

GetResourceShareAssociations returns associations for the given resource share ARNs and type.

func (*InMemoryBackend) GetResourceShareInvitations

func (b *InMemoryBackend) GetResourceShareInvitations(
	invitationARNs, shareARNs []string,
) []*ResourceShareInvitation

GetResourceShareInvitations returns invitations filtered by ARN or resource share ARN, sorted by creation time (oldest first) for deterministic output.

func (*InMemoryBackend) ListPendingInvitationResources

func (b *InMemoryBackend) ListPendingInvitationResources(
	invitationARN string,
) ([]*ResourceShareAssociation, error)

ListPendingInvitationResources returns the resource associations for the resource share associated with the given invitation, filtered to resources that are in an active state.

func (*InMemoryBackend) ListPermissionAssociations

func (b *InMemoryBackend) ListPermissionAssociations(
	permissionARN string,
) []SharePermissionAssociation

ListPermissionAssociations returns all share-permission associations filtered optionally by permissionARN, sorted by share ARN + permission ARN.

func (*InMemoryBackend) ListPermissionVersions

func (b *InMemoryBackend) ListPermissionVersions(
	permissionARN string,
) ([]*PermissionVersion, error)

ListPermissionVersions returns all versions of a permission, sorted ascending by version number.

func (*InMemoryBackend) ListPermissions

func (b *InMemoryBackend) ListPermissions(resourceType string) []*Permission

ListPermissions returns all non-deleted customer-managed permissions, optionally filtered by resource type, sorted by ARN.

func (*InMemoryBackend) ListPrincipals

func (b *InMemoryBackend) ListPrincipals(
	resourceOwner, shareARN string,
) []*ResourceShareAssociation

ListPrincipals returns principal associations for shares, filtered by resourceOwner ("SELF" or "OTHER-ACCOUNTS") and share ARN. Sorted by associated entity.

func (*InMemoryBackend) ListResourceSharePermissions

func (b *InMemoryBackend) ListResourceSharePermissions(shareARN string) []*ResourceSharePermissionDetail

ListResourceSharePermissions returns the permissions associated with a resource share, each paired with the version actually associated with that share (which may differ from the permission's current default version), sorted by ARN for deterministic output.

func (*InMemoryBackend) ListResourceShares

func (b *InMemoryBackend) ListResourceShares(resourceOwner, status string) []*ResourceShare

ListResourceShares returns resource shares matching the given owner and optional status filter. resourceOwner must be "SELF" or "OTHER-ACCOUNTS".

  • "SELF": shares owned by this account (not deleted, optionally filtered by status).
  • "OTHER-ACCOUNTS": shares owned by another account where this account is a PRINCIPAL.

Pass status="" to return all matching shares, or e.g. "ACTIVE" to filter by status.

func (*InMemoryBackend) ListResources

func (b *InMemoryBackend) ListResources(
	resourceOwner, shareARN, resourceType string,
) []*ResourceShareAssociation

ListResources returns resources (resource-type associations) for shares, filtered by resourceOwner ("SELF" or "OTHER-ACCOUNTS"), share ARN, and resource type.

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(shareARN string) (map[string]string, error)

ListTagsForResource returns tags for a resource share identified by ARN.

func (*InMemoryBackend) PromotePermissionCreatedFromPolicy

func (b *InMemoryBackend) PromotePermissionCreatedFromPolicy(
	permissionARN string, name string,
) (*Permission, error)

PromotePermissionCreatedFromPolicy promotes a CREATED_FROM_POLICY permission to a CUSTOMER_MANAGED permission with the given name.

func (*InMemoryBackend) PromoteResourceShareCreatedFromPolicy

func (b *InMemoryBackend) PromoteResourceShareCreatedFromPolicy(
	shareARN string,
) (*ResourceShare, error)

PromoteResourceShareCreatedFromPolicy promotes a resource share to standard feature set. In this mock, it simply returns the existing share unchanged.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the AWS region this backend is configured for.

func (*InMemoryBackend) RejectResourceShareInvitation

func (b *InMemoryBackend) RejectResourceShareInvitation(
	invitationARN string,
) (*ResourceShareInvitation, error)

RejectResourceShareInvitation rejects a pending resource share invitation.

func (*InMemoryBackend) ReplacePermissionAssociations

func (b *InMemoryBackend) ReplacePermissionAssociations(
	fromPermissionARN, toPermissionARN string,
) (string, error)

ReplacePermissionAssociations replaces all associations using fromPermissionARN with toPermissionARN across all resource shares. Returns a work ID for ListReplacePermissionAssociationsWork.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all in-memory state from the backend and re-seeds built-in permissions. It is used by the POST /_gopherstack/reset endpoint for CI pipelines and rapid local development.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.

func (*InMemoryBackend) SetDefaultPermissionVersion

func (b *InMemoryBackend) SetDefaultPermissionVersion(
	permissionARN string,
	version int32,
) (*Permission, error)

SetDefaultPermissionVersion updates the default version of a customer-managed permission.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(shareARN string, kv map[string]string) error

TagResource adds or updates tags on a resource share identified by ARN.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(shareARN string, keys []string) error

UntagResource removes specified tag keys from a resource share.

func (*InMemoryBackend) UpdateResourceShare

func (b *InMemoryBackend) UpdateResourceShare(
	shareARN, name string,
	allowExternalPrincipals *bool,
) (*ResourceShare, error)

UpdateResourceShare updates an existing resource share. If name is changed, all matching associations are updated to reflect the new name.

type Permission

type Permission struct {
	CreationTime          time.Time                    `json:"creationTime"`
	LastUpdatedTime       time.Time                    `json:"lastUpdatedTime"`
	Tags                  map[string]string            `json:"tags,omitempty"`
	Versions              map[int32]*PermissionVersion `json:"versions"`
	ARN                   string                       `json:"arn"`
	Name                  string                       `json:"name"`
	ResourceType          string                       `json:"resourceType"`
	PermissionType        string                       `json:"permissionType"`
	ResourceRegionScope   string                       `json:"resourceRegionScope"`
	LatestVersion         int32                        `json:"latestVersion"`
	DefaultVersion        int32                        `json:"defaultVersion"`
	IsResourceTypeDefault bool                         `json:"isResourceTypeDefault"`
	Deleted               bool                         `json:"deleted"`
}

Permission represents a managed RAM permission (AWS-managed or customer-managed).

type PermissionVersion

type PermissionVersion struct {
	CreationTime    time.Time `json:"creationTime"`
	LastUpdatedTime time.Time `json:"lastUpdatedTime"`
	PolicyTemplate  string    `json:"policyTemplate"`
	Version         int32     `json:"version"`
}

PermissionVersion holds a single versioned policy document for a managed permission.

type Provider

type Provider struct{}

Provider implements service.Provider for AWS RAM.

func (*Provider) Init

Init initializes the RAM service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type ResourceShare

type ResourceShare struct {
	LastUpdatedTime         time.Time         `json:"lastUpdatedTime"`
	CreationTime            time.Time         `json:"creationTime"`
	Tags                    map[string]string `json:"tags,omitempty"`
	Name                    string            `json:"name"`
	ARN                     string            `json:"arn"`
	OwningAccountID         string            `json:"owningAccountId"`
	Status                  string            `json:"status"`
	StatusMessage           string            `json:"statusMessage,omitempty"`
	AllowExternalPrincipals bool              `json:"allowExternalPrincipals"`
}

ResourceShare represents an AWS RAM resource share.

type ResourceShareAssociation

type ResourceShareAssociation struct {
	LastUpdatedTime   time.Time `json:"lastUpdatedTime"`
	CreationTime      time.Time `json:"creationTime"`
	ResourceShareARN  string    `json:"resourceShareArn"`
	ResourceShareName string    `json:"resourceShareName"`
	AssociatedEntity  string    `json:"associatedEntity"`
	AssociationType   string    `json:"associationType"`
	Status            string    `json:"status"`
	StatusMessage     string    `json:"statusMessage,omitempty"`
	External          bool      `json:"external"`
}

ResourceShareAssociation represents a principal or resource associated with a resource share.

type ResourceShareInvitation

type ResourceShareInvitation struct {
	CreationTime      time.Time `json:"creationTime"`
	LastUpdatedTime   time.Time `json:"lastUpdatedTime"`
	InvitationARN     string    `json:"invitationArn"`
	ResourceShareARN  string    `json:"resourceShareArn"`
	ResourceShareName string    `json:"resourceShareName"`
	SenderAccountID   string    `json:"senderAccountId"`
	ReceiverAccountID string    `json:"receiverAccountId"`
	Status            string    `json:"status"`
}

ResourceShareInvitation represents an invitation to access a resource share.

type ResourceSharePermissionDetail

type ResourceSharePermissionDetail struct {
	Permission *Permission
	Version    int32
}

ResourceSharePermissionDetail pairs a managed permission with the specific version that is associated with a particular resource share. AWS tracks the associated version per (share, permission) pair -- AssociateResourceSharePermission can pin a non-default version -- so this must be reported per share rather than assumed to be the permission's current default version.

type SharePermissionAssociation

type SharePermissionAssociation struct {
	ShareARN      string
	PermissionARN string
	Version       int32
}

SharePermissionAssociation represents a share-permission link for ListPermissionAssociations.

type StorageBackend

type StorageBackend interface {
	// Resource share operations
	CreateResourceShare(
		name string,
		allowExternalPrincipals bool,
		tags map[string]string,
		principals, resourceARNs []string,
	) (*ResourceShare, error)
	GetResourceShare(shareARN string) (*ResourceShare, error)
	ListResourceShares(resourceOwner, status string) []*ResourceShare
	UpdateResourceShare(shareARN, name string, allowExternalPrincipals *bool) (*ResourceShare, error)
	DeleteResourceShare(shareARN string) error
	AssociateResourceShare(shareARN string, principals, resourceARNs []string) ([]*ResourceShareAssociation, error)
	DisassociateResourceShare(shareARN string, principals, resourceARNs []string) ([]*ResourceShareAssociation, error)
	GetResourceShareAssociations(assocType string, shareARNs []string) []*ResourceShareAssociation

	// Tag operations
	TagResource(shareARN string, tags map[string]string) error
	UntagResource(shareARN string, tagKeys []string) error
	ListTagsForResource(shareARN string) (map[string]string, error)

	// Permission operations
	CreatePermission(name, resourceType, policyTemplate string, tags map[string]string) (*Permission, error)
	CreatePermissionVersion(permissionARN, policyTemplate string) (*Permission, error)
	DeletePermission(permissionARN string) error
	DeletePermissionVersion(permissionARN string, permissionVersion int32) error
	GetPermission(permissionARN string, permissionVersion *int32) (*Permission, *PermissionVersion, error)
	AssociateResourceSharePermission(shareARN, permissionARN string, replace bool, permissionVersion *int32) error
	DisassociateResourceSharePermission(shareARN, permissionARN string) error
	ListResourceSharePermissions(shareARN string) []*ResourceSharePermissionDetail

	// Invitation operations
	AcceptResourceShareInvitation(invitationARN string) (*ResourceShareInvitation, error)
	RejectResourceShareInvitation(invitationARN string) (*ResourceShareInvitation, error)
	GetResourceShareInvitations(invitationARNs, shareARNs []string) []*ResourceShareInvitation
	ListPendingInvitationResources(invitationARN string) ([]*ResourceShareAssociation, error)

	// Permission list/version/promotion operations
	ListPermissions(resourceType string) []*Permission
	ListPermissionVersions(permissionARN string) ([]*PermissionVersion, error)
	ListPermissionAssociations(permissionARN string) []SharePermissionAssociation
	SetDefaultPermissionVersion(permissionARN string, version int32) (*Permission, error)
	PromotePermissionCreatedFromPolicy(permissionARN, name string) (*Permission, error)
	PromoteResourceShareCreatedFromPolicy(shareARN string) (*ResourceShare, error)
	ReplacePermissionAssociations(fromPermissionARN, toPermissionARN string) (string, error)

	// Resource and principal list operations
	ListResources(resourceOwner, shareARN, resourceType string) []*ResourceShareAssociation
	ListPrincipals(resourceOwner, shareARN string) []*ResourceShareAssociation

	// Resource policy operations
	GetResourcePolicies(resourceARNs []string) []string

	// Persistence
	Snapshot(ctx context.Context) []byte
	Restore(ctx context.Context, data []byte) error

	// Lifecycle
	Reset()
	AccountID() string
	Region() string
}

StorageBackend defines the interface for the AWS RAM in-memory backend. All mutating methods must be safe for concurrent use.

Jump to

Keyboard shortcuts

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