frontegg

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SSORolesApiPathV1 = "/frontegg/team/resources/sso/v1/configurations/%s/roles"
	SSORolesApiPathV2 = "/identity/resources/roles/v2"
)
View Source
const (
	UsersApiPathV1 = "/identity/resources/users/v1"
	UsersApiPathV2 = "/identity/resources/users/v2"
)
View Source
const (
	ApiTokenPath = "/identity/resources/users/api-tokens/v1"
)
View Source
const (
	SSOConfigurationsApiPathV1 = "/frontegg/team/resources/sso/v1/configurations"
)
View Source
const (
	SSODomainsApiPathV1 = "/frontegg/team/resources/sso/v1/configurations"
)
View Source
const (
	SSOGroupMappingApiPathV1 = "/frontegg/team/resources/sso/v1/configurations"
)

Variables

This section is empty.

Functions

func ClearSSODefaultRoles added in v0.6.8

func ClearSSODefaultRoles(ctx context.Context, client *clients.FronteggClient, configID string) error

ClearSSODefaultRoles clears the default roles for an SSO configuration.

func DeleteSSOConfiguration added in v0.6.7

func DeleteSSOConfiguration(ctx context.Context, client *clients.FronteggClient, configId string) error

DeleteSSOConfiguration deletes an existing SSO configuration

func DeleteSSODomain added in v0.6.8

func DeleteSSODomain(ctx context.Context, client *clients.FronteggClient, configID, domainID string) error

DeleteSSODomain deletes a specific SSO domain.

func DeleteSSOGroupMapping added in v0.6.8

func DeleteSSOGroupMapping(ctx context.Context, client *clients.FronteggClient, ssoConfigID, groupID string) error

DeleteSSOGroupMapping deletes an existing SSO group role mapping.

func DeleteUser added in v0.6.6

func DeleteUser(ctx context.Context, client *clients.FronteggClient, userID string) error

DeleteUser deletes a user from Frontegg.

func FlattenSCIM2Configurations

func FlattenSCIM2Configurations(configurations SCIM2ConfigurationsResponse) []interface{}

Helper function to flatten the SCIM 2.0 configurations data

func FlattenSSOConfigurations added in v0.6.7

func FlattenSSOConfigurations(configurations SSOConfigurationsResponse) []interface{}

Helper function to flatten the SSO configurations data

func GetAppPasswordApiEndpoint added in v0.6.6

func GetAppPasswordApiEndpoint(client *clients.FronteggClient, resourcePath string, resourceID ...string) string

Helper function to construct the full API endpoint for app passwords

func GetSSODefaultRoles added in v0.6.8

func GetSSODefaultRoles(ctx context.Context, client *clients.FronteggClient, configID string) ([]string, error)

GetSSODefaultRoles retrieves the default roles for an SSO configuration.

func GetSSOGroupMappings added in v0.6.8

func GetSSOGroupMappings(ctx context.Context, client *clients.FronteggClient, ssoConfigID string) (*[]GroupMapping, error)

GetSSOGroupMappings retrieves all SSO group role mappings for a specific SSO configuration.

func ListSSORoles added in v0.6.8

func ListSSORoles(ctx context.Context, client *clients.FronteggClient) (map[string]string, error)

ListRoles fetches roles from the Frontegg API and returns a map of role names to their IDs.

func SetSSODefaultRoles added in v0.6.8

func SetSSODefaultRoles(ctx context.Context, client *clients.FronteggClient, configID string, roleIDs []string) error

SetSSODefaultRoles sets the default roles for an SSO configuration.

Types

type AppPasswordResponse added in v0.6.6

type AppPasswordResponse struct {
	ClientID    string    `json:"clientId"`
	Description string    `json:"description"`
	Owner       string    `json:"owner"`
	CreatedAt   time.Time `json:"created_at"`
	Secret      string    `json:"secret"`
}

func ListAppPasswords added in v0.6.6

func ListAppPasswords(ctx context.Context, client *clients.FronteggClient) ([]AppPasswordResponse, error)

ListAppPasswords fetches a list of app passwords from the API.

type Domain added in v0.6.7

type Domain struct {
	ID          string `json:"id"`
	Domain      string `json:"domain"`
	Validated   bool   `json:"validated"`
	SsoConfigId string `json:"ssoConfigId"`
}

Domain represents the structure for SSO domain.

func CreateSSODomain added in v0.6.8

func CreateSSODomain(ctx context.Context, client *clients.FronteggClient, configID, domainName string) (*Domain, error)

CreateDomain creates a new SSO domain.

func FetchSSODomain added in v0.6.8

func FetchSSODomain(ctx context.Context, client *clients.FronteggClient, configID, domainName string) (*Domain, error)

FetchSSODomain fetches a specific SSO domain.

type FronteggRole added in v0.6.8

type FronteggRole struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type FronteggRolesResponse added in v0.6.8

