authn

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	IDPFacebook        IDProvider = "facebook"
	IDPGithub                     = "github"
	IDPGoogle                     = "google"
	IDPMicrosoftOnline            = "microsoftonline"
	IDPPassword                   = "password"
)
View Source
const (
	MFAPTOTP     MFAProvider = "totp"
	MFAPEmailOTP             = "email_otp"
	IDPSMSOTP                = "sms_otp"
)
View Source
const (
	ULOBid          UserListOrderBy = "id"
	ULOBcreatedAt                   = "created_at"
	ULOBlastLoginAt                 = "last_login_at"
	ULOBemail                       = "email"
)
View Source
const (
	UILOBid        UserListOrderBy = "id"
	UILOBcreatedAt                 = "created_at"
	UILOBtype                      = "type"
	UILOBexpire                    = "expire"
	UILOBcallback                  = "callback"
	UILOBstate                     = "state"
	UILOBemail                     = "email"
	UILOBinviter                   = "inviter"
	UILOBinviteOrg                 = "invite_org"
)
View Source
const (
	FCAgreements            FlowChoice = "agreements"
	FCCaptcha                          = "captcha"
	FCEmailOTP                         = "email_otp"
	FCMagiclink                        = "magiclink"
	FCPassword                         = "password"
	FCProfile                          = "profile"
	FCProvisionalEnrollment            = "provisional_enrollment"
	FCResetPassword                    = "reset_password"
	FCSetEmail                         = "set_mail"
	FCSetPassword                      = "set_password"
	FCSMSOTP                           = "sms_otp"
	FCSocial                           = "social"
	FCTOTP                             = "totp"
	FCVerifyEmail                      = "verify_email"
)
View Source
const (
	SLOBid            SessionListOrderBy = "id"
	SLOBcreatedAt                        = "created_at"
	SLOBtype                             = "type"
	SLOBidentity                         = "identity"
	SLOBemail                            = "email"
	SLOBexpire                           = "expire"
	SLOBactiveTokenID                    = "active_token_id"
)
View Source
const (
	ALOBid        AgreementListOrderBy = "id"
	ALOBcreatedAt                      = "created_at"
	ALOBname                           = "name"
	ALOBtext                           = "text"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AgreementCreateRequest

type AgreementCreateRequest struct {
	pangea.BaseRequest

	Type   AgreementType `json:"type"`
	Name   string        `json:"name"`
	Text   string        `json:"text"`
	Active *bool         `json:"active,omitempty"`
}

type AgreementCreateResult

type AgreementCreateResult AgreementInfo

type AgreementDeleteRequest

type AgreementDeleteRequest struct {
	pangea.BaseRequest

	Type AgreementType `json:"type"`
	ID   string        `json:"id"`
}

type AgreementDeleteResult

type AgreementDeleteResult struct{}

type AgreementInfo

type AgreementInfo struct {
	Type        string `json:"type"`
	ID          string `json:"id"`
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
	PublishedAt string `json:"published_at,omitempty"`
	Name        string `json:"name"`
	Text        string `json:"text"`
	Active      bool   `json:"active"`
}

type AgreementListOrderBy

type AgreementListOrderBy string

type AgreementListRequest

type AgreementListRequest struct {
	pangea.BaseRequest

	// Should use FilterAgreementList object here
	Filter  map[string]any       `json:"filter,omitempty"`
	Last    string               `json:"last,omitempty"`
	Order   ItemOrder            `json:"order,omitempty"`
	OrderBy AgreementListOrderBy `json:"order_by,omitempty"`
	Size    int                  `json:"size,omitempty"`
}

type AgreementListResult

type AgreementListResult struct {
	Agreements []AgreementInfo `json:"agreements"`
	Count      int             `json:"count"`
	Last       string          `json:"last,omitempty"`
}

type AgreementType

type AgreementType string
const (
	ATeula          AgreementType = "eula"
	ATprivacyPolicy               = "privacy_policy"
)

type AgreementUpdateRequest

type AgreementUpdateRequest struct {
	pangea.BaseRequest

	Type   AgreementType `json:"type"`
	ID     string        `json:"id"`
	Name   *string       `json:"name,omitempty"`
	Text   *string       `json:"text,omitempty"`
	Active *bool         `json:"active,omitempty"`
}

type AgreementUpdateResult

type AgreementUpdateResult AgreementInfo

type Agreements

type Agreements struct {
	*pangea.Client
}

func (*Agreements) Create

@summary Create an agreement

@description Create an agreement.

@operationId authn_post_v2_agreements_create

@example

input := authn.AgreementCreateRequest{
	Type: authn.ATeula,
	Name: "EULA_V1",
	Text: "You agree to behave yourself while logged in.",
}

resp, err := authncli.Agreements.Create(ctx, input)

func (*Agreements) Delete

@summary Delete an agreement

@description Delete an agreement.

@operationId authn_post_v2_agreements_delete

@example

input := authn.AgreementDeleteRequest{
	Type: authn.ATeula,
	ID: "peu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
}

resp, err := authncli.Agreements.Delete(ctx, input)

func (*Agreements) List

@summary List agreements

@description List agreements.

@operationId authn_post_v2_agreements_list

@example

input := authn.AgreementListRequest{}

resp, err := authncli.Agreements.List(ctx, input)

func (*Agreements) Update

@summary Update agreement

@description Update agreement.

@operationId authn_post_v2_agreements_update

@example

input := authn.AgreementUpdateRequest{
	Type: authn.ATeula,
	ID: pangea.String("peu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a"),
	Text: pangea.String("You agree to behave yourself while logged in. Don't be evil."),
}

resp, err := authncli.Agreements.Update(ctx, input)

type AuthN

type AuthN struct {
	User       *User
	Flow       *Flow
	Client     *Client
	Session    *Session
	Agreements *Agreements
	// contains filtered or unexported fields
}

func New

func New(cfg *pangea.Config) *AuthN

type Authenticator

type Authenticator struct {
	ID       string  `json:"id"`
	Type     string  `json:"type"`
	Enable   bool    `json:"enable"`
	Provider *string `json:"provider,omitempty"`
	RPID     *string `json:"rpid,omitempty"`
	Phase    *string `json:"phase,omitempty"`
}

type Client

type Client struct {
	Session  *ClientSession
	Password *ClientPassword
	Token    *ClientToken
	// contains filtered or unexported fields
}

func (*Client) JWKS

@summary Get JWT verification keys

@description Get JWT verification keys.

@operationId authn_post_v2_client_jwks

@example

resp, err := authncli.Client.JWKS(ctx)

func (*Client) Userinfo

@summary Get User (client token)

@description Retrieve the logged in user's token and information.

@operationId authn_post_v2_client_userinfo

@example

input := authn.ClientUserinfoRequest{
	Code: "pmc_d6chl6qulpn3it34oerwm3cqwsjd6dxw",
}

esp, err := authncli.Client.Userinfo(ctx, input)

type ClientJWKSResult

type ClientJWKSResult struct {
	Keys []v.JWT `json:"keys"`
}

type ClientPassword

type ClientPassword struct {
	*pangea.Client
}

func (*ClientPassword) Change

@summary Change a user's password

@description Change a user's password given the current password.

@operationId authn_post_v2_client_password_change

@example

input := authn.ClientPasswordChangeRequest{
	Token: "ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
	OldPassword: "hunter2",
	NewPassword: "My2n+Password",
}

resp, err := authncli.Client.Password.Change(ctx, input)

type ClientPasswordChangeRequest

type ClientPasswordChangeRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Token       string `json:"token"`
	OldPassword string `json:"old_password"`
	NewPassword string `json:"new_password"`
}

