Documentation
¶
Index ¶
- Variables
- type Address
- type CreateGroupRequest
- type CreateUserRequest
- type Email
- type ExternalID
- type Group
- type GroupMembership
- type GroupMembershipExistence
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- 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) 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) CreateGroup(ctx context.Context, storeID string, req *CreateGroupRequest) (*Group, error)
- func (b *InMemoryBackend) CreateGroupMembership(ctx context.Context, storeID, groupID string, memberID MemberID) (*GroupMembership, error)
- func (b *InMemoryBackend) CreateUser(ctx context.Context, storeID string, req *CreateUserRequest) (*User, error)
- func (b *InMemoryBackend) DeleteGroup(ctx context.Context, storeID, groupID string) error
- func (b *InMemoryBackend) DeleteGroupMembership(ctx context.Context, storeID, membershipID string) error
- func (b *InMemoryBackend) DeleteUser(ctx context.Context, storeID, userID string) error
- func (b *InMemoryBackend) DescribeGroup(ctx context.Context, storeID, groupID string) (*Group, error)
- func (b *InMemoryBackend) DescribeGroupMembership(ctx context.Context, storeID, membershipID string) (*GroupMembership, error)
- func (b *InMemoryBackend) DescribeUser(ctx context.Context, storeID, userID string) (*User, error)
- func (b *InMemoryBackend) GetGroupID(ctx context.Context, storeID, attrPath, attrValue string) (string, error)
- func (b *InMemoryBackend) GetGroupMembershipID(ctx context.Context, storeID, groupID string, memberID MemberID) (string, error)
- func (b *InMemoryBackend) GetUserID(ctx context.Context, storeID, attrPath, attrValue string) (string, error)
- func (b *InMemoryBackend) IsMemberInGroups(ctx context.Context, storeID string, memberID MemberID, groupIDs []string) []GroupMembershipExistence
- func (b *InMemoryBackend) ListGroupMemberships(ctx context.Context, storeID, groupID string) []*GroupMembership
- func (b *InMemoryBackend) ListGroupMembershipsForMember(ctx context.Context, storeID string, memberID MemberID) []*GroupMembership
- func (b *InMemoryBackend) ListGroups(ctx context.Context, storeID string) []*Group
- func (b *InMemoryBackend) ListUsers(ctx context.Context, storeID string) []*User
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) UpdateGroup(ctx context.Context, storeID, groupID string, ops []attributeOperation) error
- func (b *InMemoryBackend) UpdateUser(ctx context.Context, storeID, userID string, ops []attributeOperation) error
- type ListFilter
- type MemberID
- type Name
- type PhoneNumber
- type Photo
- type Provider
- type Role
- type User
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUserNotFound is returned when a user is not found. ErrUserNotFound = errors.New("ResourceNotFoundException") // ErrGroupNotFound is returned when a group is not found. ErrGroupNotFound = errors.New("ResourceNotFoundException") // ErrMembershipNotFound is returned when a membership is not found. ErrMembershipNotFound = errors.New("ResourceNotFoundException") // ErrConflict is returned when a resource already exists. ErrConflict = errors.New("ConflictException") // ErrValidation is returned when request validation fails. ErrValidation = errors.New("ValidationException") )
Sentinel errors.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
Formatted string `json:"Formatted,omitempty"`
StreetAddress string `json:"StreetAddress,omitempty"`
Locality string `json:"Locality,omitempty"`
Region string `json:"Region,omitempty"`
PostalCode string `json:"PostalCode,omitempty"`
Country string `json:"Country,omitempty"`
Type string `json:"Type,omitempty"`
Primary bool `json:"Primary,omitempty"`
}
Address holds address information for a user.
type CreateGroupRequest ¶
type CreateGroupRequest struct {
DisplayName string `json:"DisplayName"`
Description string `json:"Description"`
ExternalIDs []ExternalID `json:"ExternalIds"`
}
CreateGroupRequest holds the parameters for creating a group.
type CreateUserRequest ¶
type CreateUserRequest struct {
UserName string `json:"UserName"`
DisplayName string `json:"DisplayName"`
NickName string `json:"NickName"`
Title string `json:"Title"`
ProfileURL string `json:"ProfileUrl"`
Locale string `json:"Locale"`
PreferredLang string `json:"PreferredLanguage"`
Timezone string `json:"Timezone"`
UserType string `json:"UserType"`
Birthdate string `json:"Birthdate"`
Website string `json:"Website"`
Name *Name `json:"Name"`
Emails []Email `json:"Emails"`
Addresses []Address `json:"Addresses"`
PhoneNumbers []PhoneNumber `json:"PhoneNumbers"`
Photos []Photo `json:"Photos"`
Roles []Role `json:"Roles"`
ExternalIDs []ExternalID `json:"ExternalIds"`
}
CreateUserRequest holds the parameters for creating a user.
type Email ¶
type Email struct {
Value string `json:"Value,omitempty"`
Type string `json:"Type,omitempty"`
Primary bool `json:"Primary,omitempty"`
}
Email holds email address information for a user.
type ExternalID ¶
ExternalID holds an external identity for a user (e.g. from SAML/SCIM providers).
type Group ¶
type Group struct {
GroupID string `json:"GroupId"`
IdentityStoreID string `json:"IdentityStoreId"`
DisplayName string `json:"DisplayName,omitempty"`
Description string `json:"Description,omitempty"`
ExternalIDs []ExternalID `json:"ExternalIds,omitempty"`
// contains filtered or unexported fields
}
Group represents an identity store group. Field order below is fieldalignment-optimal; see the note on User.
type GroupMembership ¶
type GroupMembership struct {
MembershipID string `json:"MembershipId"`
IdentityStoreID string `json:"IdentityStoreId"`
GroupID string `json:"GroupId"`
MemberID MemberID `json:"MemberId"`
// contains filtered or unexported fields
}
GroupMembership represents a group membership record.
type GroupMembershipExistence ¶
type GroupMembershipExistence struct {
GroupID string `json:"GroupId"`
MemberID MemberID `json:"MemberId"`
MembershipExists bool `json:"MembershipExists"`
}
GroupMembershipExistence is the result item for IsMemberInGroups.
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
}
Handler is the Echo HTTP handler for the Identity Store REST API.
func NewHandler ¶
func NewHandler(backend *InMemoryBackend) *Handler
NewHandler creates a new Identity Store handler.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this Identity Store instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the Identity Store operation name from the X-Amz-Target header.
func (*Handler) ExtractResource ¶
ExtractResource extracts the IdentityStoreId from the request body.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported Identity Store operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for Identity Store requests. The Identity Store SDK uses the JSON 1.1 protocol: POST / with X-Amz-Target header.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority. Uses PriorityHeaderExact since matching is by X-Amz-Target header.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches Identity Store JSON protocol requests. The SDK uses X-Amz-Target: AWSIdentityStore.{Operation} with POST to /.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the in-memory store for the Identity Store service.
Users, groups, and memberships were previously nested by region (map[region]map[id]*T, with IdentityStoreID carried as a field for per-store filtering within a region). Phase 3.3 flattens each into a single *store.Table keyed by the composite "region#id" string (regionKey in this file), with secondary *store.Index lookups replacing the old per-region reverse-lookup maps -- see store_setup.go for every key function and index, and persistence.go for how the hidden `region` field each value type carries is round-tripped through Snapshot/Restore. Callers must hold b.mu.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates a new InMemoryBackend with the given account and region.
func (*InMemoryBackend) CreateGroup ¶
func (b *InMemoryBackend) CreateGroup(ctx context.Context, storeID string, req *CreateGroupRequest) (*Group, error)
CreateGroup creates a new group in the identity store.
func (*InMemoryBackend) CreateGroupMembership ¶
func (b *InMemoryBackend) CreateGroupMembership( ctx context.Context, storeID, groupID string, memberID MemberID, ) (*GroupMembership, error)
CreateGroupMembership creates a membership between a user and a group.
func (*InMemoryBackend) CreateUser ¶
func (b *InMemoryBackend) CreateUser(ctx context.Context, storeID string, req *CreateUserRequest) (*User, error)
CreateUser creates a new user in the identity store.
func (*InMemoryBackend) DeleteGroup ¶
func (b *InMemoryBackend) DeleteGroup(ctx context.Context, storeID, groupID string) error
DeleteGroup removes a group from the identity store.
func (*InMemoryBackend) DeleteGroupMembership ¶
func (b *InMemoryBackend) DeleteGroupMembership(ctx context.Context, storeID, membershipID string) error
DeleteGroupMembership removes a membership.
func (*InMemoryBackend) DeleteUser ¶
func (b *InMemoryBackend) DeleteUser(ctx context.Context, storeID, userID string) error
DeleteUser removes a user from the identity store.
func (*InMemoryBackend) DescribeGroup ¶
func (b *InMemoryBackend) DescribeGroup(ctx context.Context, storeID, groupID string) (*Group, error)
DescribeGroup returns a group by ID.
func (*InMemoryBackend) DescribeGroupMembership ¶
func (b *InMemoryBackend) DescribeGroupMembership( ctx context.Context, storeID, membershipID string, ) (*GroupMembership, error)
DescribeGroupMembership returns a membership by ID.
func (*InMemoryBackend) DescribeUser ¶
DescribeUser returns a user by ID.
func (*InMemoryBackend) GetGroupID ¶
func (b *InMemoryBackend) GetGroupID(ctx context.Context, storeID, attrPath, attrValue string) (string, error)
GetGroupID looks up a group ID by alternate identifier (DisplayName or ExternalId).
func (*InMemoryBackend) GetGroupMembershipID ¶
func (b *InMemoryBackend) GetGroupMembershipID( ctx context.Context, storeID, groupID string, memberID MemberID, ) (string, error)
GetGroupMembershipID looks up a membership ID by group and member.
func (*InMemoryBackend) GetUserID ¶
func (b *InMemoryBackend) GetUserID(ctx context.Context, storeID, attrPath, attrValue string) (string, error)
GetUserID looks up a user ID by alternate identifier (UserName, email, or ExternalId).
func (*InMemoryBackend) IsMemberInGroups ¶
func (b *InMemoryBackend) IsMemberInGroups( ctx context.Context, storeID string, memberID MemberID, groupIDs []string, ) []GroupMembershipExistence
IsMemberInGroups checks which of the given groups contain the specified member. Uses the O(1) byGroupMember index instead of scanning all memberships.
func (*InMemoryBackend) ListGroupMemberships ¶
func (b *InMemoryBackend) ListGroupMemberships(ctx context.Context, storeID, groupID string) []*GroupMembership
ListGroupMemberships lists all memberships for a group, sorted by MembershipID.
func (*InMemoryBackend) ListGroupMembershipsForMember ¶
func (b *InMemoryBackend) ListGroupMembershipsForMember( ctx context.Context, storeID string, memberID MemberID, ) []*GroupMembership
ListGroupMembershipsForMember lists all group memberships for a given member, sorted by MembershipID.
func (*InMemoryBackend) ListGroups ¶
func (b *InMemoryBackend) ListGroups(ctx context.Context, storeID string) []*Group
ListGroups lists all groups for the given identity store, sorted by GroupID.
func (*InMemoryBackend) ListUsers ¶
func (b *InMemoryBackend) ListUsers(ctx context.Context, storeID string) []*User
ListUsers lists all users for the given identity store, sorted by UserID.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the backend default region.
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset clears all user, group, and membership state.
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) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON. It implements persistence.Persistable.
func (*InMemoryBackend) UpdateGroup ¶
func (b *InMemoryBackend) UpdateGroup(ctx context.Context, storeID, groupID string, ops []attributeOperation) error
UpdateGroup applies attribute operations to a group.
func (*InMemoryBackend) UpdateUser ¶
func (b *InMemoryBackend) UpdateUser(ctx context.Context, storeID, userID string, ops []attributeOperation) error
UpdateUser applies attribute operations to a user.
type ListFilter ¶
type ListFilter struct {
AttributePath string `json:"AttributePath"`
AttributeValue string `json:"AttributeValue"`
}
ListFilter is a single attribute-equality filter for list operations.
type MemberID ¶
type MemberID struct {
UserID string `json:"UserId,omitempty"`
}
MemberID holds a membership member reference.
type Name ¶
type Name struct {
Formatted string `json:"Formatted,omitempty"`
FamilyName string `json:"FamilyName,omitempty"`
GivenName string `json:"GivenName,omitempty"`
MiddleName string `json:"MiddleName,omitempty"`
HonorificPrefix string `json:"HonorificPrefix,omitempty"`
HonorificSuffix string `json:"HonorificSuffix,omitempty"`
}
Name holds a user's name components.
type PhoneNumber ¶
type PhoneNumber struct {
Value string `json:"Value,omitempty"`
Type string `json:"Type,omitempty"`
Primary bool `json:"Primary,omitempty"`
}
PhoneNumber holds phone number information for a user.
type Photo ¶
type Photo struct {
Value string `json:"Value"`
Display string `json:"Display,omitempty"`
Type string `json:"Type,omitempty"`
Primary bool `json:"Primary,omitempty"`
}
Photo holds photo information for a user. Users can have up to 3 photos.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for the Identity Store service.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the Identity Store service backend and handler.
type Role ¶
type Role struct {
Value string `json:"Value"`
Type string `json:"Type,omitempty"`
Primary bool `json:"Primary,omitempty"`
}
Role holds role information for a user.
type User ¶
type User struct {
Name *Name `json:"Name,omitempty"`
UserType string `json:"UserType,omitempty"`
Website string `json:"Website,omitempty"`
DisplayName string `json:"DisplayName,omitempty"`
NickName string `json:"NickName,omitempty"`
Title string `json:"Title,omitempty"`
ProfileURL string `json:"ProfileUrl,omitempty"`
Locale string `json:"Locale,omitempty"`
PreferredLang string `json:"PreferredLanguage,omitempty"`
Timezone string `json:"Timezone,omitempty"`
UserID string `json:"UserId"`
UserName string `json:"UserName,omitempty"`
UserStatus string `json:"UserStatus,omitempty"`
Birthdate string `json:"Birthdate,omitempty"`
IdentityStoreID string `json:"IdentityStoreId"`
Addresses []Address `json:"Addresses,omitempty"`
PhoneNumbers []PhoneNumber `json:"PhoneNumbers,omitempty"`
Photos []Photo `json:"Photos,omitempty"`
Roles []Role `json:"Roles,omitempty"`
ExternalIDs []ExternalID `json:"ExternalIds,omitempty"`
Emails []Email `json:"Emails,omitempty"`
// contains filtered or unexported fields
}
User represents an identity store user. Field order below is fieldalignment-optimal (computed on an isolated scratch copy per this repo's fieldalignment-fix protocol, then hand- applied here) rather than the semantic grouping a human would pick; do not reorder without re-running fieldalignment.