sdk

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Production
	ServerProd string = "prod"
)

Variables

View Source
var ServerList = map[string]string{
	ServerProd: "https://api.opal.dev/v1",
}

ServerList contains the list of servers available to the SDK

Functions

func Bool

func Bool(b bool) *bool

Bool provides a helper function to return a pointer to a bool

func Float32

func Float32(f float32) *float32

Float32 provides a helper function to return a pointer to a float32

func Float64

func Float64(f float64) *float64

Float64 provides a helper function to return a pointer to a float64

func Int

func Int(i int) *int

Int provides a helper function to return a pointer to an int

func Int64

func Int64(i int64) *int64

Int64 provides a helper function to return a pointer to an int64

func Pointer

func Pointer[T any](v T) *T

Pointer provides a helper function to return a pointer to a type

func String

func String(s string) *string

String provides a helper function to return a pointer to a string

Types

type AccessRules

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

AccessRules - Operations related to access rules

func (*AccessRules) CreateAccessRule

CreateAccessRule - Creates a new access rule config for the given group_id.

func (*AccessRules) GetAccessRule

GetAccessRule - Returns a list of access rule config given the group_id of the access rule.

func (*AccessRules) UpdateAccessRule

UpdateAccessRule - Updates the access rule config for the given group_id.

type Apps

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

Apps - Operations related to apps

func (*Apps) Get

Get - Returns a list of `App` objects.

func (*Apps) GetID

GetID - Returns an `App` object.

func (*Apps) GetSyncErrors

GetSyncErrors - Returns a list of recent sync errors that have occurred since the last successful sync.

type Bundles

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

Bundles - Operations related to bundles

func (*Bundles) AddBundleGroup

AddBundleGroup - Adds a group to a bundle.

func (*Bundles) AddBundleResource

AddBundleResource - Adds a resource to a bundle.

func (*Bundles) CreateBundle

CreateBundle - Creates a bundle.

func (*Bundles) DeleteBundle

DeleteBundle - Deletes a bundle.

func (*Bundles) GetBundle

GetBundle - Returns a `Bundle` object.

func (*Bundles) GetBundleGroups

GetBundleGroups - Returns a list of `Group` objects in a given bundle.

func (*Bundles) GetBundleResources

GetBundleResources - Returns a list of `Resource` objects in a given bundle.

func (*Bundles) GetBundleVisibility

GetBundleVisibility - Gets the visibility of the bundle.

func (*Bundles) GetBundles

GetBundles - Returns a list of `Bundle` objects.

func (*Bundles) RemoveBundleGroup

RemoveBundleGroup - Removes a group from a bundle.

func (*Bundles) RemoveBundleResource

RemoveBundleResource - Removes a resource from a bundle.

func (*Bundles) SetBundleVisibility

SetBundleVisibility - Sets the visibility of the bundle.

func (*Bundles) UpdateBundle

UpdateBundle - Updates a bundle.

type ConfigurationTemplates

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

ConfigurationTemplates - Operations related to configuration templates

func (*ConfigurationTemplates) Create

Create - Creates a configuration template.

func (*ConfigurationTemplates) Delete

Delete - Deletes a configuration template.

func (*ConfigurationTemplates) Get

Get - Returns a list of `ConfigurationTemplate` objects.

func (*ConfigurationTemplates) Update

Update a configuration template.

type Events

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

Events - Operations related to events

func (*Events) Get

Get - Returns a list of `Event` objects.

type GroupBindings

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

GroupBindings - Operations related to group bindings

func (*GroupBindings) CreateGroupBinding

CreateGroupBinding - Creates a group binding.

func (*GroupBindings) DeleteGroupBinding

DeleteGroupBinding - Deletes a group binding.

func (*GroupBindings) GetGroupBinding

GetGroupBinding - Returns a `GroupBinding` object.

func (*GroupBindings) GetGroupBindings

GetGroupBindings - Returns a list of `GroupBinding` objects.

func (*GroupBindings) UpdateGroupBindings

UpdateGroupBindings - Bulk updates a list of group bindings.

