Documentation
¶
Index ¶
- Constants
- Variables
- func ValidateMatchingRule(rule string) error
- func ValidateStatement(stmt string) error
- type APIError
- type APIKey
- type Capabilities
- type Compartment
- type CompartmentFilter
- type ConfigProvider
- type CreateCompartmentIn
- type CreateDynamicGroupIn
- type CreateGroupIn
- type CreatePolicyIn
- type CreateTagDefaultIn
- type CreateTagIn
- type CreateTagNamespaceIn
- type CreateUserIn
- type Credential
- type DynamicGroup
- type Group
- 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) Shutdown(ctx context.Context)
- func (h *Handler) Snapshot(ctx context.Context) []byte
- func (h *Handler) StartWorker(ctx context.Context) error
- type InMemoryBackend
- func (b *InMemoryBackend) AddUserToGroup(userID, groupID string) (membershipWire, string, error)
- func (b *InMemoryBackend) CompartmentActive(id string) bool
- func (b *InMemoryBackend) CreateCompartment(in CreateCompartmentIn) (compartmentWire, string, error)
- func (b *InMemoryBackend) CreateCredential(userID string, kind credKind, text string) (credWire, string, error)
- func (b *InMemoryBackend) CreateDynamicGroup(in CreateDynamicGroupIn) (dynamicGroupWire, string, error)
- func (b *InMemoryBackend) CreateGroup(in CreateGroupIn) (Meta, string, error)
- func (b *InMemoryBackend) CreatePolicy(in CreatePolicyIn) (policyWire, string, error)
- func (b *InMemoryBackend) CreateTag(nsID string, in CreateTagIn) (tagWire, string, error)
- func (b *InMemoryBackend) CreateTagDefault(in CreateTagDefaultIn) (tagDefaultWire, string, error)
- func (b *InMemoryBackend) CreateTagNamespace(in CreateTagNamespaceIn) (tagNamespaceWire, string, error)
- func (b *InMemoryBackend) CreateUser(in CreateUserIn) (userWire, string, error)
- func (b *InMemoryBackend) DeleteAPIKey(userID, fingerprint string) error
- func (b *InMemoryBackend) DeleteCompartment(id, ifMatch string) (string, error)
- func (b *InMemoryBackend) DeleteCredential(userID, id string, kind credKind) error
- func (b *InMemoryBackend) DeleteDynamicGroup(id, ifMatch string) error
- func (b *InMemoryBackend) DeleteGroup(id, ifMatch string) error
- func (b *InMemoryBackend) DeletePolicy(id, ifMatch string) error
- func (b *InMemoryBackend) DeleteTag(nsID, name, ifMatch string) (string, error)
- func (b *InMemoryBackend) DeleteTagDefault(id string) error
- func (b *InMemoryBackend) DeleteTagNamespace(id, ifMatch string) error
- func (b *InMemoryBackend) DeleteUser(id, ifMatch string) error
- func (b *InMemoryBackend) GetCompartment(id string) (compartmentWire, string, error)
- func (b *InMemoryBackend) GetDynamicGroup(id string) (dynamicGroupWire, string, error)
- func (b *InMemoryBackend) GetGroup(id string) (Meta, string, error)
- func (b *InMemoryBackend) GetMembership(id string) (membershipWire, error)
- func (b *InMemoryBackend) GetPolicy(id string) (policyWire, string, error)
- func (b *InMemoryBackend) GetTag(nsID, name string) (tagWire, string, error)
- func (b *InMemoryBackend) GetTagDefault(id string) (tagDefaultWire, error)
- func (b *InMemoryBackend) GetTagNamespace(id string) (tagNamespaceWire, string, error)
- func (b *InMemoryBackend) GetTenancy(id string) (tenancyWire, error)
- func (b *InMemoryBackend) GetUIPasswordInfo(userID string) (uiPasswordWire, error)
- func (b *InMemoryBackend) GetUser(id string) (userWire, string, error)
- func (b *InMemoryBackend) GetWorkRequest(id string) (workRequestWire, error)
- func (b *InMemoryBackend) ListAPIKeys(userID string) ([]apiKeyWire, error)
- func (b *InMemoryBackend) ListAvailabilityDomains(compartment string) ([]adWire, error)
- func (b *InMemoryBackend) ListCompartments(f CompartmentFilter, o ListOpts) (page.Page[compartmentWire], error)
- func (b *InMemoryBackend) ListCredentials(userID string, kind credKind) ([]credWire, error)
- func (b *InMemoryBackend) ListDynamicGroups(f NameFilter, o ListOpts) (page.Page[dynamicGroupWire], error)
- func (b *InMemoryBackend) ListFaultDomains(compartment, ad string) ([]fdWire, error)
- func (b *InMemoryBackend) ListGroups(f NameFilter, o ListOpts) (page.Page[Meta], error)
- func (b *InMemoryBackend) ListMemberships(compartment, userID, groupID string, o ListOpts) (page.Page[membershipWire], error)
- func (b *InMemoryBackend) ListPolicies(f PolicyFilter, o ListOpts) (page.Page[policyWire], error)
- func (b *InMemoryBackend) ListRegionSubscriptions(id string) ([]regionSubWire, error)
- func (b *InMemoryBackend) ListTagDefaults(f TagDefaultFilter, o ListOpts) (page.Page[tagDefaultWire], error)
- func (b *InMemoryBackend) ListTagNamespaces(compartment, state string, subtree bool, o ListOpts) (page.Page[tagNamespaceWire], error)
- func (b *InMemoryBackend) ListTags(nsID, state string, o ListOpts) (page.Page[tagWire], error)
- func (b *InMemoryBackend) ListUsers(f NameFilter, o ListOpts) (page.Page[userWire], error)
- func (b *InMemoryBackend) ListWorkRequests(compartment, resourceID string, o ListOpts) (page.Page[workRequestWire], error)
- func (b *InMemoryBackend) MoveCompartment(id, target, ifMatch string) (string, error)
- func (b *InMemoryBackend) RecoverCompartment(id string) (compartmentWire, string, error)
- func (b *InMemoryBackend) RemoveUserFromGroup(id string) error
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) ResetUIPassword(userID string) (uiPasswordWire, string, error)
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) SetClock(now func() time.Time)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) Sweep()
- func (b *InMemoryBackend) UpdateCompartment(id, ifMatch string, in UpdateCompartmentIn) (compartmentWire, string, error)
- func (b *InMemoryBackend) UpdateCredential(userID, id string, kind credKind, text string) (credWire, string, error)
- func (b *InMemoryBackend) UpdateDynamicGroup(id, ifMatch string, in UpdateDynamicGroupIn) (dynamicGroupWire, string, error)
- func (b *InMemoryBackend) UpdateGroup(id, ifMatch string, in UpdateGroupIn) (Meta, string, error)
- func (b *InMemoryBackend) UpdatePolicy(id, ifMatch string, in UpdatePolicyIn) (policyWire, string, error)
- func (b *InMemoryBackend) UpdateTag(nsID, name, ifMatch string, in UpdateTagIn) (tagWire, string, error)
- func (b *InMemoryBackend) UpdateTagDefault(id string, in UpdateTagDefaultIn) (tagDefaultWire, string, error)
- func (b *InMemoryBackend) UpdateTagNamespace(id, ifMatch string, in UpdateTagNamespaceIn) (tagNamespaceWire, string, error)
- func (b *InMemoryBackend) UpdateUser(id, ifMatch string, in UpdateUserIn) (userWire, string, error)
- func (b *InMemoryBackend) UploadAPIKey(userID, pemKey string) (apiKeyWire, string, error)
- type Internal
- type ListOpts
- type Membership
- type Meta
- type NameFilter
- type Policy
- type PolicyFilter
- type Provider
- type Settings
- type TagDef
- type TagDefault
- type TagDefaultFilter
- type TagNamespace
- type Tags
- type UpdateCompartmentIn
- type UpdateDynamicGroupIn
- type UpdateGroupIn
- type UpdatePolicyIn
- type UpdateTagDefaultIn
- type UpdateTagIn
- type UpdateTagNamespaceIn
- type UpdateUserIn
- type User
- type WorkRequest
Constants ¶
const ( // Region is the home region of the emulated tenancy. Region = "us-ashburn-1" // TenancyID is the OCID of the emulated tenancy; it is also the root compartment id. TenancyID = "ocid1.tenancy.oc1..aaaaaaaagopherstackemulatedtenancy000000000000000000000000" )
const DefaultPort = 8153
DefaultPort is the dedicated listener's default TCP port.
Variables ¶
var ErrGrammar = errors.New("syntax error")
ErrGrammar marks a policy statement or matching rule that violates the documented grammar.
var ErrNilAppContext = errors.New("ociidentity: nil app context")
ErrNilAppContext is returned when Init is called with a nil AppContext.
var ErrSnapshotNull = errors.New("ociidentity: null entry in snapshot")
ErrSnapshotNull is returned when a snapshot contains a null entry.
Functions ¶
func ValidateMatchingRule ¶
ValidateMatchingRule checks a dynamic group rule: `ANY|ALL {condition, ...}`.
func ValidateStatement ¶
ValidateStatement checks one policy statement against the documented grammar (Allow, Deny, Define, Endorse and Admit).
Types ¶
type APIError ¶
APIError is an OCI error response: HTTP status plus the `code` and `message` body fields.
type APIKey ¶
type APIKey struct {
TimeCreated time.Time `json:"timeCreated"`
Fingerprint string `json:"fingerprint"`
PEM string `json:"pem"`
}
APIKey is an uploaded RSA public key.
type Capabilities ¶
type Capabilities struct {
CanUseConsolePassword bool `json:"canUseConsolePassword"`
CanUseAPIKeys bool `json:"canUseApiKeys"`
CanUseAuthTokens bool `json:"canUseAuthTokens"`
CanUseSMTPCredentials bool `json:"canUseSmtpCredentials"`
CanUseCustomerSecretKeys bool `json:"canUseCustomerSecretKeys"`
CanUseOAuth2ClientCredentials bool `json:"canUseOAuth2ClientCredentials"`
CanUseDBCredentials bool `json:"canUseDbCredentials"`
}
Capabilities are the per-user credential switches.
type Compartment ¶
Compartment is a stored compartment.
type CompartmentFilter ¶
type CompartmentFilter struct {
CompartmentID string
AccessLevel string
Name string
State string
Subtree bool
}
CompartmentFilter holds the ListCompartments query.
type ConfigProvider ¶
type ConfigProvider interface {
GetOCIIdentitySettings() Settings
}
ConfigProvider extracts OCI Identity configuration from the AppContext Config.
type CreateCompartmentIn ¶
type CreateCompartmentIn struct {
Tags
CompartmentID string `json:"compartmentId"`
Name string `json:"name"`
Description string `json:"description"`
}
CreateCompartmentIn is the CreateCompartment request body.
type CreateDynamicGroupIn ¶
type CreateDynamicGroupIn struct {
Tags
CompartmentID string `json:"compartmentId"`
Name string `json:"name"`
Description string `json:"description"`
MatchingRule string `json:"matchingRule"`
}
CreateDynamicGroupIn is the CreateDynamicGroup request body.
type CreateGroupIn ¶
type CreateGroupIn struct {
Tags
CompartmentID string `json:"compartmentId"`
Name string `json:"name"`
Description string `json:"description"`
}
CreateGroupIn is the CreateGroup request body.
type CreatePolicyIn ¶
type CreatePolicyIn struct {
Tags
VersionDate *string `json:"versionDate"`
CompartmentID string `json:"compartmentId"`
Name string `json:"name"`
Description string `json:"description"`
Statements []string `json:"statements"`
}
CreatePolicyIn is the CreatePolicy request body.
type CreateTagDefaultIn ¶
type CreateTagDefaultIn struct {
IsRequired *bool `json:"isRequired"`
CompartmentID string `json:"compartmentId"`
TagDefinitionID string `json:"tagDefinitionId"`
Value string `json:"value"`
}
CreateTagDefaultIn is the CreateTagDefault request body.
type CreateTagIn ¶
type CreateTagIn struct {
Validator map[string]any `json:"validator"`
IsCostTracking *bool `json:"isCostTracking"`
Tags
Name string `json:"name"`
Description string `json:"description"`
}
CreateTagIn is the CreateTag request body.
type CreateTagNamespaceIn ¶
type CreateTagNamespaceIn struct {
Tags
CompartmentID string `json:"compartmentId"`
Name string `json:"name"`
Description string `json:"description"`
}
CreateTagNamespaceIn is the CreateTagNamespace request body.
type CreateUserIn ¶
type CreateUserIn struct {
Tags
CompartmentID string `json:"compartmentId"`
Name string `json:"name"`
Description string `json:"description"`
Email string `json:"email"`
}
CreateUserIn is the CreateUser request body.
type Credential ¶
type Credential struct {
TimeCreated time.Time `json:"timeCreated"`
ID string `json:"id"`
Text string `json:"text"`
Username string `json:"username,omitempty"`
}
Credential is an auth token, customer secret key or SMTP credential; the secret itself is never stored.
type DynamicGroup ¶
type DynamicGroup struct {
Meta
MatchingRule string `json:"matchingRule"`
Internal Internal `json:"internal"`
}
DynamicGroup is a stored dynamic group.
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
Port int
EnforceAuth bool
// contains filtered or unexported fields
}
Handler serves OCI Identity (IAM API 20160918): tenancy, compartments, principals, policies, credentials, tags.
func NewHandler ¶
func NewHandler(backend *InMemoryBackend) *Handler
NewHandler creates a Handler; callers override Port and EnforceAuth from Settings.
func (*Handler) ExtractOperation ¶
ExtractOperation returns the operation name for metrics.
func (*Handler) ExtractResource ¶
ExtractResource returns the addressed resource id for metrics.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations lists the supported operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler for all OCI Identity requests.
func (*Handler) MatchPriority ¶
MatchPriority is irrelevant because RouteMatcher never matches.
func (*Handler) RouteMatcher ¶
RouteMatcher never matches: OCI Identity runs on its own listener.
type InMemoryBackend ¶
type InMemoryBackend struct {
// Auth is the API-key registry shared with the other OCI services.
Auth *ociauth.Registry
// contains filtered or unexported fields
}
InMemoryBackend holds all IAM state under one lock.
func NewInMemoryBackend ¶
func NewInMemoryBackend() *InMemoryBackend
NewInMemoryBackend creates an empty backend.
func (*InMemoryBackend) AddUserToGroup ¶
func (b *InMemoryBackend) AddUserToGroup(userID, groupID string) (membershipWire, string, error)
AddUserToGroup creates a membership.
func (*InMemoryBackend) CompartmentActive ¶
func (b *InMemoryBackend) CompartmentActive(id string) bool
CompartmentActive reports whether id is the tenancy or an ACTIVE compartment.
func (*InMemoryBackend) CreateCompartment ¶
func (b *InMemoryBackend) CreateCompartment(in CreateCompartmentIn) (compartmentWire, string, error)
CreateCompartment creates a compartment under the tenancy or another compartment.
func (*InMemoryBackend) CreateCredential ¶
func (b *InMemoryBackend) CreateCredential(userID string, kind credKind, text string) (credWire, string, error)
CreateCredential creates a credential and returns it with the secret, which is never retrievable again.
func (*InMemoryBackend) CreateDynamicGroup ¶
func (b *InMemoryBackend) CreateDynamicGroup(in CreateDynamicGroupIn) (dynamicGroupWire, string, error)
CreateDynamicGroup creates a dynamic group after validating its matching rule.
func (*InMemoryBackend) CreateGroup ¶
func (b *InMemoryBackend) CreateGroup(in CreateGroupIn) (Meta, string, error)
CreateGroup creates an IAM group.
func (*InMemoryBackend) CreatePolicy ¶
func (b *InMemoryBackend) CreatePolicy(in CreatePolicyIn) (policyWire, string, error)
CreatePolicy creates a policy after validating every statement.
func (*InMemoryBackend) CreateTag ¶
func (b *InMemoryBackend) CreateTag(nsID string, in CreateTagIn) (tagWire, string, error)
CreateTag creates a tag definition in a namespace.
func (*InMemoryBackend) CreateTagDefault ¶
func (b *InMemoryBackend) CreateTagDefault(in CreateTagDefaultIn) (tagDefaultWire, string, error)
CreateTagDefault creates a default value for a tag in a compartment.
func (*InMemoryBackend) CreateTagNamespace ¶
func (b *InMemoryBackend) CreateTagNamespace(in CreateTagNamespaceIn) (tagNamespaceWire, string, error)
CreateTagNamespace creates a tag namespace.
func (*InMemoryBackend) CreateUser ¶
func (b *InMemoryBackend) CreateUser(in CreateUserIn) (userWire, string, error)
CreateUser creates an IAM user.
func (*InMemoryBackend) DeleteAPIKey ¶
func (b *InMemoryBackend) DeleteAPIKey(userID, fingerprint string) error
DeleteAPIKey removes a key and stops verifying signatures made with it.
func (*InMemoryBackend) DeleteCompartment ¶
func (b *InMemoryBackend) DeleteCompartment(id, ifMatch string) (string, error)
DeleteCompartment starts the asynchronous deletion of an empty compartment and returns the work request id.
func (*InMemoryBackend) DeleteCredential ¶
func (b *InMemoryBackend) DeleteCredential(userID, id string, kind credKind) error
DeleteCredential removes a credential.
func (*InMemoryBackend) DeleteDynamicGroup ¶
func (b *InMemoryBackend) DeleteDynamicGroup(id, ifMatch string) error
DeleteDynamicGroup removes a dynamic group.
func (*InMemoryBackend) DeleteGroup ¶
func (b *InMemoryBackend) DeleteGroup(id, ifMatch string) error
DeleteGroup removes an empty group.
func (*InMemoryBackend) DeletePolicy ¶
func (b *InMemoryBackend) DeletePolicy(id, ifMatch string) error
DeletePolicy removes a policy.
func (*InMemoryBackend) DeleteTag ¶
func (b *InMemoryBackend) DeleteTag(nsID, name, ifMatch string) (string, error)
DeleteTag starts the asynchronous deletion of a tag definition and its defaults.
func (*InMemoryBackend) DeleteTagDefault ¶
func (b *InMemoryBackend) DeleteTagDefault(id string) error
DeleteTagDefault removes a tag default.
func (*InMemoryBackend) DeleteTagNamespace ¶
func (b *InMemoryBackend) DeleteTagNamespace(id, ifMatch string) error
DeleteTagNamespace removes a namespace that holds no tag definitions.
func (*InMemoryBackend) DeleteUser ¶
func (b *InMemoryBackend) DeleteUser(id, ifMatch string) error
DeleteUser removes a user that belongs to no group, along with its credentials.
func (*InMemoryBackend) GetCompartment ¶
func (b *InMemoryBackend) GetCompartment(id string) (compartmentWire, string, error)
GetCompartment returns one compartment (the tenancy id addresses the root compartment).
func (*InMemoryBackend) GetDynamicGroup ¶
func (b *InMemoryBackend) GetDynamicGroup(id string) (dynamicGroupWire, string, error)
GetDynamicGroup returns one dynamic group.
func (*InMemoryBackend) GetGroup ¶
func (b *InMemoryBackend) GetGroup(id string) (Meta, string, error)
GetGroup returns one group.
func (*InMemoryBackend) GetMembership ¶
func (b *InMemoryBackend) GetMembership(id string) (membershipWire, error)
GetMembership returns one membership.
func (*InMemoryBackend) GetPolicy ¶
func (b *InMemoryBackend) GetPolicy(id string) (policyWire, string, error)
GetPolicy returns one policy.
func (*InMemoryBackend) GetTag ¶
func (b *InMemoryBackend) GetTag(nsID, name string) (tagWire, string, error)
GetTag returns one tag definition.
func (*InMemoryBackend) GetTagDefault ¶
func (b *InMemoryBackend) GetTagDefault(id string) (tagDefaultWire, error)
GetTagDefault returns one tag default.
func (*InMemoryBackend) GetTagNamespace ¶
func (b *InMemoryBackend) GetTagNamespace(id string) (tagNamespaceWire, string, error)
GetTagNamespace returns one namespace.
func (*InMemoryBackend) GetTenancy ¶
func (b *InMemoryBackend) GetTenancy(id string) (tenancyWire, error)
GetTenancy returns the emulated tenancy.
func (*InMemoryBackend) GetUIPasswordInfo ¶
func (b *InMemoryBackend) GetUIPasswordInfo(userID string) (uiPasswordWire, error)
GetUIPasswordInfo returns the console password metadata (never the password).
func (*InMemoryBackend) GetUser ¶
func (b *InMemoryBackend) GetUser(id string) (userWire, string, error)
GetUser returns one user.
func (*InMemoryBackend) GetWorkRequest ¶
func (b *InMemoryBackend) GetWorkRequest(id string) (workRequestWire, error)
GetWorkRequest returns one work request.
func (*InMemoryBackend) ListAPIKeys ¶
func (b *InMemoryBackend) ListAPIKeys(userID string) ([]apiKeyWire, error)
ListAPIKeys lists a user's API keys.
func (*InMemoryBackend) ListAvailabilityDomains ¶
func (b *InMemoryBackend) ListAvailabilityDomains(compartment string) ([]adWire, error)
ListAvailabilityDomains returns the region's availability domains.
func (*InMemoryBackend) ListCompartments ¶
func (b *InMemoryBackend) ListCompartments(f CompartmentFilter, o ListOpts) (page.Page[compartmentWire], error)
ListCompartments lists the children (or the whole subtree) of a compartment.
func (*InMemoryBackend) ListCredentials ¶
func (b *InMemoryBackend) ListCredentials(userID string, kind credKind) ([]credWire, error)
ListCredentials lists a user's credentials of one kind, without secrets.
func (*InMemoryBackend) ListDynamicGroups ¶
func (b *InMemoryBackend) ListDynamicGroups(f NameFilter, o ListOpts) (page.Page[dynamicGroupWire], error)
ListDynamicGroups lists dynamic groups.
func (*InMemoryBackend) ListFaultDomains ¶
func (b *InMemoryBackend) ListFaultDomains(compartment, ad string) ([]fdWire, error)
ListFaultDomains returns the three fault domains of an availability domain.
func (*InMemoryBackend) ListGroups ¶
func (b *InMemoryBackend) ListGroups(f NameFilter, o ListOpts) (page.Page[Meta], error)
ListGroups lists groups.
func (*InMemoryBackend) ListMemberships ¶
func (b *InMemoryBackend) ListMemberships( compartment, userID, groupID string, o ListOpts, ) (page.Page[membershipWire], error)
ListMemberships lists memberships filtered by user and/or group.
func (*InMemoryBackend) ListPolicies ¶
func (b *InMemoryBackend) ListPolicies(f PolicyFilter, o ListOpts) (page.Page[policyWire], error)
ListPolicies lists the policies of one compartment.
func (*InMemoryBackend) ListRegionSubscriptions ¶
func (b *InMemoryBackend) ListRegionSubscriptions(id string) ([]regionSubWire, error)
ListRegionSubscriptions returns the single home-region subscription.
func (*InMemoryBackend) ListTagDefaults ¶
func (b *InMemoryBackend) ListTagDefaults(f TagDefaultFilter, o ListOpts) (page.Page[tagDefaultWire], error)
ListTagDefaults lists tag defaults filtered by id, compartment or tag.
func (*InMemoryBackend) ListTagNamespaces ¶
func (b *InMemoryBackend) ListTagNamespaces( compartment, state string, subtree bool, o ListOpts, ) (page.Page[tagNamespaceWire], error)
ListTagNamespaces lists the namespaces of a compartment.
func (*InMemoryBackend) ListUsers ¶
func (b *InMemoryBackend) ListUsers(f NameFilter, o ListOpts) (page.Page[userWire], error)
ListUsers lists users.
func (*InMemoryBackend) ListWorkRequests ¶
func (b *InMemoryBackend) ListWorkRequests( compartment, resourceID string, o ListOpts, ) (page.Page[workRequestWire], error)
ListWorkRequests lists the work requests of a compartment, optionally for one resource.
func (*InMemoryBackend) MoveCompartment ¶
func (b *InMemoryBackend) MoveCompartment(id, target, ifMatch string) (string, error)
MoveCompartment re-parents a compartment tree and returns the work request id.
func (*InMemoryBackend) RecoverCompartment ¶
func (b *InMemoryBackend) RecoverCompartment(id string) (compartmentWire, string, error)
RecoverCompartment restores a DELETED compartment to ACTIVE.
func (*InMemoryBackend) RemoveUserFromGroup ¶
func (b *InMemoryBackend) RemoveUserFromGroup(id string) error
RemoveUserFromGroup deletes a membership.
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset clears all state and the registered API keys.
func (*InMemoryBackend) ResetUIPassword ¶
func (b *InMemoryBackend) ResetUIPassword(userID string) (uiPasswordWire, string, error)
ResetUIPassword generates a console password; it is returned only here.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a snapshot.
func (*InMemoryBackend) SetClock ¶
func (b *InMemoryBackend) SetClock(now func() time.Time)
SetClock injects the time source used for lifecycle transitions.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state, including registered API keys.
func (*InMemoryBackend) Sweep ¶
func (b *InMemoryBackend) Sweep()
Sweep applies due lifecycle transitions.
func (*InMemoryBackend) UpdateCompartment ¶
func (b *InMemoryBackend) UpdateCompartment( id, ifMatch string, in UpdateCompartmentIn, ) (compartmentWire, string, error)
UpdateCompartment changes name, description and tags.
func (*InMemoryBackend) UpdateCredential ¶
func (b *InMemoryBackend) UpdateCredential(userID, id string, kind credKind, text string) (credWire, string, error)
UpdateCredential changes the description or display name.
func (*InMemoryBackend) UpdateDynamicGroup ¶
func (b *InMemoryBackend) UpdateDynamicGroup( id, ifMatch string, in UpdateDynamicGroupIn, ) (dynamicGroupWire, string, error)
UpdateDynamicGroup changes description, matching rule and tags.
func (*InMemoryBackend) UpdateGroup ¶
func (b *InMemoryBackend) UpdateGroup(id, ifMatch string, in UpdateGroupIn) (Meta, string, error)
UpdateGroup changes description and tags.
func (*InMemoryBackend) UpdatePolicy ¶
func (b *InMemoryBackend) UpdatePolicy(id, ifMatch string, in UpdatePolicyIn) (policyWire, string, error)
UpdatePolicy changes description, statements, versionDate and tags.
func (*InMemoryBackend) UpdateTag ¶
func (b *InMemoryBackend) UpdateTag(nsID, name, ifMatch string, in UpdateTagIn) (tagWire, string, error)
UpdateTag changes a tag definition.
func (*InMemoryBackend) UpdateTagDefault ¶
func (b *InMemoryBackend) UpdateTagDefault(id string, in UpdateTagDefaultIn) (tagDefaultWire, string, error)
UpdateTagDefault changes the value or requirement of a tag default.
func (*InMemoryBackend) UpdateTagNamespace ¶
func (b *InMemoryBackend) UpdateTagNamespace( id, ifMatch string, in UpdateTagNamespaceIn, ) (tagNamespaceWire, string, error)
UpdateTagNamespace changes description, retirement and tags.
func (*InMemoryBackend) UpdateUser ¶
func (b *InMemoryBackend) UpdateUser(id, ifMatch string, in UpdateUserIn) (userWire, string, error)
UpdateUser changes description, email and tags.
func (*InMemoryBackend) UploadAPIKey ¶
func (b *InMemoryBackend) UploadAPIKey(userID, pemKey string) (apiKeyWire, string, error)
UploadAPIKey registers an RSA public key for a user and with the shared signature registry.
type Internal ¶
type Internal struct {
TransitionAt *time.Time `json:"transitionAt,omitempty"`
TimeDeleted *time.Time `json:"timeDeleted,omitempty"`
Etag string `json:"etag"`
Seq int64 `json:"seq"`
}
Internal is bookkeeping that never reaches the wire.
type Membership ¶
type Membership struct {
TimeCreated time.Time `json:"timeCreated"`
ID string `json:"id"`
CompartmentID string `json:"compartmentId"`
GroupID string `json:"groupId"`
UserID string `json:"userId"`
Seq int64 `json:"seq"`
}
Membership links a user to a group.
type Meta ¶
type Meta struct {
TimeCreated time.Time `json:"timeCreated"`
Tags
ID string `json:"id"`
CompartmentID string `json:"compartmentId"`
Name string `json:"name"`
Description string `json:"description"`
LifecycleState string `json:"lifecycleState"`
}
Meta is the field set common to compartments, users, groups, dynamic groups and policies.
type NameFilter ¶
NameFilter holds the common list filters of tenancy-level resources.
type Policy ¶
type Policy struct {
Meta
VersionDate string `json:"versionDate,omitempty"`
Statements []string `json:"statements"`
Internal Internal `json:"internal"`
}
Policy is a stored IAM policy.
type PolicyFilter ¶
PolicyFilter holds the ListPolicies query.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for OCI Identity. It runs on its own listener (see Handler.StartWorker) and never matches on the shared AWS router.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init creates the backend and handler; the port is bound in StartWorker.
type Settings ¶
type Settings struct {
Port int `` //nolint:lll // config struct tags are intentionally verbose
/* 190-byte string literal not displayed */
EnforceAuth bool `` //nolint:lll // config struct tags are intentionally verbose
/* 224-byte string literal not displayed */
}
Settings holds service-level configuration, embedded in the root CLI command as CLI.OCIIdentity.
func DefaultSettings ¶
func DefaultSettings() Settings
DefaultSettings returns the settings used when no ConfigProvider is available.
type TagDef ¶
type TagDef struct {
Meta
NamespaceID string `json:"namespaceId"`
NamespaceName string `json:"namespaceName"`
Validator map[string]any `json:"validator,omitempty"`
Internal Internal `json:"internal"`
IsRetired bool `json:"isRetired"`
IsCostTrack bool `json:"isCostTracking"`
}
TagDef is a stored tag definition.
type TagDefault ¶
type TagDefault struct {
TimeCreated time.Time `json:"timeCreated"`
ID string `json:"id"`
CompartmentID string `json:"compartmentId"`
NamespaceID string `json:"namespaceId"`
TagID string `json:"tagId"`
TagName string `json:"tagName"`
Value string `json:"value"`
Seq int64 `json:"seq"`
IsRequired bool `json:"isRequired"`
}
TagDefault is a stored tag default.
type TagDefaultFilter ¶
type TagDefaultFilter struct {
ID, CompartmentID, TagDefinitionID, State string
}
TagDefaultFilter holds the ListTagDefaults query.
type TagNamespace ¶
type TagNamespace struct {
Meta
Internal Internal `json:"internal"`
IsRetired bool `json:"isRetired"`
}
TagNamespace is a stored tag namespace.
type Tags ¶
type Tags struct {
FreeformTags map[string]string `json:"freeformTags"`
DefinedTags map[string]map[string]any `json:"definedTags"`
}
Tags carries the freeform and defined tags every taggable resource has.
type UpdateCompartmentIn ¶
type UpdateCompartmentIn struct {
Name *string `json:"name"`
Description *string `json:"description"`
Tags
}
UpdateCompartmentIn is the UpdateCompartment request body.
type UpdateDynamicGroupIn ¶
type UpdateDynamicGroupIn struct {
Description *string `json:"description"`
MatchingRule *string `json:"matchingRule"`
Tags
}
UpdateDynamicGroupIn is the UpdateDynamicGroup request body.
type UpdateGroupIn ¶
UpdateGroupIn is the UpdateGroup request body.
type UpdatePolicyIn ¶
type UpdatePolicyIn struct {
Tags
Description *string `json:"description"`
VersionDate *string `json:"versionDate"`
Statements []string `json:"statements"`
}
UpdatePolicyIn is the UpdatePolicy request body.
type UpdateTagDefaultIn ¶
UpdateTagDefaultIn is the UpdateTagDefault request body.
type UpdateTagIn ¶
type UpdateTagIn struct {
Description *string `json:"description"`
IsRetired *bool `json:"isRetired"`
IsCostTracking *bool `json:"isCostTracking"`
Validator map[string]any `json:"validator"`
Tags
}
UpdateTagIn is the UpdateTag request body.
type UpdateTagNamespaceIn ¶
type UpdateTagNamespaceIn struct {
Description *string `json:"description"`
IsRetired *bool `json:"isRetired"`
Tags
}
UpdateTagNamespaceIn is the UpdateTagNamespace request body.
type UpdateUserIn ¶
type UpdateUserIn struct {
Description *string `json:"description"`
Email *string `json:"email"`
DBUserName *string `json:"dbUserName"`
Tags
}
UpdateUserIn is the UpdateUser request body.
type User ¶
type User struct {
UIPasswordCreated *time.Time `json:"uiPasswordCreated,omitempty"`
Meta
Email string `json:"email,omitempty"`
DBUserName string `json:"dbUserName,omitempty"`
Internal Internal `json:"internal"`
APIKeys []APIKey `json:"apiKeys"`
AuthTokens []Credential `json:"authTokens"`
SecretKeys []Credential `json:"secretKeys"`
SMTP []Credential `json:"smtp"`
Capabilities Capabilities `json:"capabilities"`
}
User is a stored IAM user with its credentials.
type WorkRequest ¶
type WorkRequest struct {
Accepted time.Time `json:"accepted"`
FinishAt time.Time `json:"finishAt"`
ID string `json:"id"`
Operation string `json:"operation"`
CompartmentID string `json:"compartmentId"`
EntityType string `json:"entityType"`
EntityID string `json:"entityId"`
Action string `json:"action"`
Seq int64 `json:"seq"`
}
WorkRequest tracks an asynchronous compartment or tag operation.