identity

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataSourceCurrentUser added in v0.3.0

func DataSourceCurrentUser() *schema.Resource

DataSourceCurrentUser returns information about caller identity

func DataSourceGroup added in v0.2.6

func DataSourceGroup() *schema.Resource

DataSourceGroup returns information about group specified by display name

func ResourceGroup

func ResourceGroup() *schema.Resource

ResourceGroup manages user groups

func ResourceGroupInstanceProfile

func ResourceGroupInstanceProfile() *schema.Resource

ResourceGroupInstanceProfile defines group role resource

func ResourceGroupMember

func ResourceGroupMember() *schema.Resource

ResourceGroupMember bind group with member

func ResourceInstanceProfile

func ResourceInstanceProfile() *schema.Resource

ResourceInstanceProfile manages Instance Profile ARN binding

func ResourceServicePrincipal added in v0.3.0

func ResourceServicePrincipal() *schema.Resource

ResourceServicePrincipal manages service principals within workspace

func ResourceToken

func ResourceToken() *schema.Resource

ResourceToken refreshes token in case it's expired

func ResourceUser added in v0.2.6

func ResourceUser() *schema.Resource

ResourceUser manages users within workspace

func ResourceUserInstanceProfile added in v0.2.6

func ResourceUserInstanceProfile() *schema.Resource

ResourceUserInstanceProfile binds user and instance profile

func ValidInstanceProfile added in v0.3.0

func ValidInstanceProfile(v interface{}, c cty.Path) diag.Diagnostics

ValidInstanceProfile validate if it's valid instance profile ARN

Types

type Entitlement

type Entitlement string

Entitlement is a custom type that contains a set of entitlements for a user/group

const (
	AllowClusterCreateEntitlement      Entitlement = "allow-cluster-create"
	AllowInstancePoolCreateEntitlement Entitlement = "allow-instance-pool-create"
)

List of possible entitlement constants on Databricks

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    []ScimGroup `json:"resources,omitempty"`
}

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

type GroupMember

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

GroupMember contains information of a member in a scim group

type GroupPatchOperations

type GroupPatchOperations struct {
	Op    string          `json:"op,omitempty"`
	Path  GroupPathType   `json:"path,omitempty"`
	Value []ValueListItem `json:"value,omitempty"`
}

GroupPatchOperations is a list of path operations for add or removing group attributes

type GroupPatchRequest

type GroupPatchRequest struct {
	Schemas    []URN                  `json:"schemas,omitempty"`
	Operations []GroupPatchOperations `json:"Operations,omitempty"`
}

GroupPatchRequest contains a request structure to make a patch op against SCIM api

type GroupPathType

type GroupPathType string

GroupPathType describes the possible paths in the SCIM RFC for patch operations

const (
	// GroupMembersPath is the members path for SCIM patch operation.
	GroupMembersPath GroupPathType = "members"

	// GroupRolesPath is the roles path for SCIM patch operation.
	GroupRolesPath GroupPathType = "roles"

	// GroupEntitlementsPath is the entitlements path for SCIM patch operation.
	GroupEntitlementsPath GroupPathType = "entitlements"
)

type GroupsAPI

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

GroupsAPI exposes the scim groups API

func NewGroupsAPI

func NewGroupsAPI(ctx context.Context, m interface{}) GroupsAPI

NewGroupsAPI creates GroupsAPI instance from provider meta

func (GroupsAPI) Create