type ClientPasswordChangeResult

type ClientPasswordChangeResult struct {
}

type ClientSession

type ClientSession struct {
	*pangea.Client
}

func (*ClientSession) Invalidate

@summary Invalidate Session | Client

@description Invalidate a session by session ID using a client token.

@operationId authn_post_v2_client_session_invalidate

@example

input := authn.ClientSessionInvalidateRequest{
	Token: "ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
	SessionID: "pmt_zppkzrjguxyblaia6itbiesejn7jejnr",
}

resp, err := authncli.Client.Session.Invalidate(ctx, input)

func (*ClientSession) List

@summary List sessions (client token)

@description List sessions using a client token.

@operationId authn_post_v2_client_session_list

@example

input := authn.ClientSessionListRequest{
	Token: "ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
}

resp, err := authncli.Client.Session.List(ctx, input)

func (*ClientSession) Logout

@summary Log out (client token)

@description Log out the current user's session.

@operationId authn_post_v2_client_session_logout

@example

input := authn.ClientSessionLogoutRequest{
	Token: "ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
}

resp, err := authncli.Client.Session.Logout(ctx, input)

func (*ClientSession) Refresh

@summary Refresh a Session

@description Refresh a session token.

@operationId authn_post_v2_client_session_refresh

@example

input := authn.ClientSessionRefreshRequest{
	RefreshToken: "ptr_xpkhwpnz2cmegsws737xbsqnmnuwtbm5",
	UserToken: "ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
}

