idp

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UnsetAccountID is a special key to map users without an account ID
	UnsetAccountID = "unset"
)

Variables

This section is empty.

Functions

func GeneratePassword

func GeneratePassword(passwordLength, minSpecialChar, minNum, minUpperCase int) string

GeneratePassword generates user password

Types

type AppMetadata

type AppMetadata struct {
	// WTAccountID is a NetBird (previously Wiretrustee) account id to update in the IDP
	// maps to wt_account_id when json.marshal
	WTAccountID     string `json:"wt_account_id,omitempty"`
	WTPendingInvite *bool  `json:"wt_pending_invite,omitempty"`
	WTInvitedBy     string `json:"wt_invited_by_email,omitempty"`
}

AppMetadata user app metadata to associate with a profile

type Auth0ClientConfig

type Auth0ClientConfig struct {
	Audience     string
	AuthIssuer   string
	ClientID     string
	ClientSecret string
	GrantType    string
}

Auth0ClientConfig auth0 manager client configurations

type Auth0Credentials

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

Auth0Credentials auth0 authentication information

func (*Auth0Credentials) Authenticate

func (c *Auth0Credentials) Authenticate() (JWTToken, error)

Authenticate retrieves access token to use the Auth0 Management API

type Auth0Manager

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

Auth0Manager auth0 manager client instance

func NewAuth0Manager

func NewAuth0Manager(config Auth0ClientConfig, appMetrics telemetry.AppMetrics) (*Auth0Manager, error)

NewAuth0Manager creates a new instance of the Auth0Manager

func (*Auth0Manager) CreateUser

func (am *Auth0Manager) CreateUser(email, name, accountID, invitedByEmail string) (*UserData, error)

CreateUser creates a new user in Auth0 Idp and sends an invite

func (*Auth0Manager) DeleteUser

func (am *Auth0Manager) DeleteUser(userID string) error

DeleteUser from Auth0

func (*Auth0Manager) GetAccount

func (am *Auth0Manager) GetAccount(accountID string) ([]*UserData, error)

GetAccount returns all the users for a given profile. Calls Auth0 API.

func (*Auth0Manager) GetAllAccounts

func (am *Auth0Manager) GetAllAccounts() (map[string][]*UserData, error)

GetAllAccounts gets all registered accounts with corresponding user data. It returns a list of users indexed by accountID.

func (*Auth0Manager) GetAllConnections

func (am *Auth0Manager) GetAllConnections(strategy []string) ([]Connection, error)

GetAllConnections returns detailed list of all connections filtered by given params. Note this method is not part of the IDP Manager interface as this is Auth0 specific.

func (*Auth0Manager) GetUserByEmail

func (am *Auth0Manager) GetUserByEmail(email string) ([]*UserData, error)

GetUserByEmail searches users with a given email. If no users have been found, this function returns an empty list. This function can return multiple users. This is due to the Auth0 internals - there could be multiple users with the same email but different connections that are considered as separate accounts (e.g., Google and username/password).

func (*Auth0Manager) GetUserDataByID

func (am *Auth0Manager) GetUserDataByID(userID string, appMetadata AppMetadata) (*UserData, error)

GetUserDataByID requests user data from auth0 via ID

func (*Auth0Manager) InviteUserByID

func (am *Auth0Manager) InviteUserByID(userID string) error

InviteUserByID resend invitations to users who haven't activated, their accounts prior to the expiration period.

func (*Auth0Manager) UpdateUserAppMetadata

func (am *Auth0Manager) UpdateUserAppMetadata(userID string, appMetadata AppMetadata) error

UpdateUserAppMetadata updates user app metadata based on userId and metadata map

type AuthentikClientConfig

type AuthentikClientConfig struct {
	Issuer        string
	ClientID      string
	Username      string
	Password      string
	TokenEndpoint string
	GrantType     string
}

AuthentikClientConfig authentik manager client configurations.

type AuthentikCredentials

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

AuthentikCredentials authentik authentication information.

func (*AuthentikCredentials) Authenticate

func (ac *AuthentikCredentials) Authenticate() (JWTToken, error)

Authenticate retrieves access token to use the authentik management API.

type AuthentikManager

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

AuthentikManager authentik manager client instance.

func NewAuthentikManager

func NewAuthentikManager(config AuthentikClientConfig,
	appMetrics telemetry.AppMetrics) (*AuthentikManager, error)

NewAuthentikManager creates a new instance of the AuthentikManager.

