Help us shape the future of Go! Take the 2026 Go Developer Survey

ociidentity

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 33 Imported by: 0

README

OCI Identity

Parity grade: B · SDK github.com/oracle/oci-go-sdk/v65@v65.126.2 · last audited 2026-10-25 (0d22fe6b7)

Coverage

Metric Value
PARITY entries audited 70 (50 ok, 20 partial)
Feature families 6 (5 ok, 1 partial)
Known gaps 9
Deferred items 0
Resource leaks unknown
Known gaps
  • IAM policy enforcement is not implemented: policies and dynamic groups are stored and validated but never evaluated, so no request is authorised or denied by them; any verified principal may call any operation.
  • Identity domains (domains, SCIM-style users, MFA devices, OAuth2 client credentials, DB credentials, Swift passwords), identity providers and group mappings, network sources, authentication policy and the tenancy-level region subscription, tag namespace compartment moves and cascade delete, bulk tag operations, tag retire/reactivate as separate operations, standard tag templates, and IAM work request logs/errors are not implemented.
  • Customer secret keys, auth tokens, SMTP credentials and the UI password are generated and listed but not stored, so they cannot be used for S3-compatible, registry, SMTP or console authentication.
  • DeleteCompartment only checks the IAM resources it owns; resources other emulated OCI services keep in a compartment do not block deletion.
  • Statement subjects and locations are parsed but group, dynamic-group and compartment names are not resolved against existing resources, and variable and resource-type names are not checked against the documented lists.
  • Error codes and statuses for duplicate names, per-user credential limits and tenancy limits (400 LimitExceeded, 409 Conflict) and the MOVE_COMPARTMENT operation type are unverified against the live service.
  • Dynamic group matchingRule supports a single ANY or ALL group of simple comparisons; the documented variable set is not enforced.
  • Access levels are not modelled: accessLevel is validated but every caller sees every compartment, and inactive states other than DELETING and DELETED are never produced.
  • opc-retry-token idempotency, resource principals and instance principals are not applied; only API-key signatures are verified.

More

Documentation

Index

Constants

View Source
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"
)
View Source
const DefaultPort = 8153

DefaultPort is the dedicated listener's default TCP port.

Variables

View Source
var ErrGrammar = errors.New("syntax error")

ErrGrammar marks a policy statement or matching rule that violates the documented grammar.

View Source
var ErrNilAppContext = errors.New("ociidentity: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

View Source
var ErrSnapshotNull = errors.New("ociidentity: null entry in snapshot")

ErrSnapshotNull is returned when a snapshot contains a null entry.

Functions

func ValidateMatchingRule

func ValidateMatchingRule(rule string) error

ValidateMatchingRule checks a dynamic group rule: `ANY|ALL {condition, ...}`.

func ValidateStatement

func ValidateStatement(stmt string) error

ValidateStatement checks one policy statement against the documented grammar (Allow, Deny, Define, Endorse and Admit).

Types

type APIError

type APIError struct {
	Code    string
	Message string
	Status  int
}

APIError is an OCI error response: HTTP status plus the `code` and `message` body fields.

func (*APIError) Error

func (e *APIError) Error() string

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

type Compartment struct {
	Meta
	Internal Internal `json:"internal"`
}

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 Group

type Group struct {
	Meta
	Internal Internal `json:"internal"`
}

Group is a stored IAM 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

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

ExtractOperation returns the operation name for metrics.

func (*Handler) ExtractResource

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

ExtractResource returns the addressed resource id for metrics.

func (*Handler) GetSupportedOperations

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

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

func (h *Handler) MatchPriority() int

MatchPriority is irrelevant because RouteMatcher never matches.

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.

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 never matches: OCI Identity runs on its own listener.

func (*Handler) Shutdown

func (h *Handler) Shutdown(ctx context.Context)

Shutdown stops the listener and the sweeper.

func (*Handler) Snapshot

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

Snapshot implements persistence.Persistable by delegating to the backend.

func (*Handler) StartWorker

func (h *Handler) StartWorker(ctx context.Context) error

StartWorker binds the dedicated listener synchronously so a port conflict is returned to the caller.

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) ListTags

func (b *InMemoryBackend) ListTags(nsID, state string, o ListOpts) (page.Page[tagWire], error)

ListTags lists the tag definitions of a namespace.

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 ListOpts

type ListOpts struct {
	SortBy string
	Order  string
	Page   string
	Limit  int
}

ListOpts carries the shared list query parameters.

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

type NameFilter struct {
	CompartmentID string
	Name          string
	State         string
}

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

type PolicyFilter struct {
	CompartmentID string
	Name          string
	State         string
}

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

Init creates the backend and handler; the port is bound in StartWorker.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the service provider name.

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

type UpdateGroupIn struct {
	Description *string `json:"description"`
	Tags
}

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

type UpdateTagDefaultIn struct {
	IsRequired *bool  `json:"isRequired"`
	Value      string `json:"value"`
}

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.

Jump to

Keyboard shortcuts

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