resp, err := authncli.Client.Session.Refresh(ctx, input)

type ClientSessionInvalidateRequest

type ClientSessionInvalidateRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Token     string `json:"token"`
	SessionID string `json:"session_id"`
}

type ClientSessionInvalidateResult

type ClientSessionInvalidateResult struct {
}

type ClientSessionListRequest

type ClientSessionListRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Token string `json:"token"`

	// Should use FilterSessionList object here
	Filter  pangea.Filter      `json:"filter,omitempty"`
	Last    string             `json:"last,omitempty"`
	Order   ItemOrder          `json:"order,omitempty"`
	OrderBy SessionListOrderBy `json:"order_by,omitempty"`
}

type ClientSessionLogoutRequest

type ClientSessionLogoutRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Token string `json:"token"`
}

type ClientSessionLogoutResult

type ClientSessionLogoutResult struct {
}

type ClientSessionRefreshRequest

type ClientSessionRefreshRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	RefreshToken string `json:"refresh_token"`
	UserToken    string `json:"user_token,omitempty"`
}

type ClientSessionRefreshResult

type ClientSessionRefreshResult struct {
	RefreshToken LoginToken `json:"refresh_token"`
	ActiveToken  LoginToken `json:"active_token"`
}

type ClientToken

type ClientToken struct {
	*pangea.Client
}

func (*ClientToken) Check

@summary Check a token

@description Look up a token and return its contents.

@operationId authn_post_v2_client_token_check

@example

input := authn.ClientTokenCheckRequest{
	Token: "ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
}

resp, err := authcli.Client.Token.Check(ctx, input)

type ClientTokenCheckRequest

type ClientTokenCheckRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Token string `json:"token"`
}

type ClientTokenCheckResult

type ClientTokenCheckResult struct {
	ID        string      `json:"id"`
	Type      string      `json:"type"`
	Life      int         `json:"life"`
	Expire    string      `json:"expire"`
	Identity  string      `json:"identity"`
	Email     string      `json:"email"`
	Scopes    Scopes      `json:"scopes"`
	Profile   ProfileData `json:"profile"`
	CreatedAt string      `json:"created_at"`
}

type ClientUserinfoRequest

type ClientUserinfoRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Code string `json:"code"`
}

type ClientUserinfoResult

type ClientUserinfoResult struct {
	RefreshToken LoginToken  `json:"refresh_token"`
	ActiveToken  *LoginToken `json:"active_token,omitempty"`
}

type CommonFlowResult

type CommonFlowResult struct {
	FlowID      string           `json:"flow_id"`
	FlowType    []string         `json:"flow_type"`
	Email       string           `json:"email"`
	Disclaimer  string           `json:"disclaimer"`
	FlowPhase   string           `json:"flow_phase"`
	FlowChoices []FlowChoiceItem `json:"flow_choices"`
}

type DomainIntelligence

type DomainIntelligence struct {
	IsBad      bool              `json:"is_bad"`
	Reputation di.ReputationData `json:"reputation"`
}

type FilterAgreementList

type FilterAgreementList struct {
	pangea.FilterBase
	// contains filtered or unexported fields
}

func NewFilterAgreementList

func NewFilterAgreementList() *FilterAgreementList

func (*FilterAgreementList) Active

func (*FilterAgreementList) CreatedAt

func (f *FilterAgreementList) CreatedAt() *pangea.FilterRange[string]

func (*FilterAgreementList) ID

func (*FilterAgreementList) Name

func (*FilterAgreementList) PublishedAt

func (f *FilterAgreementList) PublishedAt() *pangea.FilterRange[string]

func (*FilterAgreementList) Text

func (*FilterAgreementList) Type

type FilterSessionList

type FilterSessionList struct {
	pangea.FilterBase
	// contains filtered or unexported fields
}

func NewFilterSessionList

func NewFilterSessionList() *FilterSessionList

func (*FilterSessionList) CreatedAt

func (f *FilterSessionList) CreatedAt() *pangea.FilterRange[string]

func (*FilterSessionList) Email

func (*FilterSessionList) Expire

func (*FilterSessionList) ID

func (*FilterSessionList) Identity

func (f *FilterSessionList) Identity() *pangea.FilterMatch[string]

func (*FilterSessionList) Scopes

