scim

package
v1.62.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataSourceCurrentUser

func DataSourceCurrentUser() common.Resource

DataSourceCurrentUser returns information about caller identity

func DataSourceGroup

func DataSourceGroup() common.Resource

DataSourceGroup returns information about group specified by display name

func DataSourceServicePrincipal

func DataSourceServicePrincipal() common.Resource

DataSourceServicePrincipal returns information about the spn specified by the application_id

func DataSourceServicePrincipals

func DataSourceServicePrincipals() common.Resource

DataSourceServicePrincipals searches for service principals based on display_name

func DataSourceUser

func DataSourceUser() common.Resource

DataSourceUser returns information about user specified by user name

func PatchRequest

func PatchRequest(op, path string) patchRequest

func PatchRequestComplexValue added in v1.3.0

func PatchRequestComplexValue(operations []patchOperation) patchRequest

func PatchRequestWithValue added in v1.39.0

func PatchRequestWithValue(op, path, value string) patchRequest

func ResourceEntitlements added in v1.3.0

func ResourceEntitlements() common.Resource

ResourceGroup manages user groups

func ResourceGroup

func ResourceGroup() common.Resource

ResourceGroup manages user groups

func ResourceGroupMember

func ResourceGroupMember() common.Resource

ResourceGroupMember bind group with member

func ResourceGroupRole added in v1.3.0

func ResourceGroupRole() common.Resource

ResourceGroupRole bind group with role

func ResourceServicePrincipal

func ResourceServicePrincipal() common.Resource

ResourceServicePrincipal manages service principals within workspace

func ResourceUser

func ResourceUser() common.Resource

ResourceUser manages users within workspace

Types

type ComplexValue

type ComplexValue struct {
	Value   string `json:"value,omitempty"`
	Display string `json:"display,omitempty"`
	Ref     string `json:"$ref,omitempty"`

	// https://tools.ietf.org/html/rfc7643#page-64
	Type string `json:"type,omitempty"`
}

Generalisation of most common complex values from SCIM protocol Details at https://datatracker.ietf.org/doc/html/rfc7643#section-2.3.8

type ComplexValues

type ComplexValues []ComplexValue

func (ComplexValues) HasValue

func (cv ComplexValues) HasValue(value string) bool

type Group

type Group struct {
	ID           string         `json:"id,omitempty"`
	Schemas      []URN          `json:"schemas,omitempty"`
	DisplayName  string         `json:"displayName,omitempty"`
	Members      []ComplexValue `json:"members,omitempty"`
	Groups       []ComplexValue `json:"groups,omitempty"`
	Roles        []ComplexValue `json:"roles,omitempty"`
	Entitlements entitlements   `json:"entitlements,omitempty"`
	ExternalID   string         `json:"externalId,omitempty"`
}

Group contains information about the SCIM group

type GroupList

type GroupList struct {
	TotalResults int32   `json:"totalResults,omitempty"`
	StartIndex   int32   `json:"startIndex,omitempty"`
	ItemsPerPage int32   `json:"itemsPerPage,omitempty"`
	Schemas      []URN   `json:"schemas,omitempty"`
	Resources    []Group `json:"resources,omitempty"`
}

GroupList contains a list of groups fetched from a list api call from SCIM api

type GroupsAPI

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

GroupsAPI exposes the scim groups API

func NewGroupsAPI

func NewGroupsAPI(ctx context.Context, m any) GroupsAPI

NewGroupsAPI creates GroupsAPI instance from provider meta

func (GroupsAPI) Create

func (a GroupsAPI) Create(scimGroupRequest Group) (group Group, err error)

Create creates a scim group in the Databricks workspace

func (GroupsAPI) Delete

func (a GroupsAPI) Delete(groupID string) error

Delete deletes a group given a group id

func (GroupsAPI) Filter

func (a GroupsAPI) Filter(filter string) (GroupList, error)

Filter returns groups matching the filter

func (GroupsAPI) Patch

func (a GroupsAPI) Patch(groupID string, r patchRequest) error

func (GroupsAPI) Read

func (a GroupsAPI) Read(groupID, attributes string) (group Group, err error)

Read reads and returns a Group object via SCIM api

func (GroupsAPI) ReadByDisplayName

func (a GroupsAPI) ReadByDisplayName(displayName, attributes string) (group Group, err error)

func (GroupsAPI) UpdateEntitlements added in v1.3.0

func (a GroupsAPI) UpdateEntitlements(groupID string, entitlements patchRequest) error

func (GroupsAPI) UpdateNameAndEntitlements

func (a GroupsAPI) UpdateNameAndEntitlements(groupID string, name string, externalID string, e entitlements) error

type ServicePrincipalsAPI

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

