Documentation
¶
Index ¶
- Constants
- Variables
- type BaseResource
- type Client
- func (c *Client) GetGroup(ctx context.Context, id string, groupMemberAttribute string) (*Group, error)
- func (c *Client) GetUser(ctx context.Context, id string) (*User, error)
- func (c *Client) ListGroups(ctx context.Context, method string, filter FilterExpression, cursor *string, ...) (*GroupList, error)
- func (c *Client) ListUsers(ctx context.Context, method string, filter FilterExpression, cursor *string, ...) (*UserList, error)
- type FilterComparison
- type FilterExpression
- type FilterLogicalGroupAnd
- type FilterLogicalGroupNot
- type FilterLogicalGroupOr
- type FilterOperator
- type Group
- type GroupList
- type MultiValuedAttribute
- type NullFilterExpression
- type SearchRequest
- type User
- type UserList
Constants ¶
const ( ApplicationSCIMJson = "application/scim+json" SearchRequestSchema = "urn:ietf:params:scim:api:messages:2.0:SearchRequest" BasePathGroups = "/Groups" BasePathUsers = "/Users" PostSearchPath = ".search" HeaderAuthorization = "Authorization" )
Variables ¶
var ( ErrAuthNotImplemented = errors.New("API Auth not implemented") ErrGetUser = errors.New("error getting SCIM user") ErrListUsers = errors.New("error listing SCIM users") ErrGetGroup = errors.New("error getting SCIM group") ErrListGroups = errors.New("error listing SCIM groups") ErrHttpCreation = errors.New("failed to create the http client") ErrClientHost = errors.New("failed to load the client host") ErrClientID = errors.New("failed to load the client id") ErrClientSecret = errors.New("failed to load the client secret") ErrParsingClientCertificate = errors.New("failed to parse client certificate x509 pair") )
var ( ErrNoFilter = errors.New("filter not provided") ErrMarshallFail = errors.New("failed to marshal search request") )
Functions ¶
This section is empty.
Types ¶
type BaseResource ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetGroup ¶
func (c *Client) GetGroup(ctx context.Context, id string, groupMemberAttribute string) (*Group, error)
GetGroup retrieves a SCIM group by its ID.
func (*Client) ListGroups ¶
func (c *Client) ListGroups( ctx context.Context, method string, filter FilterExpression, cursor *string, count *int, ) (*GroupList, error)
ListGroups retrieves a list of SCIM groups. It supports filtering, pagination (using cursor), and count parameters. The useHTTPPost parameter determines whether to use POST method + /.search path for the request.
func (*Client) ListUsers ¶
func (c *Client) ListUsers( ctx context.Context, method string, filter FilterExpression, cursor *string, count *int, ) (*UserList, error)
ListUsers retrieves a list of SCIM users. It supports filtering, pagination (using cursor), and count parameters. The useHTTPPost parameter determines whether to use POST method + /.search path for the request.
type FilterComparison ¶
type FilterComparison struct {
Attribute string
Operator FilterOperator
Value string
}
FilterComparison represents a comparison filter expression.
func (FilterComparison) ToString ¶
func (f FilterComparison) ToString() string
type FilterExpression ¶
type FilterExpression interface {
ToString() string
}
FilterExpression is an interface for filter expressions in SCIM. It can be a comparison or logical operation.
type FilterLogicalGroupAnd ¶
type FilterLogicalGroupAnd struct {
Expressions []FilterExpression
}
FilterLogicalGroupAnd represents a logical AND group of filter expressions.
func (FilterLogicalGroupAnd) ToString ¶
func (f FilterLogicalGroupAnd) ToString() string
type FilterLogicalGroupNot ¶
type FilterLogicalGroupNot struct {
Expression FilterExpression
}
FilterLogicalGroupNot represents a logical NOT operation on a filter expression.
func (FilterLogicalGroupNot) ToString ¶
func (f FilterLogicalGroupNot) ToString() string
type FilterLogicalGroupOr ¶
type FilterLogicalGroupOr struct {
Expressions []FilterExpression
}
FilterLogicalGroupOr represents a logical OR group of filter expressions.
func (FilterLogicalGroupOr) ToString ¶
func (f FilterLogicalGroupOr) ToString() string
type FilterOperator ¶
type FilterOperator string
const ( FilterOperatorEqual FilterOperator = "eq" FilterOperatorGreater FilterOperator = "gt" FilterOperatorEqualCI FilterOperator = "eq_ci" // Case-insensitive FilterOperatorNotEqual FilterOperator = "ne" FilterOperatorContains FilterOperator = "co" FilterOperatorStartsWith FilterOperator = "sw" FilterOperatorEndsWith FilterOperator = "ew" )
type Group ¶
type Group struct {
BaseResource
DisplayName string `json:"displayName,omitempty"`
Members []MultiValuedAttribute `json:"members,omitempty"`
}
type MultiValuedAttribute ¶
type NullFilterExpression ¶
type NullFilterExpression struct{}
NullFilterExpression is a placeholder for an empty/nil filter expression.
func (NullFilterExpression) ToString ¶
func (f NullFilterExpression) ToString() string
type SearchRequest ¶
type User ¶
type User struct {
BaseResource
UserName string `json:"userName"`
Name struct{} `json:"name"`
DisplayName string `json:"displayName,omitempty"`
Active bool `json:"active"`
Emails []MultiValuedAttribute `json:"emails"`
Groups []MultiValuedAttribute `json:"groups"`
UserType string `json:"userType,omitempty"`
}