func (f *FilterSessionList) Scopes() *pangea.FilterEqual[[]string]

func (*FilterSessionList) Type

type FilterUserInviteList

type FilterUserInviteList struct {
	pangea.FilterBase
	// contains filtered or unexported fields
}

FilterUserInviteList represents the filter criteria for user invites.

func NewFilterUserInviteList

func NewFilterUserInviteList() *FilterUserInviteList

func (*FilterUserInviteList) Callback

func (*FilterUserInviteList) CreatedAt

func (f *FilterUserInviteList) CreatedAt() *pangea.FilterRange[string]

func (*FilterUserInviteList) Email

func (*FilterUserInviteList) Expire

func (*FilterUserInviteList) ID

func (*FilterUserInviteList) InviteOrg

func (f *FilterUserInviteList) InviteOrg() *pangea.FilterMatch[string]

func (*FilterUserInviteList) Inviter

func (*FilterUserInviteList) RequireMFA

func (f *FilterUserInviteList) RequireMFA() *pangea.FilterEqual[bool]

func (*FilterUserInviteList) Signup

func (*FilterUserInviteList) State

type FilterUserList

type FilterUserList struct {
	pangea.FilterBase
	// contains filtered or unexported fields
}

func NewFilterUserList

func NewFilterUserList() *FilterUserList

func (*FilterUserList) AcceptedEulaID

func (fu *FilterUserList) AcceptedEulaID() *pangea.FilterMatch[string]

func (*FilterUserList) CreatedAt

func (fu *FilterUserList) CreatedAt() *pangea.FilterRange[string]

func (*FilterUserList) Disabled

func (fu *FilterUserList) Disabled() *pangea.FilterEqual[bool]

func (*FilterUserList) Email

func (fu *FilterUserList) Email() *pangea.FilterMatch[string]

func (*FilterUserList) ID

func (*FilterUserList) LastLoginAt

func (fu *FilterUserList) LastLoginAt() *pangea.FilterMatch[string]

func (*FilterUserList) LastLoginCity

func (fu *FilterUserList) LastLoginCity() *pangea.FilterMatch[string]

func (*FilterUserList) LastLoginCountry

func (fu *FilterUserList) LastLoginCountry() *pangea.FilterMatch[string]

func (*FilterUserList) LastLoginIP

func (fu *FilterUserList) LastLoginIP() *pangea.FilterMatch[string]

func (*FilterUserList) LoginCount

func (fu *FilterUserList) LoginCount() *pangea.FilterRange[int]

func (*FilterUserList) RequireMFA

func (fu *FilterUserList) RequireMFA() *pangea.FilterEqual[bool]

func (*FilterUserList) Scopes

func (fu *FilterUserList) Scopes() *pangea.FilterEqual[[]string]

func (*FilterUserList) Verified

func (fu *FilterUserList) Verified() *pangea.FilterEqual[bool]

type Flow

type Flow struct {
	*pangea.Client
}

func (*Flow) Complete

@summary Complete sign-up/sign-in

@description Complete a sign-up or sign-in flow.

@operationId authn_post_v2_flow_complete

@example

input := authn.FlowCompleteRequest{
	FlowID: "pfl_dxiqyuq7ndc5ycjwdgmguwuodizcaqhh",
}

resp, err := authncli.Flow.Complete(ctx, input)

func (*Flow) Restart

@summary Restart a sign-up/sign-in flow

@description Restart a signup-up/in flow choice.

@operationId authn_post_v2_flow_restart

@example

input := authn.FlowRestartRequest{
	FlowID: "pfl_dxiqyuq7ndc5ycjwdgmguwuodizcaqhh",
	Choice: authn.FCPassword,
	Data: authn.FlowRestartData{},
}

resp, err := authncli.Flow.Restart(ctx, input)

func (*Flow) Start

@summary Start a sign-up/sign-in flow

@description Start a new sign-up or sign-in flow.

@operationId authn_post_v2_flow_start

@example

fts := []FlowType{authn.FTsignin,authn.FTsignup}
input := authn.FlowStartRequest{
	CBURI: "https://www.myserver.com/callback",
	Email: "joe.user@email.com",
	FlowTypes: fts,
	Provider: &authn.IDPPassword,
}

resp, err := authncli.Flow.Start(ctx, input)

func (*Flow) Update

@summary Update a sign-up/sign-in flow

@description Update a sign-up/sign-in flow.

@operationId authn_post_v2_flow_update

@example