type FronteggRolesResponse struct {
	Items    []FronteggRole `json:"items"`
	Metadata struct {
		TotalItems int `json:"totalItems"`
		TotalPages int `json:"totalPages"`
	} `json:"_metadata"`
}

type GroupMapping added in v0.6.8

type GroupMapping struct {
	ID          string   `json:"id"`
	Group       string   `json:"group"`
	Enabled     bool     `json:"enabled"`
	RoleIds     []string `json:"roleIds"`
	SsoConfigId string   `json:"-"`
}

GroupMapping represents the structure for SSO group role mapping.

func CreateSSOGroupMapping added in v0.6.8

func CreateSSOGroupMapping(ctx context.Context, client *clients.FronteggClient, ssoConfigID, group string, roleIDs []string) (*GroupMapping, error)

CreateSSOGroupMapping creates a new SSO group role mapping.

func FetchSSOGroupMapping added in v0.6.8

func FetchSSOGroupMapping(ctx context.Context, client *clients.FronteggClient, ssoConfigID, groupID string) (*GroupMapping, error)

FetchSSOGroupMapping retrieves a specific SSO group role mapping.

func UpdateSSOGroupMapping added in v0.6.8

func UpdateSSOGroupMapping(ctx context.Context, client *clients.FronteggClient, ssoConfigID, groupID, group string, roleIDs []string) (*GroupMapping, error)

UpdateSSOGroupMapping updates an existing SSO group role mapping.

type RoleIDs added in v0.6.8

type RoleIDs struct {
	RoleIds []string `json:"roleIds"`
}

type SCIM2Configuration

type SCIM2Configuration struct {
	ID                   string    `json:"id"`
	Source               string    `json:"source"`
	TenantID             string    `json:"tenantId"`
	ConnectionName       string    `json:"connectionName"`
	SyncToUserManagement bool      `json:"syncToUserManagement"`
	CreatedAt            time.Time `json:"createdAt"`
	Token                string    `json:"token"`
}

SCIM 2.0 Configurations API response

type SCIM2ConfigurationsResponse

type SCIM2ConfigurationsResponse []SCIM2Configuration

func FetchSCIM2Configurations

func FetchSCIM2Configurations(ctx context.Context, client *clients.FronteggClient) (SCIM2ConfigurationsResponse, error)

FetchSCIM2Configurations fetches the SCIM 2.0 configurations

type SSOConfig added in v0.6.7

type SSOConfig struct {
	Id                string    `json:"id"`
	Enabled           bool      `json:"enabled"`
	SsoEndpoint       string    `json:"ssoEndpoint"`
	PublicCertificate string    `json:"publicCertificate"`
	SignRequest       bool      `json:"signRequest"`
	AcsUrl            string    `json:"acsUrl"`
	SpEntityId        string    `json:"spEntityId"`
	Type              string    `json:"type"`
	OidcClientId      string    `json:"oidcClientId"`
	OidcSecret        string    `json:"oidcSecret"`
	CreatedAt         time.Time `json:"createdAt"`
	Domains           []Domain
}

SSOConfig represents the structure for SSO configuration.

func CreateSSOConfiguration added in v0.6.7

func CreateSSOConfiguration(ctx context.Context, client *clients.FronteggClient, ssoConfig SSOConfig) (*SSOConfig, error)

CreateSSOConfiguration creates a new SSO configuration

func UpdateSSOConfiguration added in v0.6.7

func UpdateSSOConfiguration(ctx context.Context, client *clients.FronteggClient, ssoConfig SSOConfig) (*SSOConfig, error)

UpdateSSOConfiguration updates an existing SSO configuration

type SSOConfigurationsResponse added in v0.6.7

type SSOConfigurationsResponse []SSOConfig

func FetchSSOConfigurations added in v0.6.7

func FetchSSOConfigurations(ctx context.Context, client *clients.FronteggClient) (SSOConfigurationsResponse, error)

FetchSSOConfigurations fetches the SSO configurations

type UserRequest added in v0.6.6

type UserRequest struct {
	Email   string   `json:"email"`
	RoleIDs []string `json:"roleIds"`
}

UserRequest represents the request payload for creating or updating a user.

type UserResponse added in v0.6.6

type UserResponse struct {
	ID                string `json:"id"`
	Email             string `json:"email"`
	ProfilePictureURL string `json:"profilePictureUrl"`
	Verified          bool   `json:"verified"`
	Metadata          string `json:"metadata"`
	Provider          string `json:"provider"`
}

UserResponse represents the structure of a user response from Frontegg APIs.

func CreateUser added in v0.6.6

func CreateUser(ctx context.Context, client *clients.FronteggClient, userRequest UserRequest) (UserResponse, error)

CreateUser creates a new user in Frontegg.

func ReadUser added in v0.6.6

func ReadUser(ctx context.Context, client *clients.FronteggClient, userID string) (UserResponse, error)

ReadUser retrieves a user's details from Frontegg.

Jump to

Keyboard shortcuts

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