Documentation
¶
Overview ¶
Package fedcm provides the Chrome DevTools Protocol commands, types, and events for the FedCm domain.
This domain allows interacting with the FedCM dialog.
Generated by the cdproto-gen command.
Index ¶
Constants ¶
const ( CommandEnable = "FedCm.enable" CommandDisable = "FedCm.disable" CommandSelectAccount = "FedCm.selectAccount" CommandClickDialogButton = "FedCm.clickDialogButton" CommandOpenURL = "FedCm.openUrl" CommandDismissDialog = "FedCm.dismissDialog" CommandResetCooldown = "FedCm.resetCooldown" )
Command names.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { AccountID string `json:"accountId"` Email string `json:"email"` Name string `json:"name"` GivenName string `json:"givenName"` PictureURL string `json:"pictureUrl"` IdpConfigURL string `json:"idpConfigUrl"` IdpLoginURL string `json:"idpLoginUrl"` LoginState LoginState `json:"loginState"` TermsOfServiceURL string `json:"termsOfServiceUrl,omitempty,omitzero"` // These two are only set if the loginState is signUp PrivacyPolicyURL string `json:"privacyPolicyUrl,omitempty,omitzero"` }
Account corresponds to IdentityRequestAccount.
See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#type-Account
type AccountURLType ¶
type AccountURLType string
AccountURLType the URLs that each account has.
See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#type-AccountUrlType
const ( AccountURLTypeTermsOfService AccountURLType = "TermsOfService" AccountURLTypePrivacyPolicy AccountURLType = "PrivacyPolicy" )
AccountURLType values.
func (AccountURLType) String ¶
func (t AccountURLType) String() string
String returns the AccountURLType as string value.
func (*AccountURLType) UnmarshalJSON ¶
func (t *AccountURLType) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies [json.Unmarshaler].
type ClickDialogButtonParams ¶
type ClickDialogButtonParams struct { DialogID string `json:"dialogId"` DialogButton DialogButton `json:"dialogButton"` }
ClickDialogButtonParams [no description].
func ClickDialogButton ¶
func ClickDialogButton(dialogID string, dialogButton DialogButton) *ClickDialogButtonParams
ClickDialogButton [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#method-clickDialogButton
parameters:
dialogID dialogButton
type DialogButton ¶
type DialogButton string
DialogButton the buttons on the FedCM dialog.
See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#type-DialogButton
const ( DialogButtonConfirmIdpLoginContinue DialogButton = "ConfirmIdpLoginContinue" DialogButtonErrorGotIt DialogButton = "ErrorGotIt" DialogButtonErrorMoreDetails DialogButton = "ErrorMoreDetails" )
DialogButton values.
func (DialogButton) String ¶
func (t DialogButton) String() string
String returns the DialogButton as string value.
func (*DialogButton) UnmarshalJSON ¶
func (t *DialogButton) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies [json.Unmarshaler].
type DialogType ¶
type DialogType string
DialogType the types of FedCM dialogs.
See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#type-DialogType
const ( DialogTypeAccountChooser DialogType = "AccountChooser" DialogTypeAutoReauthn DialogType = "AutoReauthn" DialogTypeConfirmIdpLogin DialogType = "ConfirmIdpLogin" DialogTypeError DialogType = "Error" )
DialogType values.
func (DialogType) String ¶
func (t DialogType) String() string
String returns the DialogType as string value.
func (*DialogType) UnmarshalJSON ¶
func (t *DialogType) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies [json.Unmarshaler].
type DisableParams ¶
type DisableParams struct{}
DisableParams [no description].
func Disable ¶
func Disable() *DisableParams
Disable [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#method-disable
type DismissDialogParams ¶
type DismissDialogParams struct { DialogID string `json:"dialogId"` TriggerCooldown bool `json:"triggerCooldown,omitempty,omitzero"` }
DismissDialogParams [no description].
func DismissDialog ¶
func DismissDialog(dialogID string) *DismissDialogParams
DismissDialog [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#method-dismissDialog
parameters:
dialogID
func (*DismissDialogParams) Do ¶
func (p *DismissDialogParams) Do(ctx context.Context) (err error)
Do executes FedCm.dismissDialog against the provided context.
func (DismissDialogParams) WithTriggerCooldown ¶
func (p DismissDialogParams) WithTriggerCooldown(triggerCooldown bool) *DismissDialogParams
WithTriggerCooldown [no description].
type EnableParams ¶
type EnableParams struct {
DisableRejectionDelay bool `json:"disableRejectionDelay,omitempty,omitzero"` // Allows callers to disable the promise rejection delay that would normally happen, if this is unimportant to what's being tested. (step 4 of https://fedidcg.github.io/FedCM/#browser-api-rp-sign-in)
}
EnableParams [no description].
func Enable ¶
func Enable() *EnableParams
Enable [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#method-enable
parameters:
func (*EnableParams) Do ¶
func (p *EnableParams) Do(ctx context.Context) (err error)
Do executes FedCm.enable against the provided context.
func (EnableParams) WithDisableRejectionDelay ¶
func (p EnableParams) WithDisableRejectionDelay(disableRejectionDelay bool) *EnableParams
WithDisableRejectionDelay allows callers to disable the promise rejection delay that would normally happen, if this is unimportant to what's being tested. (step 4 of https://fedidcg.github.io/FedCM/#browser-api-rp-sign-in).
type EventDialogClosed ¶
type EventDialogClosed struct {
DialogID string `json:"dialogId"`
}
EventDialogClosed triggered when a dialog is closed, either by user action, JS abort, or a command below.
See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#event-dialogClosed
type EventDialogShown ¶
type EventDialogShown struct { DialogID string `json:"dialogId"` DialogType DialogType `json:"dialogType"` Accounts []*Account `json:"accounts"` Title string `json:"title"` // These exist primarily so that the caller can verify the RP context was used appropriately. Subtitle string `json:"subtitle,omitempty,omitzero"` }
EventDialogShown [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#event-dialogShown
type LoginState ¶
type LoginState string
LoginState whether this is a sign-up or sign-in action for this account, i.e. whether this account has ever been used to sign in to this RP before.
See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#type-LoginState
const ( LoginStateSignIn LoginState = "SignIn" LoginStateSignUp LoginState = "SignUp" )
LoginState values.
func (LoginState) String ¶
func (t LoginState) String() string
String returns the LoginState as string value.
func (*LoginState) UnmarshalJSON ¶
func (t *LoginState) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies [json.Unmarshaler].
type OpenURLParams ¶
type OpenURLParams struct { DialogID string `json:"dialogId"` AccountIndex int64 `json:"accountIndex"` AccountURLType AccountURLType `json:"accountUrlType"` }
OpenURLParams [no description].
func OpenURL ¶
func OpenURL(dialogID string, accountIndex int64, accountURLType AccountURLType) *OpenURLParams
OpenURL [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#method-openUrl
parameters:
dialogID accountIndex accountURLType
type ResetCooldownParams ¶
type ResetCooldownParams struct{}
ResetCooldownParams resets the cooldown time, if any, to allow the next FedCM call to show a dialog even if one was recently dismissed by the user.
func ResetCooldown ¶
func ResetCooldown() *ResetCooldownParams
ResetCooldown resets the cooldown time, if any, to allow the next FedCM call to show a dialog even if one was recently dismissed by the user.
See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#method-resetCooldown
type SelectAccountParams ¶
type SelectAccountParams struct { DialogID string `json:"dialogId"` AccountIndex int64 `json:"accountIndex"` }
SelectAccountParams [no description].
func SelectAccount ¶
func SelectAccount(dialogID string, accountIndex int64) *SelectAccountParams
SelectAccount [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#method-selectAccount
parameters:
dialogID accountIndex