input := authn.FlowUpdateRequest{
	FlowID: "pfl_dxiqyuq7ndc5ycjwdgmguwuodizcaqhh",
	Choice: authn.FCPassword,
	Data: authn.FlowUpdateDataPassword{
		Password: "somenewpassword",
	}
}

resp, err := authncli.Flow.Update(ctx, input)

type FlowChoice

type FlowChoice string

type FlowChoiceItem

type FlowChoiceItem struct {
	Choice string         `json:"choice"`
	Data   map[string]any `json:"data"`
}

type FlowCompleteRequest

type FlowCompleteRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	FlowID string `json:"flow_id"`
}

type FlowCompleteResult

type FlowCompleteResult struct {
	RefreshToken LoginToken `json:"refresh_token"`
	ActiveToken  LoginToken `json:"active_token"`
}

type FlowRestartData

type FlowRestartData struct{}

type FlowRestartDataSMSOTP

type FlowRestartDataSMSOTP struct {
	FlowRestartData
	Phone string `json:"phone"`
}

type FlowRestartRequest

type FlowRestartRequest struct {
	pangea.BaseRequest
	FlowID string          `json:"flow_id"`
	Choice FlowChoice      `json:"choice"`
	Data   FlowRestartData `json:"data"`
}

type FlowRestartResult

type FlowRestartResult struct {
	CommonFlowResult
}

type FlowStartRequest

type FlowStartRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	CBURI     string      `json:"cb_uri,omitempty"`
	Email     string      `json:"email,omitempty"`
	FlowTypes []FlowType  `json:"flow_types,omitempty"`
	Provider  *IDProvider `json:"provider,omitempty"`
}

type FlowStartResult

type FlowStartResult struct {
	CommonFlowResult
}

type FlowType

type FlowType string
const (
	FTsignin FlowType = "signin"
	FTsignup          = "signup"
)

type FlowUpdateData

type FlowUpdateData struct{}

func (FlowUpdateData) IsFlowUpdaterData

func (fud FlowUpdateData) IsFlowUpdaterData() bool

type FlowUpdateDataAgreements

type FlowUpdateDataAgreements struct {
	FlowUpdateData
	Agreed []string `json:"agreed"`
}

type FlowUpdateDataCaptcha

type FlowUpdateDataCaptcha struct {
	FlowUpdateData
	Code string `json:"code"`
}

type FlowUpdateDataEmailOTP

type FlowUpdateDataEmailOTP struct {
	FlowUpdateData
	Code string `json:"code"`
}
type FlowUpdateDataMagiclink struct {
	FlowUpdateData
	State string `json:"state"`
	Code  string `json:"code"`
}

type FlowUpdateDataPassword

type FlowUpdateDataPassword struct {
	FlowUpdateData
	Password string `json:"password"`
}

type FlowUpdateDataProfile

type FlowUpdateDataProfile struct {
	FlowUpdateData
	Profile ProfileData `json:"profile"`
}

type FlowUpdateDataProvisionalEnrollment

type FlowUpdateDataProvisionalEnrollment struct {
	FlowUpdateData
	State string `json:"state"`
	Code  string `json:"code"`
}

type FlowUpdateDataResetPassword

type FlowUpdateDataResetPassword struct {
	FlowUpdateData
	State string `json:"state"`
	Code  string `json:"code"`
}

type FlowUpdateDataSMSOTP

type FlowUpdateDataSMSOTP struct {
	FlowUpdateData
	Code string `json:"code"`
}

type FlowUpdateDataSetEmail

type FlowUpdateDataSetEmail struct {
	FlowUpdateData
	Email string `json:"email"`
}

type FlowUpdateDataSetPassword

type FlowUpdateDataSetPassword struct {
	FlowUpdateData
	Password string `json:"password"`
}

type FlowUpdateDataSocialProvider

type FlowUpdateDataSocialProvider struct {
	FlowUpdateData
	SocialProvider string `json:"social_provider"`
	URI            string `json:"uri"`
}

type FlowUpdateDataTOTP

type FlowUpdateDataTOTP struct {
	FlowUpdateData
	Code string `json:"code"`
}

type FlowUpdateDataVerifyEmail

type FlowUpdateDataVerifyEmail struct {
	FlowUpdateData
	State string `json:"state"`
	Code  string `json:"code"`
}

type FlowUpdateRequest

type FlowUpdateRequest struct {
	pangea.BaseRequest
	FlowID string          `json:"flow_id"`
	Choice FlowChoice      `json:"choice"`
	Data   FlowUpdaterData `json:"data"`
}