func (a GroupsAPI) Create(groupName string, members []string, roles []string, entitlements []string) (group ScimGroup, 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 added in v0.2.6

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

Filter returns groups matching the filter

func (GroupsAPI) Patch

func (a GroupsAPI) Patch(groupID string, addList []string, removeList []string, path GroupPathType) error

Patch applys a patch request for a group given a path attribute

func (GroupsAPI) PatchR added in v0.2.6

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

PatchR ...

func (GroupsAPI) Read

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

Read reads and returns a Group object via SCIM api

type GroupsValue

type GroupsValue struct {
	Groups []ValueListItem `json:"groups,omitempty"`
}

GroupsValue is a list of value items for the groups path

type InstanceProfileInfo

type InstanceProfileInfo struct {
	InstanceProfileArn string `json:"instance_profile_arn,omitempty"`
}

InstanceProfileInfo contains the ARN for aws instance profiles

type InstanceProfileList

type InstanceProfileList struct {
	InstanceProfiles []InstanceProfileInfo `json:"instance_profiles,omitempty"`
}

InstanceProfileList ...

type InstanceProfilesAPI

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

InstanceProfilesAPI exposes the instance profiles api on the AWS deployment of Databricks

func NewInstanceProfilesAPI

func NewInstanceProfilesAPI(ctx context.Context, m interface{}) InstanceProfilesAPI

NewInstanceProfilesAPI creates InstanceProfilesAPI instance from provider meta

func (InstanceProfilesAPI) Create

func (a InstanceProfilesAPI) Create(instanceProfileARN string) error

Create creates an instance profile record on Databricks

func (InstanceProfilesAPI) Delete

func (a InstanceProfilesAPI) Delete(instanceProfileARN string) error

Delete deletes the instance profile given an instance profile arn

func (InstanceProfilesAPI) IsRegistered added in v0.3.0

func (a InstanceProfilesAPI) IsRegistered(arn string) bool

IsRegistered checks if instance profile exists

func (InstanceProfilesAPI) List

List lists all the instance profiles in the workspace

func (InstanceProfilesAPI) Read

func (a InstanceProfilesAPI) Read(instanceProfileARN string) (string, error)

Read returns the ARN back if it exists on the Databricks workspace

func (InstanceProfilesAPI) Synchronized added in v0.2.8

func (a InstanceProfilesAPI) Synchronized(arn string, testCallback func() bool)

Synchronized test helper for working with only single instance profile

type MembersValue

type MembersValue struct {
	Members []ValueListItem `json:"members,omitempty"`
}

MembersValue is a list of value items for the members path

type RolesValue

type RolesValue struct {
	Roles []ValueListItem `json:"roles,omitempty"`
}

RolesValue is a list of value items for the roles path

type ScimGroup added in v0.2.6

type ScimGroup struct {
	ID           string                 `json:"id,omitempty"`
	Schemas      []URN                  `json:"schemas,omitempty"`
	DisplayName  string                 `json:"displayName,omitempty"`
	Members      []GroupMember          `json:"members,omitempty"`
	Groups       []GroupMember          `json:"groups,omitempty"`
	Roles        []roleListItem         `json:"roles,omitempty"`
	Entitlements []entitlementsListItem `json:"entitlements,omitempty"`
}

ScimGroup contains information about the SCIM group

func (ScimGroup) HasMember added in v0.2.6

func (g ScimGroup) HasMember(memberID string) bool

HasMember returns true if group has given user or another group id as member

func (ScimGroup) HasRole added in v0.2.6

func (g ScimGroup) HasRole(role string) bool

HasRole returns true if group has a role

type ScimUser added in v0.2.6

type ScimUser struct {
	ID            string                 `json:"id,omitempty"`
	Emails        []email                `json:"emails,omitempty"`
	DisplayName   string                 `json:"displayName,omitempty"`
	Active        bool                   `json:"active,omitempty"`
	Schemas       []URN                  `json:"schemas,omitempty"`
	UserName      string                 `json:"userName,omitempty"`
	ApplicationID string                 `json:"applicationId,omitempty"`
	Groups        []groupsListItem       `json:"groups,omitempty"`
	Name          map[string]string      `json:"name,omitempty"`
	Roles         []roleListItem         `json:"roles,omitempty"`
	Entitlements  []entitlementsListItem `json:"entitlements,omitempty"`
}

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

func (ScimUser) HasRole added in v0.2.6

func (u ScimUser) HasRole(role string) bool

HasRole returns true if group has a role

type ServicePrincipalEntity added in v0.3.0

type ServicePrincipalEntity struct {
	ApplicationID           string `json:"application_id"`
	DisplayName             string `json:"display_name,omitempty" tf:"computed"`
	Active                  bool   `json:"active,omitempty"`
	AllowClusterCreate      bool   `json:"allow_cluster_create,omitempty"`
	AllowInstancePoolCreate bool   `json:"allow_instance_pool_create,omitempty"`
}

ServicePrincipalEntity entity from which resource schema is made

type ServicePrincipalsAPI added in v0.3.0

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

ServicePrincipalsAPI exposes the scim servicePrincipal API

func NewServicePrincipalsAPI added in v0.3.0

func NewServicePrincipalsAPI(ctx context.Context, m interface{}) ServicePrincipalsAPI

NewServicePrincipalsAPI creates ServicePrincipalsAPI instance from provider meta

func (ServicePrincipalsAPI) CreateR added in v0.3.0

func (a ServicePrincipalsAPI) CreateR(rsp ServicePrincipalEntity) (sp ScimUser, err error)

CreateR ..

func (ServicePrincipalsAPI) Delete added in v0.3.0

func (a ServicePrincipalsAPI) Delete(servicePrincipalID string) error

Delete will delete the servicePrincipal given the servicePrincipal id

func (ServicePrincipalsAPI) ReadR added in v0.3.0

func (a ServicePrincipalsAPI) ReadR(servicePrincipalID string) (rsp ServicePrincipalEntity, err error)

ReadR reads resource-friendly entity

func (ServicePrincipalsAPI) UpdateR added in v0.3.0

func (a ServicePrincipalsAPI) UpdateR(servicePrincipalID string, rsp ServicePrincipalEntity) error

UpdateR replaces resource-friendly-entity

type TokenInfo

type TokenInfo struct {
	TokenID      string `json:"token_id,omitempty"`
	CreationTime int64  `json:"creation_time,omitempty"`
	ExpiryTime   int64  `json:"expiry_time,omitempty"`
	Comment      string `json:"comment,omitempty"`
}

TokenInfo is a struct that contains metadata about a given token

type TokenList

type TokenList struct {
	TokenInfos []TokenInfo `json:"token_infos,omitempty"`
}

TokenList ...

type TokenRequest

type TokenRequest struct {
	LifetimeSeconds int32  `json:"lifetime_seconds"`
	Comment         string `json:"comment"`
}

TokenRequest asks for a token

type TokenResponse

type TokenResponse struct {
	TokenValue string     `json:"token_value,omitempty"`
	TokenInfo  *TokenInfo `json:"token_info,omitempty"`
}

TokenResponse is a struct that contains information about token that is created from the create tokens api

type TokensAPI

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

TokensAPI exposes the Secrets API

func NewTokensAPI

func NewTokensAPI(ctx context.Context, m interface{}) TokensAPI

NewTokensAPI creates TokensAPI instance from provider meta

func (TokensAPI) Create

func (a TokensAPI) Create(tokenLifetime time.Duration, comment string) (r TokenResponse, err error)

Create creates a api token given a expiration duration and a comment

func (TokensAPI) Delete

func (a TokensAPI) Delete(tokenID string) error

Delete will delete the token given a token id

func (TokensAPI) List

func (a TokensAPI) List() ([]TokenInfo, error)

List will list all the token metadata and not the content of the tokens in the workspace

func (TokensAPI) Read

func (a TokensAPI) Read(tokenID string) (TokenInfo, error)

Read will return the token metadata and not the content of the token

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 UserEntity added in v0.2.6

type UserEntity struct {
	UserName                string `json:"user_name"`
	DisplayName             string `json:"display_name,omitempty" tf:"computed"`
	Active                  bool   `json:"active,omitempty"`
	AllowClusterCreate      bool   `json:"allow_cluster_create,omitempty"`
	AllowInstancePoolCreate bool   `json:"allow_instance_pool_create,omitempty"`
}

UserEntity entity from which resource schema is made

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    []ScimUser `json:"resources,omitempty"`
}

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