func (*AuthentikManager) CreateUser

func (am *AuthentikManager) CreateUser(_, _, _, _ string) (*UserData, error)

CreateUser creates a new user in authentik Idp and sends an invitation.

func (*AuthentikManager) DeleteUser

func (am *AuthentikManager) DeleteUser(userID string) error

DeleteUser from Authentik

func (*AuthentikManager) GetAccount

func (am *AuthentikManager) GetAccount(accountID string) ([]*UserData, error)

GetAccount returns all the users for a given profile.

func (*AuthentikManager) GetAllAccounts

func (am *AuthentikManager) GetAllAccounts() (map[string][]*UserData, error)

GetAllAccounts gets all registered accounts with corresponding user data. It returns a list of users indexed by accountID.

func (*AuthentikManager) GetUserByEmail

func (am *AuthentikManager) GetUserByEmail(email string) ([]*UserData, error)

GetUserByEmail searches users with a given email. If no users have been found, this function returns an empty list.

func (*AuthentikManager) GetUserDataByID

func (am *AuthentikManager) GetUserDataByID(userID string, appMetadata AppMetadata) (*UserData, error)

GetUserDataByID requests user data from authentik via ID.

func (*AuthentikManager) InviteUserByID

func (am *AuthentikManager) InviteUserByID(_ string) error

InviteUserByID resend invitations to users who haven't activated, their accounts prior to the expiration period.

func (*AuthentikManager) UpdateUserAppMetadata

func (am *AuthentikManager) UpdateUserAppMetadata(_ string, _ AppMetadata) error

UpdateUserAppMetadata updates user app metadata based on userID and metadata map.

type AzureClientConfig

type AzureClientConfig struct {
	ClientID         string
	ClientSecret     string
	ObjectID         string
	GraphAPIEndpoint string
	TokenEndpoint    string
	GrantType        string
}

AzureClientConfig azure manager client configurations.

type AzureCredentials

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

AzureCredentials azure authentication information.

func (*AzureCredentials) Authenticate

func (ac *AzureCredentials) Authenticate() (JWTToken, error)

Authenticate retrieves access token to use the azure Management API.

type AzureManager

type AzureManager struct {
	ClientID         string
	ObjectID         string
	GraphAPIEndpoint string
	// contains filtered or unexported fields
}

AzureManager azure manager client instance.

func NewAzureManager

func NewAzureManager(config AzureClientConfig, appMetrics telemetry.AppMetrics) (*AzureManager, error)

NewAzureManager creates a new instance of the AzureManager.

func (*AzureManager) CreateUser

func (am *AzureManager) CreateUser(_, _, _, _ string) (*UserData, error)

CreateUser creates a new user in azure AD Idp.

func (*AzureManager) DeleteUser

func (am *AzureManager) DeleteUser(userID string) error

DeleteUser from Azure.

func (*AzureManager) GetAccount

func (am *AzureManager) GetAccount(accountID string) ([]*UserData, error)

GetAccount returns all the users for a given profile.

func (*AzureManager) GetAllAccounts

func (am *AzureManager) GetAllAccounts() (map[string][]*UserData, error)

GetAllAccounts gets all registered accounts with corresponding user data. It returns a list of users indexed by accountID.

func (*AzureManager) GetUserByEmail

func (am *AzureManager) GetUserByEmail(email string) ([]*UserData, error)

GetUserByEmail searches users with a given email. If no users have been found, this function returns an empty list.

func (*AzureManager) GetUserDataByID

func (am *AzureManager) GetUserDataByID(userID string, appMetadata AppMetadata) (*UserData, error)

GetUserDataByID requests user data from keycloak via ID.

func (*AzureManager) InviteUserByID

func (am *AzureManager) InviteUserByID(_ string) error

InviteUserByID resend invitations to users who haven't activated, their accounts prior to the expiration period.

func (*AzureManager) UpdateUserAppMetadata

func (am *AzureManager) UpdateUserAppMetadata(_ string, _ AppMetadata) error

UpdateUserAppMetadata updates user app metadata based on userID.

type ClientConfig

type ClientConfig struct {
	Issuer        string
	TokenEndpoint string
	ClientID      string
	ClientSecret  string
	GrantType     string
}

ClientConfig defines common client configuration for all IdP manager

type Config