type FlowUpdateResult

type FlowUpdateResult struct {
	CommonFlowResult
}

type FlowUpdaterData

type FlowUpdaterData interface {
	IsFlowUpdaterData() bool
}

type IDProvider

type IDProvider string

type IPIntelligence

type IPIntelligence struct {
	IsBad       bool               `json:"is_bad"`
	IsVPN       bool               `json:"is_vpn"`
	IsProxy     bool               `json:"is_proxy"`
	Reputation  ipi.ReputationData `json:"reputation"`
	Geolocation ipi.GeolocateData  `json:"geolocation"`
}

type Intelligence

type Intelligence struct {
	Embargo     bool               `json:"embargo"`
	IPIntel     IPIntelligence     `json:"ip_intel"`
	DomainIntel DomainIntelligence `json:"domain_intel"`
	UserIntel   bool               `json:"user_intel"`
}

type ItemOrder

type ItemOrder string
const (
	IOasc  ItemOrder = "asc"
	IOdesc           = "desc"
)

type LoginToken

type LoginToken struct {
	SessionToken
	Token string `json:"token"`
}

type MFAProvider

type MFAProvider string

type ProfileData

type ProfileData map[string]string

type Scopes

type Scopes []string

type Session

type Session struct {
	*pangea.Client
}

func (*Session) Invalidate

@summary Invalidate Session

@description Invalidate a session by session ID.

@operationId authn_post_v2_session_invalidate

@example

input := authn.SessionInvalidateRequest{
	SessionID: "pmt_zppkzrjguxyblaia6itbiesejn7jejnr",
}

resp, err := authncli.Session.Invalidate(ctx, input)

func (*Session) List

@summary List session (service token)

@description List sessions.

@operationId authn_post_v2_session_list

@example

input := authn.SessionListRequest{}
resp, err := authn.Session.List(ctx, input)

func (*Session) Logout

@summary Log out (service token)

@description Invalidate all sessions belonging to a user.

@operationId authn_post_v2_session_logout

@example

input := authn.SessionLogoutRequest{
	UserID: "pui_xpkhwpnz2cmegsws737xbsqnmnuwtvm5",
}

resp, err := authncli.Session.Logout(ctx, input)

type SessionInvalidateRequest

type SessionInvalidateRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	SessionID string `json:"session_id"`
}

type SessionInvalidateResult

type SessionInvalidateResult struct {
}

type SessionItem

type SessionItem struct {
	ID          string        `json:"id"`
	Type        string        `json:"type"`
	Life        int           `json:"life"`
	Expire      string        `json:"expire"`
	Identity    string        `json:"identity"`
	Email       string        `json:"email"`
	Scopes      Scopes        `json:"scopes"`
	Profile     ProfileData   `json:"profile"`
	CreatedAt   string        `json:"created_at"`
	ActiveToken *SessionToken `json:"active_token,omitempty"`
}

type SessionListOrderBy

type SessionListOrderBy string

type SessionListRequest

type SessionListRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	// Should use FilterSessionList object here
	Filter  pangea.Filter      `json:"filter,omitempty"`
	Last    string             `json:"last,omitempty"`
	Order   ItemOrder          `json:"order,omitempty"`
	OrderBy SessionListOrderBy `json:"order_by,omitempty"`
}

type SessionListResult

type SessionListResult struct {
	Sessions []SessionItem `json:"sessions"`
	Last     string        `json:"last"`
}

type SessionLogoutRequest

type SessionLogoutRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	UserID string `json:"user_id"`
}

type SessionLogoutResult

type SessionLogoutResult struct {
}

type SessionToken

type SessionToken struct {
	ID           string        `json:"id"`
	Type         string        `json:"type"`
	Life         int           `json:"life"`
	Expire       string        `json:"expire"`
	Email        string        `json:"email"`
	Scopes       Scopes        `json:"scopes"`
	Profile      ProfileData   `json:"profile"`
	CreatedAt    string        `json:"created_at"`
	Intelligence *Intelligence `json:"intelligence,omitempty"`
}

type User

type User struct {
	*pangea.Client
	Profile        *UserProfile
	Invites        *UserInvite
	Authenticators *UserAuthenticators
}

func (*User) Create

@summary Create User

@description Create a user. Also allows creating the user's credentials.

@operationId authn_post_v2_user_create

@example

profile := &authn.ProfileData{
	"first_name": "Joe",
	"last_name": "User",
}