ServicePrincipalsAPI exposes the scim servicePrincipal API

func NewServicePrincipalsAPI

func NewServicePrincipalsAPI(ctx context.Context, m any) ServicePrincipalsAPI

NewServicePrincipalsAPI creates ServicePrincipalsAPI instance from provider meta

func (ServicePrincipalsAPI) Create

func (a ServicePrincipalsAPI) Create(rsp User) (sp User, err error)

CreateR ..

func (ServicePrincipalsAPI) Delete

func (a ServicePrincipalsAPI) Delete(servicePrincipalID string) error

Delete will delete the servicePrincipal given the servicePrincipal id

func (ServicePrincipalsAPI) Filter added in v1.7.0

func (a ServicePrincipalsAPI) Filter(filter string, excludeRoles bool) (u []User, err error)

func (ServicePrincipalsAPI) Patch

func (a ServicePrincipalsAPI) Patch(servicePrincipalID string, r patchRequest) error

Patch updates resource-friendly entity

func (ServicePrincipalsAPI) Read

func (a ServicePrincipalsAPI) Read(servicePrincipalID string, attributes string) (sp User, err error)

func (ServicePrincipalsAPI) Update

func (a ServicePrincipalsAPI) Update(servicePrincipalID string, updateRequest User) error

Update replaces resource-friendly-entity

func (ServicePrincipalsAPI) UpdateEntitlements added in v1.3.0

func (a ServicePrincipalsAPI) UpdateEntitlements(servicePrincipalID string, entitlements patchRequest) error

type URN

type URN string

URN is a custom type for the SCIM spec for the schema

const (
	UserSchema             URN = "urn:ietf:params:scim:schemas:core:2.0:User"
	ServicePrincipalSchema URN = "urn:ietf:params:scim:schemas:core:2.0:ServicePrincipal"
	WorkspaceUserSchema    URN = "urn:ietf:params:scim:schemas:extension:workspace:2.0:User"
	PatchOp                URN = "urn:ietf:params:scim:api:messages:2.0:PatchOp"
	GroupSchema            URN = "urn:ietf:params:scim:schemas:core:2.0:Group"
)

Possible schema URNs for the Databricks SCIM api

type User

type User struct {
	ID            string            `json:"id,omitempty"`
	Emails        []email           `json:"emails,omitempty"`
	DisplayName   string            `json:"displayName,omitempty" tf:"alias:display_name"`
	Active        bool              `json:"active"`
	Schemas       []URN             `json:"schemas,omitempty"`
	UserName      string            `json:"userName,omitempty" tf:"alias:user_name"`
	ApplicationID string            `json:"applicationId,omitempty" tf:"alias:application_id"`
	Groups        []ComplexValue    `json:"groups,omitempty"`
	Name          map[string]string `json:"name,omitempty"`
	Roles         []ComplexValue    `json:"roles,omitempty"`
	Entitlements  entitlements      `json:"entitlements,omitempty"`
	ExternalID    string            `json:"externalId,omitempty"`
}

User is a struct that contains all the information about a SCIM user

type UserList

type UserList struct {
	TotalResults int32  `json:"totalResults,omitempty"`
	StartIndex   int32  `json:"startIndex,omitempty"`
	ItemsPerPage int32  `json:"itemsPerPage,omitempty"`
	Schemas      []URN  `json:"schemas,omitempty"`
	Resources    []User `json:"resources,omitempty"`
}

UserList contains a list of Users fetched from a list api call from SCIM api

type UsersAPI

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

UsersAPI exposes the scim user API

func NewUsersAPI

func NewUsersAPI(ctx context.Context, m any) UsersAPI

NewUsersAPI creates UsersAPI instance from provider meta

func (UsersAPI) Create

func (a UsersAPI) Create(ru User) (user User, err error)

Create user in the backend

func (UsersAPI) Delete

func (a UsersAPI) Delete(userID string) error

Delete will delete the user given the user id

func (UsersAPI) Filter

func (a UsersAPI) Filter(filter string, excludeRoles bool) (u []User, err error)

Filter retrieves users by filter

func (UsersAPI) Me

func (a UsersAPI) Me() (User, error)

Me gets user information about caller

func (UsersAPI) Patch

func (a UsersAPI) Patch(userID string, r patchRequest) error

Patch updates resource-friendly entity

func (UsersAPI) Read

func (a UsersAPI) Read(userID, attributes string) (User, error)

func (UsersAPI) Update

func (a UsersAPI) Update(userID string, updateRequest User) error

Update replaces user information for given ID

func (UsersAPI) UpdateEntitlements added in v1.3.0

func (a UsersAPI) UpdateEntitlements(userID string, entitlements patchRequest) error

Jump to

Keyboard shortcuts

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