type UserPatchOperations

type UserPatchOperations struct {
	Op    string       `json:"op,omitempty"`
	Path  string       `json:"path,omitempty"`
	Value *GroupsValue `json:"value,omitempty"`
}

UserPatchOperations is a list of path operations for add or removing user attributes

type UsersAPI

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

UsersAPI exposes the scim user API

func NewUsersAPI

func NewUsersAPI(ctx context.Context, m interface{}) UsersAPI

NewUsersAPI creates UsersAPI instance from provider meta

func (UsersAPI) Create

func (a UsersAPI) Create(ru UserEntity) (user ScimUser, err error)

Create ..

func (UsersAPI) Delete

func (a UsersAPI) Delete(userID string) error

Delete will delete the user given the user id

func (UsersAPI) Filter added in v0.2.9

func (a UsersAPI) Filter(filter string) (u []ScimUser, err error)

Filter retrieves users by filter

func (UsersAPI) Me

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

Me gets user information about caller

func (UsersAPI) Patch added in v0.3.0

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

Patch updates resource-friendly entity

func (UsersAPI) Read

func (a UsersAPI) Read(userID string) (ru UserEntity, err error)

Read reads resource-friendly entity

func (UsersAPI) Update

func (a UsersAPI) Update(userID string, ru UserEntity) error

Update replaces resource-friendly-entity

type ValueList

type ValueList struct {
	Value []ValueListItem `json:"value,omitempty"`
}

ValueList is a generic list of value items for any path

type ValueListItem

type ValueListItem struct {
	Value string `json:"value,omitempty"`
}

ValueListItem is a struct that contains a field Value. This is for the scim api.

Jump to

Keyboard shortcuts

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