input := authn.UserCreateRequest{
	Email: "joe.user@email.com",
	Profile: profile,
}

resp, err := authncli.User.Create(ctx, input)

func (*User) Delete

@summary Delete User

@description Delete a user.

@operationId authn_post_v2_user_delete

@example

input := UserDeleteRequest{
	Email: "joe.user@email.com",
}

authncli.User.Delete(ctx, input)

func (*User) Invite

@summary Invite User

@description Send an invitation to a user.

@operationId authn_post_v2_user_invite

@example

input := authn.UserInviteRequest{
	Inviter: "admin@email.com",
	Email: "joe.user@email.com",
	Callback: "https://www.myserver.com/callback",
	State: "pcb_zurr3lkcwdp5keq73htsfpcii5k4zgm7",
}

resp, err := authncli.User.Invite(ctx, input)

func (*User) List

@summary List Users

@description Look up users by scopes.

@operationId authn_post_v2_user_list

@example

input := authn.UserListRequest{}
resp, err := authncli.User.List(ctx, input)

func (*User) Update

@summary Update user's settings

@description Update user's settings.

@operationId authn_post_v2_user_update

@example

input := authn.UserUpdateRequest{
	Email: pangea.String("joe.user@email.com"),
	RequireMFA: pangea.Bool(true),
}

resp, err := authncli.User.Update(ctx, input)

type UserAuthenticators

type UserAuthenticators struct {
	*pangea.Client
}

func (*UserAuthenticators) Delete

@summary Delete user authenticator

@description Delete a user's authenticator.

@operationId authn_post_v2_user_authenticators_delete

@example

input := authn.UserAuthenticatorsDeleteRequest{
	ID: pangea.String("pui_zgp532cx6opljeavvllmbi3iwmq72f7f"),
	AuthenticatorID: "pau_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
}

resp, err := authncli.User.Authenticators.Delete(ctx, input)

func (*UserAuthenticators) List

@summary Get user authenticators

@description Get user's authenticators by identity or email.

@operationId authn_post_v2_user_authenticators_list

@example

input := authn.UserAuthenticatorsListRequest{
	ID: pangea.String("pui_xpkhwpnz2cmegsws737xbsqnmnuwtvm5"),
}

resp, err := authncli.User.Authenticators.List(ctx, input)

type UserAuthenticatorsDeleteRequest

type UserAuthenticatorsDeleteRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID              *string `json:"id,omitempty"`
	Email           *string `json:"email,omitempty"`
	AuthenticatorID string  `json:"authenticator_id"`
}

type UserAuthenticatorsDeleteResult

type UserAuthenticatorsDeleteResult struct {
}

type UserAuthenticatorsListRequest

type UserAuthenticatorsListRequest struct {
	pangea.BaseRequest

	ID    *string `json:"id,omitempty"`
	Email *string `json:"email,omitempty"`
}

type UserAuthenticatorsListResult

type UserAuthenticatorsListResult struct {
	Authenticators []Authenticator `json:"authenticators"`
}

type UserCreateRequest

type UserCreateRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Email   string      `json:"email"`
	Profile ProfileData `json:"profile"`
}

type UserCreateResult

type UserCreateResult struct {
	User
}

type UserDeleteRequest

type UserDeleteRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Email string `json:"email,omitempty"`
	ID    string `json:"id,omitempty"`
}

type UserDeleteResult

type UserDeleteResult struct {
}

type UserInvite

type UserInvite struct {
	*pangea.Client
}

func (*UserInvite) Delete

@summary Delete Invite

@description Delete a user invitation.

@operationId authn_post_v2_user_invite_delete

@example

input := authn.UserInviteDeleteRequest{
	ID: "pmc_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
}

resp, err := authncli.User.Invite.Delete(ctx, input)

func (*UserInvite) List

@summary List Invites

@description Look up active invites for the userpool.

@operationId authn_post_v2_user_invite_list

@example

input := authn.UserInviteListRequest{}
resp, err := authncli.User.Invite.List(ctx, input)

type UserInviteData

type UserInviteData struct {
	ID         string `json:"id"`
	Inviter    string `json:"inviter"`
	InviteOrg  string `json:"invite_org"`
	Email      string `json:"email"`
	Callback   string `json:"callback"`
	State      string `json:"state"`
	RequireMFA bool   `json:"require_mfa"`
	CreatedAt  string `json:"created_at"`
	Expire     string `json:"expire"`
}

type UserInviteDeleteRequest

type UserInviteDeleteRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID string `json:"id"`
}