type Config struct {
	ManagerType               string
	ClientConfig              *ClientConfig
	ExtraConfig               ExtraConfig
	Auth0ClientCredentials    *Auth0ClientConfig
	AzureClientCredentials    *AzureClientConfig
	KeycloakClientCredentials *KeycloakClientConfig
	ZitadelClientCredentials  *ZitadelClientConfig
}

Config an idp configuration struct to be loaded from management server's config file

type Connection

type Connection struct {
	Id                 string            `json:"id"`
	Name               string            `json:"name"`
	DisplayName        string            `json:"display_name"`
	IsDomainConnection bool              `json:"is_domain_connection"`
	Realms             []string          `json:"realms"`
	Metadata           map[string]string `json:"metadata"`
	Options            ConnectionOptions `json:"options"`
}

Connections represents a single Auth0 connection https://auth0.com/docs/api/management/v2/connections/get-connections

type ConnectionOptions

type ConnectionOptions struct {
	DomainAliases []string `json:"domain_aliases"`
}

type ExtraConfig

type ExtraConfig map[string]string

ExtraConfig stores IdP specific config that are unique to individual IdPs

type GoogleWorkspaceClientConfig

type GoogleWorkspaceClientConfig struct {
	ServiceAccountKey string
	CustomerID        string
}

GoogleWorkspaceClientConfig Google Workspace manager client configurations.

type GoogleWorkspaceCredentials

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

GoogleWorkspaceCredentials Google Workspace authentication information.

func (*GoogleWorkspaceCredentials) Authenticate

func (gc *GoogleWorkspaceCredentials) Authenticate() (JWTToken, error)

type GoogleWorkspaceManager

type GoogleWorkspaceManager struct {
	CustomerID string
	// contains filtered or unexported fields
}

GoogleWorkspaceManager Google Workspace manager client instance.

func NewGoogleWorkspaceManager

func NewGoogleWorkspaceManager(config GoogleWorkspaceClientConfig, appMetrics telemetry.AppMetrics) (*GoogleWorkspaceManager, error)

NewGoogleWorkspaceManager creates a new instance of the GoogleWorkspaceManager.

func (*GoogleWorkspaceManager) CreateUser

func (gm *GoogleWorkspaceManager) CreateUser(_, _, _, _ string) (*UserData, error)

CreateUser creates a new user in Google Workspace and sends an invitation.

func (*GoogleWorkspaceManager) DeleteUser

func (gm *GoogleWorkspaceManager) DeleteUser(userID string) error

DeleteUser from GoogleWorkspace.

func (*GoogleWorkspaceManager) GetAccount

func (gm *GoogleWorkspaceManager) GetAccount(accountID string) ([]*UserData, error)

GetAccount returns all the users for a given profile.

func (*GoogleWorkspaceManager) GetAllAccounts

func (gm *GoogleWorkspaceManager) GetAllAccounts() (map[string][]*UserData, error)

GetAllAccounts gets all registered accounts with corresponding user data. It returns a list of users indexed by accountID.

func (*GoogleWorkspaceManager) GetUserByEmail

func (gm *GoogleWorkspaceManager) GetUserByEmail(email string) ([]*UserData, error)

GetUserByEmail searches users with a given email. If no users have been found, this function returns an empty list.

func (*GoogleWorkspaceManager) GetUserDataByID

func (gm *GoogleWorkspaceManager) GetUserDataByID(userID string, appMetadata AppMetadata) (*UserData, error)

GetUserDataByID requests user data from Google Workspace via ID.

func (*GoogleWorkspaceManager) InviteUserByID

func (gm *GoogleWorkspaceManager) InviteUserByID(_ string) error

InviteUserByID resend invitations to users who haven't activated, their accounts prior to the expiration period.

func (*GoogleWorkspaceManager) UpdateUserAppMetadata

func (gm *GoogleWorkspaceManager) UpdateUserAppMetadata(_ string, _ AppMetadata) error

UpdateUserAppMetadata updates user app metadata based on userID and metadata map.

type JWTToken