type Groups

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

Groups - Operations related to groups

func (*Groups) AddGroupContainingGroup

AddGroupContainingGroup - Creates a new containing group.

func (*Groups) Create

Create - Creates a group. See [here](https://docs.opal.dev/reference/end-system-objects) for details about importing groups.

func (*Groups) CreateResources

CreateResources - Adds a resource to a group.

func (*Groups) CreateUser

CreateUser - Adds a user to this group.

func (*Groups) Delete

Delete - Deletes a group.

func (*Groups) DeleteUser

DeleteUser - Removes a user's access from this group.

func (*Groups) GetGroup

GetGroup - Returns a `Group` object.

func (*Groups) GetGroupContainingGroup

GetGroupContainingGroup - Gets a specific containing group for a group.

func (*Groups) GetMessageChannels

GetMessageChannels - Gets the list of audit and reviewer message channels attached to a group.

func (*Groups) GetOnCallSchedules added in v3.2.0

GetOnCallSchedules - Gets the list of on call schedules attached to a group.

func (*Groups) GetResources

GetResources - Gets the list of resources that the group gives access to.

func (*Groups) GetReviewersStages deprecated

GetReviewersStages - Gets the list of reviewer stages for a group.

Deprecated: This will be removed in a future release, please migrate away from it as soon as possible.

func (*Groups) GetTags

GetTags - Returns all tags applied to the group.

func (*Groups) GetUsers

GetUsers - Gets the list of users for this group.

func (*Groups) GetVisibility

GetVisibility - Gets the visibility of this group.

func (*Groups) List

List - Returns a list of groups for your organization.

func (*Groups) RemoveGroupContainingGroup

RemoveGroupContainingGroup - Removes a containing group from a group.

func (*Groups) Update

Update - Bulk updates a list of groups.

func (*Groups) UpdateGroupUser

UpdateGroupUser - Updates a user's access level or duration in this group.

func (*Groups) UpdateMessageChannels

UpdateMessageChannels - Sets the list of audit message channels attached to a group.

func (*Groups) UpdateOnCallSchedules added in v3.2.0

UpdateOnCallSchedules - Sets the list of on call schedules attached to a group.

func (*Groups) UpdateResources

UpdateResources - Sets the list of resources that the group gives access to.

func (*Groups) UpdateReviewersStages deprecated

UpdateReviewersStages - Sets the list of reviewer stages for a group.

Deprecated: This will be removed in a future release, please migrate away from it as soon as possible.

func (*Groups) UpdateVisibility

UpdateVisibility - Sets the visibility of this group.

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient provides an interface for supplying the SDK with a custom HTTP client

type IdpGroupMappings

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

IdpGroupMappings - Operations related to IDP group mappings

func (*IdpGroupMappings) CreateIdpGroupMapping added in v3.2.0

CreateIdpGroupMapping - Creates or updates an individual `IdpGroupMapping` object (upsert operation).

**Behavior:** - If the mapping doesn't exist, it will be created with the provided values - If the mapping exists, only the fields provided in the request will be updated

func (*IdpGroupMappings) DeleteIdpGroupMappings

DeleteIdpGroupMappings - Deletes an `IdpGroupMapping` object.

func (*IdpGroupMappings) GetIdpGroupMappings

GetIdpGroupMappings - Returns the configured set of available `IdpGroupMapping` objects for an Okta app.

func (*IdpGroupMappings) UpdateIdpGroupMappings

UpdateIdpGroupMappings - Updates the list of available `IdpGroupMapping` objects for an Okta app.

type MessageChannels

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

MessageChannels - Operations related to message channels

func (*MessageChannels) Create

Create - Creates a `MessageChannel` objects.

func (*MessageChannels) Get

Get - Returns a list of `MessageChannel` objects.

func (*MessageChannels) GetID

GetID - Gets a `MessageChannel` object.

type NonHumanIdentities

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

NonHumanIdentities - Operations related to non-human identities

func (*NonHumanIdentities) GetNhis

GetNhis - Returns a list of non-human identities for your organization.

type OnCallSchedules

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

OnCallSchedules - Operations related to on-call schedules

func (*OnCallSchedules) Create

Create - Creates a `OnCallSchedule` objects.

func (*OnCallSchedules) Get

Get - Returns a list of `OnCallSchedule` objects.

func (*OnCallSchedules) GetID

GetID - Gets a `OnCallSchedule` object.

type OpalAPI

type OpalAPI struct {
	SDKVersion string
	// Operations related to access rules
	AccessRules *AccessRules
	// Operations related to apps
	Apps *Apps
	// Operations related to bundles
	Bundles *Bundles
	// Operations related to configuration templates
	ConfigurationTemplates *ConfigurationTemplates
	// Operations related to events
	Events *Events
	// Operations related to group bindings
	GroupBindings *GroupBindings
	// Operations related to groups
	Groups *Groups
	// Operations related to IDP group mappings
	IdpGroupMappings *IdpGroupMappings
	// Operations related to message channels
	MessageChannels *MessageChannels
	// Operations related to non-human identities
	NonHumanIdentities *NonHumanIdentities
	// Operations related to on-call schedules
	OnCallSchedules *OnCallSchedules
	// Operations related to owners
	Owners *Owners
	// Operations related to requests
	Requests *Requests
	// Operations related to resources
	Resources *Resources
	// Operations related to sessions
	Sessions *Sessions
	// Operations related to tags
	Tags *Tags
	// Operations related to UARs
	Uars *Uars
	// Operations related to users
	Users *Users
	// contains filtered or unexported fields
}

OpalAPI - Opal API: The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically.

func New

func New(opts ...SDKOption) *OpalAPI

New creates a new instance of the SDK with the provided options

type Owners

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

Owners - Operations related to owners

func (*Owners) Create

Create - Creates an owner.

func (*Owners) Delete

Delete - Deletes an owner.

func (*Owners) Get

Get - Returns a list of `Owner` objects.

func (*Owners) GetFromName

GetFromName - Returns an `Owner` object. Does not support owners with `/` in their name, use /owners?name=... instead.

func (*Owners) GetID

GetID - Returns an `Owner` object.

func (*Owners) Update

Update - Bulk updates a list of owners.

func (*Owners) UpdateUsers

UpdateUsers - Sets the list of users for this owner. If escalation is enabled, the order of this list is the escalation priority order of the users. If the owner has a source group, adding or removing users from this list won't be possible.

type Requests

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

Requests - Operations related to requests

func (*Requests) ApproveRequest

ApproveRequest - Approve an access request

func (*Requests) CreateRequest

CreateRequest - Create an access request

func (*Requests) Get

Get - Returns a list of requests for your organization that is visible by the admin.

func (*Requests) GetRequest

GetRequest - Returns a request by ID.

func (*Requests) GetRequestsRelay deprecated

GetRequestsRelay - Returns a paginated list of requests using Relay-style cursor pagination.

Deprecated: This will be removed in a future release, please migrate away from it as soon as possible.

type Resources

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

Resources - Operations related to resources

func (*Resources) AddResourceNhi

AddResourceNhi - Gives a non-human identity access to this resource.

func (*Resources) Create

Create - Creates a resource. See [here](https://docs.opal.dev/reference/end-system-objects) for details about importing resources.

func (*Resources) Delete

Delete - Deletes a resource.

func (*Resources) DeleteResourceNhi

DeleteResourceNhi - Removes a non-human identity's direct access from this resource.

func (*Resources) Get

Get - Returns a list of resources for your organization.

func (*Resources) GetAccessStatus deprecated

GetAccessStatus - Get user's access status to a resource.

Deprecated: This will be removed in a future release, please migrate away from it as soon as possible.

func (*Resources) GetID

GetID - Retrieves a resource.

func (*Resources) GetMessageChannels

GetMessageChannels - Gets the list of audit message channels attached to a resource.

func (*Resources) GetResourceNhis

GetResourceNhis - Gets the list of non-human identities with access to this resource.

func (*Resources) GetReviewers

GetReviewers - Gets the list of owner IDs of the reviewers for a resource.

func (*Resources) GetScopedRolePermissions

GetScopedRolePermissions - Returns all the scoped role permissions that apply to the given resource. Only OPAL_SCOPED_ROLE resource type supports this field.

func (*Resources) GetTags

GetTags - Returns all tags applied to the resource.

func (*Resources) GetUserResources added in v3.1.2

GetUserResources - Gets the list of resources for this user.

func (*Resources) GetUsers

GetUsers - Gets the list of users for this resource.

func (*Resources) GetVisibility

GetVisibility - Gets the visibility of this resource.

func (*Resources) Update

Update - Bulk updates a list of resources.

func (*Resources) UpdateMessageChannels

UpdateMessageChannels - Sets the list of audit message channels attached to a resource.

func (*Resources) UpdateReviewers

UpdateReviewers - Sets the list of reviewers for a resource.

func (*Resources) UpdateScopedRolePermissions

UpdateScopedRolePermissions - Sets all the scoped role permissions on an OPAL_SCOPED_ROLE resource.

func (*Resources) UpdateVisibility

UpdateVisibility - Sets the visibility of this resource.

type SDKOption

type SDKOption func(*OpalAPI)

func WithClient

func WithClient(client HTTPClient) SDKOption

WithClient allows the overriding of the default HTTP client used by the SDK

func WithRetryConfig

func WithRetryConfig(retryConfig retry.Config) SDKOption

func WithSecurity

func WithSecurity(security shared.Security) SDKOption

WithSecurity configures the SDK to use the provided security details

func WithSecuritySource

func WithSecuritySource(security func(context.Context) (shared.Security, error)) SDKOption

WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication

func WithServer

func WithServer(server string) SDKOption

WithServer allows the overriding of the default server by name

func WithServerURL

func WithServerURL(serverURL string) SDKOption

WithServerURL allows the overriding of the default server URL

func WithTemplatedServerURL

func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption

WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters

func WithTimeout

func WithTimeout(timeout time.Duration) SDKOption

WithTimeout Optional request timeout applied to each operation

type Sessions

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

Sessions - Operations related to sessions

func (*Sessions) Get

Get - Returns a list of `Session` objects.

type Tags

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

Tags - Operations related to tags

func (*Tags) CreateGroup

CreateGroup - Applies a tag to a group.

func (*Tags) CreateResource

CreateResource - Applies a tag to a resource.

func (*Tags) CreateTag

func (s *Tags) CreateTag(ctx context.Context, request shared.CreateTagInfo, opts ...operations.Option) (*operations.CreateTagResponse, error)

CreateTag - Creates a tag with the given key and value.

func (*Tags) CreateUser

CreateUser - Applies a tag to a user.

func (*Tags) Delete

Delete - Removes a tag from a user.

func (*Tags) DeleteGroup

DeleteGroup - Removes a tag from a group.

func (*Tags) DeleteResource

DeleteResource - Removes a tag from a resource.

func (*Tags) DeleteTagByID

DeleteTagByID - UNSTABLE. May be removed at any time. Deletes a tag with the given id.

func (*Tags) GetTagByID

GetTagByID - UNSTABLE. May be removed at any time. Gets a tag with the given id.

func (*Tags) GetTags

GetTags - Returns a list of tags created by your organization.

type Uars

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

Uars - Operations related to UARs

func (*Uars) Create

Create - Starts a User Access Review.

func (*Uars) Get

Get - Returns a list of `UAR` objects.

func (*Uars) GetID

GetID - Retrieves a specific UAR.

type Users

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

Users - Operations related to users

func (*Users) Get

Get - Returns a `User` object.

func (*Users) GetRemoteUsers added in v3.1.1

GetRemoteUsers - Returns a list of remote users for your organization.

func (*Users) GetUserTags

GetUserTags - Returns all tags applied to the user.

func (*Users) GetUsers

GetUsers - Returns a list of users for your organization.

Directories

Path Synopsis
internal
models

Jump to

Keyboard shortcuts

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