type UserInviteDeleteResult

type UserInviteDeleteResult struct {
}

type UserInviteListOrderBy

type UserInviteListOrderBy string

type UserInviteListRequest

type UserInviteListRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	// Should use FilterUserInviteList object here
	Filter  pangea.Filter         `json:"filter,omitempty"`
	Last    string                `json:"last,omitempty"`
	Order   ItemOrder             `json:"order,omitempty"`
	OrderBy UserInviteListOrderBy `json:"order_by,omitempty"`
	Size    int                   `json:"size,omitempty"`
}

type UserInviteListResult

type UserInviteListResult struct {
	Invites []UserInviteData `json:"invites"`
	Last    string           `json:"last"`
	Count   int              `json:"count"`
}

type UserInviteRequest

type UserInviteRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Inviter  string `json:"inviter"`
	Email    string `json:"email"`
	Callback string `json:"callback"`
	State    string `json:"state"`
}

type UserInviteResult

type UserInviteResult struct {
	ID         string `json:"id"`
	Inviter    string `json:"inviter"`
	InviteOrg  string `json:"invite_org"`
	Email      string `json:"email"`
	Callback   string `json:"callback"`
	State      string `json:"state"`
	RequireMFA bool   `json:"require_mfa"`
	CreatedAt  string `json:"created_at"`
	Expire     string `json:"expire"`
}

type UserItem

type UserItem struct {
	ID                      string          `json:"id"`
	Email                   string          `json:"email"`
	Profile                 ProfileData     `json:"profile"`
	Verified                bool            `json:"verified"`
	Disabled                bool            `json:"disabled"`
	AcceptedEulaID          *string         `json:"accepted_eula_id,omitempty"`
	AcceptedPrivacyPolicyID *string         `json:"accepted_privacy_policy_id,omitempty"`
	LastLoginAt             *string         `json:"last_login_at,omitempty"`
	CreatedAt               string          `json:"created_at"`
	LoginCount              int             `json:"login_count"`
	LastLoginIP             *string         `json:"last_login_ip,omitempty"`
	LastLoginCity           *string         `json:"last_login_city,omitempty"`
	LastLoginCountry        *string         `json:"last_login_country,omitempty"`
	Authenticators          []Authenticator `json:"authenticators"`
}

type UserListOrderBy

type UserListOrderBy string

type UserListRequest

type UserListRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	// Should user FilterUserList object here
	Filter  pangea.Filter   `json:"filter,omitempty"`
	Last    string          `json:"last,omitempty"`
	Order   ItemOrder       `json:"order,omitempty"`
	OrderBy UserListOrderBy `json:"order_by,omitempty"`
	Size    int             `json:"size,omitempty"`
}

type UserListResult

type UserListResult struct {
	Users []UserItem `json:"users"`
	Last  string     `json:"last,omitempty"`
	Count int        `json:"count"`
}

type UserProfile

type UserProfile struct {
	*pangea.Client
}

func (*UserProfile) Get

@summary Get user

@description Get user's information by identity or email.

@operationId authn_post_v2_user_profile_get

@example

input := authn.UserProfileGetRequest{
	Email: pangea.String("joe.user@email.com"),
}

resp, err := authncli.User.Profile.Get(ctx, input)

func (*UserProfile) Update

@summary Update user

@description Update user's information by identity or email.

@operationId authn_post_v2_user_profile_update

@example

input := authn.UserProfileUpdateRequest{
	Email: pangea.String("joe.user@email.com"),
	Profile: authn.ProfileData{
		"country": "Argentina",
	},
}

resp, err := authncli.User.Profile.Update(ctx, input)

type UserProfileGetRequest

type UserProfileGetRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID    *string `json:"id,omitempty"`
	Email *string `json:"email,omitempty"`
}

type UserProfileGetResult

type UserProfileGetResult struct {
	UserItem
}

type UserProfileUpdateRequest

type UserProfileUpdateRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Profile ProfileData `json:"profile"`
	ID      *string     `json:"id,omitempty"`
	Email   *string     `json:"email,omitempty"`
}

type UserProfileUpdateResult

type UserProfileUpdateResult struct {
	UserItem
}

type UserUpdateRequest

type UserUpdateRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID       *string `json:"id,omitempty"`
	Email    *string `json:"email,omitempty"`
	Disabled *bool   `json:"disabled,omitempty"`
}

type UserUpdateResult

type UserUpdateResult struct {
	UserItem
}

Jump to

Keyboard shortcuts

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