scim

package
v0.0.0-...-e2048a1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package scim implemements a very basic scim client with utility needed to extract users from IdP Groups A scim client is initialized via it's base url and authentication method. As for now only basic auth is implemented

Index

Constants

View Source
const (
	EmptyGroupResponseBodyMock = `` /* 127-byte string literal not displayed */

	GroupResponseBodyWithMembersMock = `` /* 1058-byte string literal not displayed */

	MalformedGroupResponseBodyMock = `` /* 249-byte string literal not displayed */

	UserResponseBodyMock1 = `` /* 964-byte string literal not displayed */

	MalFormedUserResponseBodyMock = `{
		"id": "malFormedUser",
		"userName" : "I12345",
		"active" : true
	  }`

	UserResponseBodyMock2 = `` /* 964-byte string literal not displayed */

	GroupResponseBodyWith3MembersAndURLMock = `` /* 974-byte string literal not displayed */

	GroupResponseBodyWith2MembersAndURLMock = `` /* 908-byte string literal not displayed */

	OtherGroupResponseBodyWith2MembersAndURLMock = `` /* 980-byte string literal not displayed */

	UserResponseBodyMock3 = `` /* 975-byte string literal not displayed */

	UserResponseBodyMock4 = `` /* 983-byte string literal not displayed */

	UserResponseBodyMock5 = `` /* 981-byte string literal not displayed */

	InactiveUserResponseBodyMock = `` /* 979-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func ReturnDefaultGroupResponseMockServer

func ReturnDefaultGroupResponseMockServer() *httptest.Server

Types

type AuthType

type AuthType byte
const (
	Basic AuthType = iota
)

type BasicAuthConfig

type BasicAuthConfig struct {
	BasicAuthUser string
	BasicAuthPw   string
}

type Config

type Config struct {
	RawURL          string
	AuthType        AuthType
	BasicAuthConfig *BasicAuthConfig
}

type Email

type Email struct {
	Value   string `json:"value"`
	Primary bool   `json:"primary"`
}

type GroupResponseBody

type GroupResponseBody struct {
	TotalResults int        `json:"totalResults"`
	Resources    []Resource `json:"resources"`
}

type Member

type Member struct {
	Ref string `json:"$ref"`
}

type MemberResponseBody

type MemberResponseBody struct {
	ID       string  `json:"id"`
	UserName string  `json:"userName"`
	Emails   []Email `json:"emails"`
	Name     Name    `json:"name"`
	Active   bool    `json:"active"`
}

type Name

type Name struct {
	FamilyName string `json:"familyName"`
	GivenName  string `json:"givenname"`
}

type Resource

type Resource struct {
	ID          *string  `json:"id"`
	DisplayName *string  `json:"displayName"`
	Members     []Member `json:"members"`
}

type ScimClient

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

func NewScimClient

func NewScimClient(scimConfig Config) (*ScimClient, error)

Returns a scimClient

func (*ScimClient) GetTeamMembers

func (s *ScimClient) GetTeamMembers(teamMappedIDPGroup string) ([]Member, error)

Returns team members referenced by URL in a IdP group

func (*ScimClient) GetUsers

func (s *ScimClient) GetUsers(members []Member) []greenhousev1alpha1.User

Returns a full fledged Users array from the members array

Jump to

Keyboard shortcuts

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