Documentation
¶
Overview ¶
Package `portal` provides a client wrapping the WorkOS Admin Portal API.
Index ¶
Constants ¶
View Source
const ResponseLimit = 10
ResponseLimit is the default number of records to limit a response to.
Variables ¶
View Source
var (
DefaultClient = &Client{
Endpoint: "https://api.workos.com",
}
)
DefaultClient is the client used by SetAPIKey and Admin Portal functions.
Functions ¶
func GenerateLink ¶
func GenerateLink( ctx context.Context, opts GenerateLinkOpts, ) (string, error)
GenerateLink generates an ephemeral link to the Admin Portal
Types ¶
type Client ¶
type Client struct {
// The WorkOS API Key. It can be found in https://dashboard.workos.com/api-keys.
APIKey string
// The http.Client that is used to manage Admin Portal records from WorkOS.
// Defaults to http.Client.
HTTPClient *http.Client
// The endpoint to WorkOS API. Defaults to https://api.workos.com.
Endpoint string
// The function used to encode in JSON. Defaults to json.Marshal.
JSONEncode func(v interface{}) ([]byte, error)
// contains filtered or unexported fields
}
Client represents a client that performs Admin Portal requests to the WorkOS API.
func (*Client) GenerateLink ¶
GenerateLink generates a link to the Admin Portal
type GenerateLinkIntent ¶
type GenerateLinkIntent string
GenerateLinkIntent represents the intent of an Admin Portal.
const ( SSO GenerateLinkIntent = "sso" DSync GenerateLinkIntent = "dsync" AuditLogs GenerateLinkIntent = "audit_logs" LogStreams GenerateLinkIntent = "log_streams" )
Constants that enumerate the available GenerateLinkIntent types.
type GenerateLinkOpts ¶
type GenerateLinkOpts struct {
// Intent of the Admin Portal
Intent GenerateLinkIntent `json:"intent"`
// Organization identifier to scope the Portal Session
Organization string `json:"organization"`
// The URL to which WorkOS should send users when they click on the link to return to your website.
ReturnURL string `json:"return_url"`
// The URL to which WorkOS will redirect users to upon successfully setting up Single Sign On or Directory Sync.
SuccessURL string `json:"success_url"`
}
GenerateLinkOpts contains the options to request Organizations.
Click to show internal directories.
Click to hide internal directories.