type JWTToken struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`

	Scope     string `json:"scope"`
	TokenType string `json:"token_type"`
	// contains filtered or unexported fields
}

JWTToken a JWT object that holds information of a token

type JsonParser

type JsonParser struct{}

func (JsonParser) Marshal

func (JsonParser) Marshal(v interface{}) ([]byte, error)

func (JsonParser) Unmarshal

func (JsonParser) Unmarshal(data []byte, v interface{}) error

type JumpCloudClientConfig

type JumpCloudClientConfig struct {
	APIToken string
}

JumpCloudClientConfig JumpCloud manager client configurations.

type JumpCloudCredentials

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

JumpCloudCredentials JumpCloud authentication information.

func (*JumpCloudCredentials) Authenticate

func (jc *JumpCloudCredentials) Authenticate() (JWTToken, error)

Authenticate retrieves access token to use the JumpCloud user API.

type JumpCloudManager

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

JumpCloudManager JumpCloud manager client instance.

func NewJumpCloudManager

func NewJumpCloudManager(config JumpCloudClientConfig, appMetrics telemetry.AppMetrics) (*JumpCloudManager, error)

NewJumpCloudManager creates a new instance of the JumpCloudManager.

func (*JumpCloudManager) CreateUser

func (jm *JumpCloudManager) CreateUser(_, _, _, _ string) (*UserData, error)

CreateUser creates a new user in JumpCloud Idp and sends an invitation.

func (*JumpCloudManager) DeleteUser

func (jm *JumpCloudManager) DeleteUser(userID string) error

DeleteUser from jumpCloud directory

func (*JumpCloudManager) GetAccount

func (jm *JumpCloudManager) GetAccount(accountID string) ([]*UserData, error)

GetAccount returns all the users for a given profile.

func (*JumpCloudManager) GetAllAccounts

func (jm *JumpCloudManager) GetAllAccounts() (map[string][]*UserData, error)

GetAllAccounts gets all registered accounts with corresponding user data. It returns a list of users indexed by accountID.

func (*JumpCloudManager) GetUserByEmail

func (jm *JumpCloudManager) GetUserByEmail(email string) ([]*UserData, error)

GetUserByEmail searches users with a given email. If no users have been found, this function returns an empty list.

func (*JumpCloudManager) GetUserDataByID

func (jm *JumpCloudManager) GetUserDataByID(userID string, appMetadata AppMetadata) (*UserData, error)

GetUserDataByID requests user data from JumpCloud via ID.

func (*JumpCloudManager) InviteUserByID

func (jm *JumpCloudManager) InviteUserByID(_ string) error

InviteUserByID resend invitations to users who haven't activated, their accounts prior to the expiration period.

func (*JumpCloudManager) UpdateUserAppMetadata

func (jm *JumpCloudManager) UpdateUserAppMetadata(_ string, _ AppMetadata) error

UpdateUserAppMetadata updates user app metadata based on userID and metadata map.

type KeycloakClientConfig

type KeycloakClientConfig struct {
	ClientID      string
	ClientSecret  string
	AdminEndpoint string
	TokenEndpoint string
	GrantType     string
}

KeycloakClientConfig keycloak manager client configurations.

type KeycloakCredentials

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

KeycloakCredentials keycloak authentication information.

func (*KeycloakCredentials) Authenticate

func (kc *KeycloakCredentials) Authenticate() (JWTToken, error)

Authenticate retrieves access token to use the keycloak Management API.

type KeycloakManager

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

KeycloakManager keycloak manager client instance.

func NewKeycloakManager

func NewKeycloakManager(config KeycloakClientConfig, appMetrics telemetry.AppMetrics) (*KeycloakManager, error)

NewKeycloakManager creates a new instance of the KeycloakManager.

func (*KeycloakManager) CreateUser

func (km *KeycloakManager) CreateUser(_, _, _, _ string) (*UserData, error)

CreateUser creates a new user in keycloak Idp and sends an invite.

func (*KeycloakManager) DeleteUser

func (km *KeycloakManager) DeleteUser(userID string) error

DeleteUser from Keycloak by user ID.

func (*KeycloakManager) GetAccount

func (km *KeycloakManager) GetAccount(accountID string) ([]*UserData, error)

GetAccount returns all the users for a given account profile.

func (*KeycloakManager) GetAllAccounts

func (km *KeycloakManager) GetAllAccounts() (map[string][]*UserData, error)

GetAllAccounts gets all registered accounts with corresponding user data. It returns a list of users indexed by accountID.

func (*KeycloakManager) GetUserByEmail

func (km *KeycloakManager) GetUserByEmail(email string) ([]*UserData, error)

GetUserByEmail searches users with a given email. If no users have been found, this function returns an empty list.

func (*KeycloakManager) GetUserDataByID

func (km *KeycloakManager) GetUserDataByID(userID string, _ AppMetadata) (*UserData, error)

GetUserDataByID requests user data from keycloak via ID.

func (*KeycloakManager) InviteUserByID

func (km *KeycloakManager) InviteUserByID(_ string) error

InviteUserByID resend invitations to users who haven't activated, their accounts prior to the expiration period.

func (*KeycloakManager) UpdateUserAppMetadata

func (km *KeycloakManager) UpdateUserAppMetadata(_ string, _ AppMetadata) error

UpdateUserAppMetadata updates user app metadata based on userID and metadata map.

type Manager

type Manager interface {
	UpdateUserAppMetadata(userId string, appMetadata AppMetadata) error
	GetUserDataByID(userId string, appMetadata AppMetadata) (*UserData, error)
	GetAccount(accountId string) ([]*UserData, error)
	GetAllAccounts() (map[string][]*UserData, error)
	CreateUser(email, name, accountID, invitedByEmail string) (*UserData, error)
	GetUserByEmail(email string) ([]*UserData, error)
	InviteUserByID(userID string) error
	DeleteUser(userID string) error
}

Manager idp manager interface

func NewManager

func NewManager(config Config, appMetrics telemetry.AppMetrics) (Manager, error)

NewManager returns a new idp manager based on the configuration that it receives

type ManagerCredentials

type ManagerCredentials interface {
	Authenticate() (JWTToken, error)
}

ManagerCredentials interface that authenticates using the credential of each type of idp

type ManagerHTTPClient

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

ManagerHTTPClient http client interface for API calls

type ManagerHelper

type ManagerHelper interface {
	Marshal(v interface{}) ([]byte, error)
	Unmarshal(data []byte, v interface{}) error
}

ManagerHelper helper

type MockIDP

type MockIDP struct {
	UpdateUserAppMetadataFunc func(userId string, appMetadata AppMetadata) error
	GetUserDataByIDFunc       func(userId string, appMetadata AppMetadata) (*UserData, error)
	GetAccountFunc            func(accountId string) ([]*UserData, error)
	GetAllAccountsFunc        func() (map[string][]*UserData, error)
	CreateUserFunc            func(email, name, accountID, invitedByEmail string) (*UserData, error)
	GetUserByEmailFunc        func(email string) ([]*UserData, error)
	InviteUserByIDFunc        func(userID string) error
	DeleteUserFunc            func(userID string) error
}

MockIDP is a mock implementation of the IDP interface

func (*MockIDP) CreateUser

func (m *MockIDP) CreateUser(email, name, accountID, invitedByEmail string) (*UserData, error)

CreateUser is a mock implementation of the IDP interface CreateUser method

func (*MockIDP) DeleteUser

func (m *MockIDP) DeleteUser(userID string) error

DeleteUser is a mock implementation of the IDP interface DeleteUser method

func (*MockIDP) GetAccount

func (m *MockIDP) GetAccount(accountId string) ([]*UserData, error)

GetAccount is a mock implementation of the IDP interface GetAccount method

func (*MockIDP) GetAllAccounts

func (m *MockIDP) GetAllAccounts() (map[string][]*UserData, error)

GetAllAccounts is a mock implementation of the IDP interface GetAllAccounts method

func (*MockIDP) GetUserByEmail

func (m *MockIDP) GetUserByEmail(email string) ([]*UserData, error)

GetUserByEmail is a mock implementation of the IDP interface GetUserByEmail method

func (*MockIDP) GetUserDataByID

func (m *MockIDP) GetUserDataByID(userId string, appMetadata AppMetadata) (*UserData, error)

GetUserDataByID is a mock implementation of the IDP interface GetUserDataByID method

func (*MockIDP) InviteUserByID

func (m *MockIDP) InviteUserByID(userID string) error

InviteUserByID is a mock implementation of the IDP interface InviteUserByID method

func (*MockIDP) UpdateUserAppMetadata

func (m *MockIDP) UpdateUserAppMetadata(userId string, appMetadata AppMetadata) error

UpdateUserAppMetadata is a mock implementation of the IDP interface UpdateUserAppMetadata method

type OktaClientConfig

type OktaClientConfig struct {
	APIToken      string
	Issuer        string
	TokenEndpoint string
	GrantType     string
}

OktaClientConfig okta manager client configurations.

type OktaCredentials

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

OktaCredentials okta authentication information.

func (*OktaCredentials) Authenticate

func (oc *OktaCredentials) Authenticate() (JWTToken, error)

Authenticate retrieves access token to use the okta user API.

type OktaManager

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

OktaManager okta manager client instance.

func NewOktaManager

func NewOktaManager(config OktaClientConfig, appMetrics telemetry.AppMetrics) (*OktaManager, error)

NewOktaManager creates a new instance of the OktaManager.

func (*OktaManager) CreateUser

func (om *OktaManager) CreateUser(_, _, _, _ string) (*UserData, error)

CreateUser creates a new user in okta Idp and sends an invitation.

func (*OktaManager) DeleteUser

func (om *OktaManager) DeleteUser(userID string) error

DeleteUser from Okta

func (*OktaManager) GetAccount

func (om *OktaManager) GetAccount(accountID string) ([]*UserData, error)

GetAccount returns all the users for a given profile.

func (*OktaManager) GetAllAccounts

func (om *OktaManager) GetAllAccounts() (map[string][]*UserData, error)

GetAllAccounts gets all registered accounts with corresponding user data. It returns a list of users indexed by accountID.

func (*OktaManager) GetUserByEmail

func (om *OktaManager) GetUserByEmail(email string) ([]*UserData, error)

GetUserByEmail searches users with a given email. If no users have been found, this function returns an empty list.

func (*OktaManager) GetUserDataByID

func (om *OktaManager) GetUserDataByID(userID string, appMetadata AppMetadata) (*UserData, error)

GetUserDataByID requests user data from keycloak via ID.

func (*OktaManager) InviteUserByID

func (om *OktaManager) InviteUserByID(_ string) error

InviteUserByID resend invitations to users who haven't activated, their accounts prior to the expiration period.

func (*OktaManager) UpdateUserAppMetadata

func (om *OktaManager) UpdateUserAppMetadata(userID string, appMetadata AppMetadata) error

UpdateUserAppMetadata updates user app metadata based on userID and metadata map.

type UserData

type UserData struct {
	Email       string      `json:"email"`
	Name        string      `json:"name"`
	ID          string      `json:"user_id"`
	AppMetadata AppMetadata `json:"app_metadata"`
}

type ZitadelClientConfig

type ZitadelClientConfig struct {
	ClientID           string
	ClientSecret       string
	GrantType          string
	TokenEndpoint      string
	ManagementEndpoint string
}

ZitadelClientConfig zitadel manager client configurations.

type ZitadelCredentials

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

ZitadelCredentials zitadel authentication information.

func (*ZitadelCredentials) Authenticate

func (zc *ZitadelCredentials) Authenticate() (JWTToken, error)

Authenticate retrieves access token to use the Zitadel Management API.

type ZitadelManager

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

ZitadelManager zitadel manager client instance.

func NewZitadelManager

func NewZitadelManager(config ZitadelClientConfig, appMetrics telemetry.AppMetrics) (*ZitadelManager, error)

NewZitadelManager creates a new instance of the ZitadelManager.

func (*ZitadelManager) CreateUser

func (zm *ZitadelManager) CreateUser(email, name, accountID, invitedByEmail string) (*UserData, error)

CreateUser creates a new user in zitadel Idp and sends an invite via Zitadel.

func (*ZitadelManager) DeleteUser

func (zm *ZitadelManager) DeleteUser(userID string) error

DeleteUser from Zitadel

func (*ZitadelManager) GetAccount

func (zm *ZitadelManager) GetAccount(accountID string) ([]*UserData, error)

GetAccount returns all the users for a given profile.

func (*ZitadelManager) GetAllAccounts

func (zm *ZitadelManager) GetAllAccounts() (map[string][]*UserData, error)

GetAllAccounts gets all registered accounts with corresponding user data. It returns a list of users indexed by accountID.

func (*ZitadelManager) GetUserByEmail

func (zm *ZitadelManager) GetUserByEmail(email string) ([]*UserData, error)

GetUserByEmail searches users with a given email. If no users have been found, this function returns an empty list.

func (*ZitadelManager) GetUserDataByID

func (zm *ZitadelManager) GetUserDataByID(userID string, appMetadata AppMetadata) (*UserData, error)

GetUserDataByID requests user data from zitadel via ID.

func (*ZitadelManager) InviteUserByID

func (zm *ZitadelManager) InviteUserByID(userID string) error

InviteUserByID resend invitations to users who haven't activated, their accounts prior to the expiration period.

func (*ZitadelManager) UpdateUserAppMetadata

func (zm *ZitadelManager) UpdateUserAppMetadata(_ string, _ AppMetadata) error

UpdateUserAppMetadata updates user app metadata based on userID and metadata map. Metadata values are base64 encoded.

Jump to

Keyboard shortcuts

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