feat: add transient payloads to all flows (#3738)

This commit is contained in:
Jonas Hungershausen 2024-02-21 10:04:53 +01:00 committed by GitHub
parent b291c959c1
commit b8b747b2ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
107 changed files with 2118 additions and 201 deletions

View File

@ -18,10 +18,11 @@ type (
model *LoginCodeValidModel
}
LoginCodeValidModel struct {
To string `json:"to"`
LoginCode string `json:"login_code"`
Identity map[string]interface{} `json:"identity"`
RequestURL string `json:"request_url"`
To string `json:"to"`
LoginCode string `json:"login_code"`
Identity map[string]interface{} `json:"identity"`
RequestURL string `json:"request_url"`
TransientPayload map[string]interface{} `json:"transient_payload"`
}
)

View File

@ -18,8 +18,9 @@ type (
model *RecoveryCodeInvalidModel
}
RecoveryCodeInvalidModel struct {
To string `json:"to"`
RequestURL string `json:"request_url"`
To string `json:"to"`
RequestURL string `json:"request_url"`
TransientPayload map[string]interface{} `json:"transient_payload"`
}
)

View File

@ -18,10 +18,11 @@ type (
model *RecoveryCodeValidModel
}
RecoveryCodeValidModel struct {
To string `json:"to"`
RecoveryCode string `json:"recovery_code"`
Identity map[string]interface{} `json:"identity"`
RequestURL string `json:"request_url"`
To string `json:"to"`
RecoveryCode string `json:"recovery_code"`
Identity map[string]interface{} `json:"identity"`
RequestURL string `json:"request_url"`
TransientPayload map[string]interface{} `json:"transient_payload"`
}
)

View File

@ -18,8 +18,9 @@ type (
m *RecoveryInvalidModel
}
RecoveryInvalidModel struct {
To string `json:"to"`
RequestURL string `json:"request_url"`
To string `json:"to"`
RequestURL string `json:"request_url"`
TransientPayload map[string]interface{} `json:"transient_payload"`
}
)

View File

@ -18,10 +18,11 @@ type (
m *RecoveryValidModel
}
RecoveryValidModel struct {
To string `json:"to"`
RecoveryURL string `json:"recovery_url"`
Identity map[string]interface{} `json:"identity"`
RequestURL string `json:"request_url"`
To string `json:"to"`
RecoveryURL string `json:"recovery_url"`
Identity map[string]interface{} `json:"identity"`
RequestURL string `json:"request_url"`
TransientPayload map[string]interface{} `json:"transient_payload"`
}
)

View File

@ -22,6 +22,7 @@ type (
Traits map[string]interface{} `json:"traits"`
RegistrationCode string `json:"registration_code"`
RequestURL string `json:"request_url"`
TransientPayload map[string]interface{} `json:"transient_payload"`
}
)

View File

@ -18,8 +18,9 @@ type (
m *VerificationCodeInvalidModel
}
VerificationCodeInvalidModel struct {
To string `json:"to"`
RequestURL string `json:"request_url"`
To string `json:"to"`
RequestURL string `json:"request_url"`
TransientPayload map[string]interface{} `json:"transient_payload"`
}
)

View File

@ -23,6 +23,7 @@ type (
VerificationCode string `json:"verification_code"`
Identity map[string]interface{} `json:"identity"`
RequestURL string `json:"request_url"`
TransientPayload map[string]interface{} `json:"transient_payload"`
}
)

View File

@ -18,8 +18,9 @@ type (
m *VerificationInvalidModel
}
VerificationInvalidModel struct {
To string `json:"to"`
RequestURL string `json:"request_url"`
To string `json:"to"`
RequestURL string `json:"request_url"`
TransientPayload map[string]interface{} `json:"transient_payload"`
}
)

View File

@ -18,10 +18,11 @@ type (
m *VerificationValidModel
}
VerificationValidModel struct {
To string `json:"to"`
VerificationURL string `json:"verification_url"`
Identity map[string]interface{} `json:"identity"`
RequestURL string `json:"request_url"`
To string `json:"to"`
VerificationURL string `json:"verification_url"`
Identity map[string]interface{} `json:"identity"`
RequestURL string `json:"request_url"`
TransientPayload map[string]interface{} `json:"transient_payload"`
}
)

View File

@ -17,10 +17,11 @@ type (
model *LoginCodeValidModel
}
LoginCodeValidModel struct {
To string `json:"to"`
LoginCode string `json:"login_code"`
Identity map[string]interface{} `json:"identity"`
RequestURL string `json:"request_url"`
To string `json:"to"`
LoginCode string `json:"login_code"`
Identity map[string]interface{} `json:"identity"`
RequestURL string `json:"request_url"`
TransientPayload map[string]interface{} `json:"transient_payload"`
}
)

View File

@ -22,6 +22,7 @@ type (
VerificationCode string `json:"verification_code"`
Identity map[string]interface{} `json:"identity"`
RequestURL string `json:"request_url"`
TransientPayload map[string]interface{} `json:"transient_payload"`
}
)

View File

@ -43,6 +43,8 @@ type LoginFlow struct {
SessionTokenExchangeCode *string `json:"session_token_exchange_code,omitempty"`
// State represents the state of this request: choose_method: ask the user to choose a method to sign in with sent_email: the email has been sent to the user passed_challenge: the request was successful and the login challenge was passed.
State interface{} `json:"state"`
// TransientPayload is used to pass data from the login to hooks and email templates
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// The flow type can either be `api` or `browser`.
Type string `json:"type"`
Ui UiContainer `json:"ui"`
@ -495,6 +497,38 @@ func (o *LoginFlow) SetState(v interface{}) {
o.State = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *LoginFlow) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LoginFlow) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *LoginFlow) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *LoginFlow) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetType returns the Type field value
func (o *LoginFlow) GetType() string {
if o == nil {
@ -619,6 +653,9 @@ func (o LoginFlow) MarshalJSON() ([]byte, error) {
if o.State != nil {
toSerialize["state"] = o.State
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if true {
toSerialize["type"] = o.Type
}

View File

@ -34,6 +34,8 @@ type RecoveryFlow struct {
ReturnTo *string `json:"return_to,omitempty"`
// State represents the state of this request: choose_method: ask the user to choose a method (e.g. recover account via email) sent_email: the email has been sent to the user passed_challenge: the request was successful and the recovery challenge was passed.
State interface{} `json:"state"`
// TransientPayload is used to pass data from the recovery flow to hooks and email templates
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// The flow type can either be `api` or `browser`.
Type string `json:"type"`
Ui UiContainer `json:"ui"`
@ -281,6 +283,38 @@ func (o *RecoveryFlow) SetState(v interface{}) {
o.State = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *RecoveryFlow) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RecoveryFlow) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *RecoveryFlow) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *RecoveryFlow) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetType returns the Type field value
func (o *RecoveryFlow) GetType() string {
if o == nil {
@ -355,6 +389,9 @@ func (o RecoveryFlow) MarshalJSON() ([]byte, error) {
if o.State != nil {
toSerialize["state"] = o.State
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if true {
toSerialize["type"] = o.Type
}

View File

@ -35,6 +35,8 @@ type SettingsFlow struct {
ReturnTo *string `json:"return_to,omitempty"`
// State represents the state of this flow. It knows two states: show_form: No user data has been collected, or it is invalid, and thus the form should be shown. success: Indicates that the settings flow has been updated successfully with the provided data. Done will stay true when repeatedly checking. If set to true, done will revert back to false only when a flow with invalid (e.g. \"please use a valid phone number\") data was sent.
State interface{} `json:"state"`
// TransientPayload is used to pass data from the settings flow to hooks and email templates
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// The flow type can either be `api` or `browser`.
Type string `json:"type"`
Ui UiContainer `json:"ui"`
@ -307,6 +309,38 @@ func (o *SettingsFlow) SetState(v interface{}) {
o.State = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *SettingsFlow) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SettingsFlow) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *SettingsFlow) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *SettingsFlow) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetType returns the Type field value
func (o *SettingsFlow) GetType() string {
if o == nil {
@ -384,6 +418,9 @@ func (o SettingsFlow) MarshalJSON() ([]byte, error) {
if o.State != nil {
toSerialize["state"] = o.State
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if true {
toSerialize["type"] = o.Type
}

View File

@ -27,6 +27,8 @@ type UpdateLoginFlowWithCodeMethod struct {
Method string `json:"method"`
// Resend is set when the user wants to resend the code
Resend *string `json:"resend,omitempty"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateLoginFlowWithCodeMethod instantiates a new UpdateLoginFlowWithCodeMethod object
@ -192,6 +194,38 @@ func (o *UpdateLoginFlowWithCodeMethod) SetResend(v string) {
o.Resend = &v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateLoginFlowWithCodeMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateLoginFlowWithCodeMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateLoginFlowWithCodeMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateLoginFlowWithCodeMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateLoginFlowWithCodeMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Code != nil {
@ -209,6 +243,9 @@ func (o UpdateLoginFlowWithCodeMethod) MarshalJSON() ([]byte, error) {
if o.Resend != nil {
toSerialize["resend"] = o.Resend
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -29,6 +29,8 @@ type UpdateLoginFlowWithOidcMethod struct {
Provider string `json:"provider"`
// The identity traits. This is a placeholder for the registration flow.
Traits map[string]interface{} `json:"traits,omitempty"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// UpstreamParameters are the parameters that are passed to the upstream identity provider. These parameters are optional and depend on what the upstream identity provider supports. Supported parameters are: `login_hint` (string): The `login_hint` parameter suppresses the account chooser and either pre-fills the email box on the sign-in form, or selects the proper session. `hd` (string): The `hd` parameter limits the login/registration process to a Google Organization, e.g. `mycollege.edu`. `prompt` (string): The `prompt` specifies whether the Authorization Server prompts the End-User for reauthentication and consent, e.g. `select_account`.
UpstreamParameters map[string]interface{} `json:"upstream_parameters,omitempty"`
}
@ -228,6 +230,38 @@ func (o *UpdateLoginFlowWithOidcMethod) SetTraits(v map[string]interface{}) {
o.Traits = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateLoginFlowWithOidcMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateLoginFlowWithOidcMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateLoginFlowWithOidcMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateLoginFlowWithOidcMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetUpstreamParameters returns the UpstreamParameters field value if set, zero value otherwise.
func (o *UpdateLoginFlowWithOidcMethod) GetUpstreamParameters() map[string]interface{} {
if o == nil || o.UpstreamParameters == nil {
@ -280,6 +314,9 @@ func (o UpdateLoginFlowWithOidcMethod) MarshalJSON() ([]byte, error) {
if o.Traits != nil {
toSerialize["traits"] = o.Traits
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if o.UpstreamParameters != nil {
toSerialize["upstream_parameters"] = o.UpstreamParameters
}

View File

@ -27,6 +27,8 @@ type UpdateLoginFlowWithPasswordMethod struct {
Password string `json:"password"`
// Identifier is the email or username of the user trying to log in. This field is deprecated!
PasswordIdentifier *string `json:"password_identifier,omitempty"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateLoginFlowWithPasswordMethod instantiates a new UpdateLoginFlowWithPasswordMethod object
@ -185,6 +187,38 @@ func (o *UpdateLoginFlowWithPasswordMethod) SetPasswordIdentifier(v string) {
o.PasswordIdentifier = &v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateLoginFlowWithPasswordMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateLoginFlowWithPasswordMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateLoginFlowWithPasswordMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateLoginFlowWithPasswordMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateLoginFlowWithPasswordMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -202,6 +236,9 @@ func (o UpdateLoginFlowWithPasswordMethod) MarshalJSON() ([]byte, error) {
if o.PasswordIdentifier != nil {
toSerialize["password_identifier"] = o.PasswordIdentifier
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -23,6 +23,8 @@ type UpdateLoginFlowWithTotpMethod struct {
Method string `json:"method"`
// The TOTP code.
TotpCode string `json:"totp_code"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateLoginFlowWithTotpMethod instantiates a new UpdateLoginFlowWithTotpMethod object
@ -124,6 +126,38 @@ func (o *UpdateLoginFlowWithTotpMethod) SetTotpCode(v string) {
o.TotpCode = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateLoginFlowWithTotpMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateLoginFlowWithTotpMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateLoginFlowWithTotpMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateLoginFlowWithTotpMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateLoginFlowWithTotpMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -135,6 +169,9 @@ func (o UpdateLoginFlowWithTotpMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["totp_code"] = o.TotpCode
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -23,6 +23,8 @@ type UpdateLoginFlowWithWebAuthnMethod struct {
Identifier string `json:"identifier"`
// Method should be set to \"webAuthn\" when logging in using the WebAuthn strategy.
Method string `json:"method"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// Login a WebAuthn Security Key This must contain the ID of the WebAuthN connection.
WebauthnLogin *string `json:"webauthn_login,omitempty"`
}
@ -126,6 +128,38 @@ func (o *UpdateLoginFlowWithWebAuthnMethod) SetMethod(v string) {
o.Method = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateLoginFlowWithWebAuthnMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateLoginFlowWithWebAuthnMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateLoginFlowWithWebAuthnMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateLoginFlowWithWebAuthnMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetWebauthnLogin returns the WebauthnLogin field value if set, zero value otherwise.
func (o *UpdateLoginFlowWithWebAuthnMethod) GetWebauthnLogin() string {
if o == nil || o.WebauthnLogin == nil {
@ -169,6 +203,9 @@ func (o UpdateLoginFlowWithWebAuthnMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["method"] = o.Method
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if o.WebauthnLogin != nil {
toSerialize["webauthn_login"] = o.WebauthnLogin
}

View File

@ -25,6 +25,8 @@ type UpdateRecoveryFlowWithCodeMethod struct {
Email *string `json:"email,omitempty"`
// Method is the method that should be used for this recovery flow Allowed values are `link` and `code`. link RecoveryStrategyLink code RecoveryStrategyCode
Method string `json:"method"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateRecoveryFlowWithCodeMethod instantiates a new UpdateRecoveryFlowWithCodeMethod object
@ -165,6 +167,38 @@ func (o *UpdateRecoveryFlowWithCodeMethod) SetMethod(v string) {
o.Method = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateRecoveryFlowWithCodeMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateRecoveryFlowWithCodeMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateRecoveryFlowWithCodeMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateRecoveryFlowWithCodeMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateRecoveryFlowWithCodeMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Code != nil {
@ -179,6 +213,9 @@ func (o UpdateRecoveryFlowWithCodeMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["method"] = o.Method
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -23,6 +23,8 @@ type UpdateRecoveryFlowWithLinkMethod struct {
Email string `json:"email"`
// Method is the method that should be used for this recovery flow Allowed values are `link` and `code` link RecoveryStrategyLink code RecoveryStrategyCode
Method string `json:"method"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateRecoveryFlowWithLinkMethod instantiates a new UpdateRecoveryFlowWithLinkMethod object
@ -124,6 +126,38 @@ func (o *UpdateRecoveryFlowWithLinkMethod) SetMethod(v string) {
o.Method = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateRecoveryFlowWithLinkMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateRecoveryFlowWithLinkMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateRecoveryFlowWithLinkMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateRecoveryFlowWithLinkMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateRecoveryFlowWithLinkMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -135,6 +169,9 @@ func (o UpdateRecoveryFlowWithLinkMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["method"] = o.Method
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -29,6 +29,8 @@ type UpdateSettingsFlowWithLookupMethod struct {
LookupSecretReveal *bool `json:"lookup_secret_reveal,omitempty"`
// Method Should be set to \"lookup\" when trying to add, update, or remove a lookup pairing.
Method string `json:"method"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateSettingsFlowWithLookupMethod instantiates a new UpdateSettingsFlowWithLookupMethod object
@ -233,6 +235,38 @@ func (o *UpdateSettingsFlowWithLookupMethod) SetMethod(v string) {
o.Method = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithLookupMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateSettingsFlowWithLookupMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateSettingsFlowWithLookupMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateSettingsFlowWithLookupMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateSettingsFlowWithLookupMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -253,6 +287,9 @@ func (o UpdateSettingsFlowWithLookupMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["method"] = o.Method
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -25,6 +25,8 @@ type UpdateSettingsFlowWithOidcMethod struct {
Method string `json:"method"`
// The identity's traits in: body
Traits map[string]interface{} `json:"traits,omitempty"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// Unlink this provider Either this or `link` must be set. type: string in: body
Unlink *string `json:"unlink,omitempty"`
// UpstreamParameters are the parameters that are passed to the upstream identity provider. These parameters are optional and depend on what the upstream identity provider supports. Supported parameters are: `login_hint` (string): The `login_hint` parameter suppresses the account chooser and either pre-fills the email box on the sign-in form, or selects the proper session. `hd` (string): The `hd` parameter limits the login/registration process to a Google Organization, e.g. `mycollege.edu`. `prompt` (string): The `prompt` specifies whether the Authorization Server prompts the End-User for reauthentication and consent, e.g. `select_account`.
@ -169,6 +171,38 @@ func (o *UpdateSettingsFlowWithOidcMethod) SetTraits(v map[string]interface{}) {
o.Traits = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithOidcMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateSettingsFlowWithOidcMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateSettingsFlowWithOidcMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateSettingsFlowWithOidcMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetUnlink returns the Unlink field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithOidcMethod) GetUnlink() string {
if o == nil || o.Unlink == nil {
@ -247,6 +281,9 @@ func (o UpdateSettingsFlowWithOidcMethod) MarshalJSON() ([]byte, error) {
if o.Traits != nil {
toSerialize["traits"] = o.Traits
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if o.Unlink != nil {
toSerialize["unlink"] = o.Unlink
}

View File

@ -23,6 +23,8 @@ type UpdateSettingsFlowWithPasswordMethod struct {
Method string `json:"method"`
// Password is the updated password
Password string `json:"password"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateSettingsFlowWithPasswordMethod instantiates a new UpdateSettingsFlowWithPasswordMethod object
@ -124,6 +126,38 @@ func (o *UpdateSettingsFlowWithPasswordMethod) SetPassword(v string) {
o.Password = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithPasswordMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateSettingsFlowWithPasswordMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateSettingsFlowWithPasswordMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateSettingsFlowWithPasswordMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateSettingsFlowWithPasswordMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -135,6 +169,9 @@ func (o UpdateSettingsFlowWithPasswordMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["password"] = o.Password
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -23,6 +23,8 @@ type UpdateSettingsFlowWithProfileMethod struct {
Method string `json:"method"`
// Traits The identity's traits.
Traits map[string]interface{} `json:"traits"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateSettingsFlowWithProfileMethod instantiates a new UpdateSettingsFlowWithProfileMethod object
@ -124,6 +126,38 @@ func (o *UpdateSettingsFlowWithProfileMethod) SetTraits(v map[string]interface{}
o.Traits = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithProfileMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateSettingsFlowWithProfileMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateSettingsFlowWithProfileMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateSettingsFlowWithProfileMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateSettingsFlowWithProfileMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -135,6 +169,9 @@ func (o UpdateSettingsFlowWithProfileMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["traits"] = o.Traits
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -25,6 +25,8 @@ type UpdateSettingsFlowWithTotpMethod struct {
TotpCode *string `json:"totp_code,omitempty"`
// UnlinkTOTP if true will remove the TOTP pairing, effectively removing the credential. This can be used to set up a new TOTP device.
TotpUnlink *bool `json:"totp_unlink,omitempty"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateSettingsFlowWithTotpMethod instantiates a new UpdateSettingsFlowWithTotpMethod object
@ -165,6 +167,38 @@ func (o *UpdateSettingsFlowWithTotpMethod) SetTotpUnlink(v bool) {
o.TotpUnlink = &v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithTotpMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateSettingsFlowWithTotpMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateSettingsFlowWithTotpMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateSettingsFlowWithTotpMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateSettingsFlowWithTotpMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -179,6 +213,9 @@ func (o UpdateSettingsFlowWithTotpMethod) MarshalJSON() ([]byte, error) {
if o.TotpUnlink != nil {
toSerialize["totp_unlink"] = o.TotpUnlink
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -21,6 +21,8 @@ type UpdateSettingsFlowWithWebAuthnMethod struct {
CsrfToken *string `json:"csrf_token,omitempty"`
// Method Should be set to \"webauthn\" when trying to add, update, or remove a webAuthn pairing.
Method string `json:"method"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// Register a WebAuthn Security Key It is expected that the JSON returned by the WebAuthn registration process is included here.
WebauthnRegister *string `json:"webauthn_register,omitempty"`
// Name of the WebAuthn Security Key to be Added A human-readable name for the security key which will be added.
@ -103,6 +105,38 @@ func (o *UpdateSettingsFlowWithWebAuthnMethod) SetMethod(v string) {
o.Method = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithWebAuthnMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateSettingsFlowWithWebAuthnMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateSettingsFlowWithWebAuthnMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateSettingsFlowWithWebAuthnMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetWebauthnRegister returns the WebauthnRegister field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithWebAuthnMethod) GetWebauthnRegister() string {
if o == nil || o.WebauthnRegister == nil {
@ -207,6 +241,9 @@ func (o UpdateSettingsFlowWithWebAuthnMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["method"] = o.Method
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if o.WebauthnRegister != nil {
toSerialize["webauthn_register"] = o.WebauthnRegister
}

View File

@ -25,6 +25,8 @@ type UpdateVerificationFlowWithCodeMethod struct {
Email *string `json:"email,omitempty"`
// Method is the method that should be used for this verification flow Allowed values are `link` and `code`. link VerificationStrategyLink code VerificationStrategyCode
Method string `json:"method"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateVerificationFlowWithCodeMethod instantiates a new UpdateVerificationFlowWithCodeMethod object
@ -165,6 +167,38 @@ func (o *UpdateVerificationFlowWithCodeMethod) SetMethod(v string) {
o.Method = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateVerificationFlowWithCodeMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateVerificationFlowWithCodeMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateVerificationFlowWithCodeMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateVerificationFlowWithCodeMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateVerificationFlowWithCodeMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Code != nil {
@ -179,6 +213,9 @@ func (o UpdateVerificationFlowWithCodeMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["method"] = o.Method
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -23,6 +23,8 @@ type UpdateVerificationFlowWithLinkMethod struct {
Email string `json:"email"`
// Method is the method that should be used for this verification flow Allowed values are `link` and `code` link VerificationStrategyLink code VerificationStrategyCode
Method string `json:"method"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateVerificationFlowWithLinkMethod instantiates a new UpdateVerificationFlowWithLinkMethod object
@ -124,6 +126,38 @@ func (o *UpdateVerificationFlowWithLinkMethod) SetMethod(v string) {
o.Method = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateVerificationFlowWithLinkMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateVerificationFlowWithLinkMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateVerificationFlowWithLinkMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateVerificationFlowWithLinkMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateVerificationFlowWithLinkMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -135,6 +169,9 @@ func (o UpdateVerificationFlowWithLinkMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["method"] = o.Method
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -32,6 +32,8 @@ type VerificationFlow struct {
ReturnTo *string `json:"return_to,omitempty"`
// State represents the state of this request: choose_method: ask the user to choose a method (e.g. verify your email) sent_email: the email has been sent to the user passed_challenge: the request was successful and the verification challenge was passed.
State interface{} `json:"state"`
// TransientPayload is used to pass data from the verification flow to hooks and email templates
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// The flow type can either be `api` or `browser`.
Type string `json:"type"`
Ui UiContainer `json:"ui"`
@ -268,6 +270,38 @@ func (o *VerificationFlow) SetState(v interface{}) {
o.State = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *VerificationFlow) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VerificationFlow) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *VerificationFlow) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *VerificationFlow) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetType returns the Type field value
func (o *VerificationFlow) GetType() string {
if o == nil {
@ -339,6 +373,9 @@ func (o VerificationFlow) MarshalJSON() ([]byte, error) {
if o.State != nil {
toSerialize["state"] = o.State
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if true {
toSerialize["type"] = o.Type
}

View File

@ -43,6 +43,8 @@ type LoginFlow struct {
SessionTokenExchangeCode *string `json:"session_token_exchange_code,omitempty"`
// State represents the state of this request: choose_method: ask the user to choose a method to sign in with sent_email: the email has been sent to the user passed_challenge: the request was successful and the login challenge was passed.
State interface{} `json:"state"`
// TransientPayload is used to pass data from the login to hooks and email templates
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// The flow type can either be `api` or `browser`.
Type string `json:"type"`
Ui UiContainer `json:"ui"`
@ -495,6 +497,38 @@ func (o *LoginFlow) SetState(v interface{}) {
o.State = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *LoginFlow) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LoginFlow) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *LoginFlow) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *LoginFlow) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetType returns the Type field value
func (o *LoginFlow) GetType() string {
if o == nil {
@ -619,6 +653,9 @@ func (o LoginFlow) MarshalJSON() ([]byte, error) {
if o.State != nil {
toSerialize["state"] = o.State
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if true {
toSerialize["type"] = o.Type
}

View File

@ -34,6 +34,8 @@ type RecoveryFlow struct {
ReturnTo *string `json:"return_to,omitempty"`
// State represents the state of this request: choose_method: ask the user to choose a method (e.g. recover account via email) sent_email: the email has been sent to the user passed_challenge: the request was successful and the recovery challenge was passed.
State interface{} `json:"state"`
// TransientPayload is used to pass data from the recovery flow to hooks and email templates
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// The flow type can either be `api` or `browser`.
Type string `json:"type"`
Ui UiContainer `json:"ui"`
@ -281,6 +283,38 @@ func (o *RecoveryFlow) SetState(v interface{}) {
o.State = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *RecoveryFlow) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RecoveryFlow) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *RecoveryFlow) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *RecoveryFlow) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetType returns the Type field value
func (o *RecoveryFlow) GetType() string {
if o == nil {
@ -355,6 +389,9 @@ func (o RecoveryFlow) MarshalJSON() ([]byte, error) {
if o.State != nil {
toSerialize["state"] = o.State
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if true {
toSerialize["type"] = o.Type
}

View File

@ -35,6 +35,8 @@ type SettingsFlow struct {
ReturnTo *string `json:"return_to,omitempty"`
// State represents the state of this flow. It knows two states: show_form: No user data has been collected, or it is invalid, and thus the form should be shown. success: Indicates that the settings flow has been updated successfully with the provided data. Done will stay true when repeatedly checking. If set to true, done will revert back to false only when a flow with invalid (e.g. \"please use a valid phone number\") data was sent.
State interface{} `json:"state"`
// TransientPayload is used to pass data from the settings flow to hooks and email templates
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// The flow type can either be `api` or `browser`.
Type string `json:"type"`
Ui UiContainer `json:"ui"`
@ -307,6 +309,38 @@ func (o *SettingsFlow) SetState(v interface{}) {
o.State = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *SettingsFlow) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SettingsFlow) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *SettingsFlow) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *SettingsFlow) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetType returns the Type field value
func (o *SettingsFlow) GetType() string {
if o == nil {
@ -384,6 +418,9 @@ func (o SettingsFlow) MarshalJSON() ([]byte, error) {
if o.State != nil {
toSerialize["state"] = o.State
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if true {
toSerialize["type"] = o.Type
}

View File

@ -27,6 +27,8 @@ type UpdateLoginFlowWithCodeMethod struct {
Method string `json:"method"`
// Resend is set when the user wants to resend the code
Resend *string `json:"resend,omitempty"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateLoginFlowWithCodeMethod instantiates a new UpdateLoginFlowWithCodeMethod object
@ -192,6 +194,38 @@ func (o *UpdateLoginFlowWithCodeMethod) SetResend(v string) {
o.Resend = &v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateLoginFlowWithCodeMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateLoginFlowWithCodeMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateLoginFlowWithCodeMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateLoginFlowWithCodeMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateLoginFlowWithCodeMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Code != nil {
@ -209,6 +243,9 @@ func (o UpdateLoginFlowWithCodeMethod) MarshalJSON() ([]byte, error) {
if o.Resend != nil {
toSerialize["resend"] = o.Resend
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -29,6 +29,8 @@ type UpdateLoginFlowWithOidcMethod struct {
Provider string `json:"provider"`
// The identity traits. This is a placeholder for the registration flow.
Traits map[string]interface{} `json:"traits,omitempty"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// UpstreamParameters are the parameters that are passed to the upstream identity provider. These parameters are optional and depend on what the upstream identity provider supports. Supported parameters are: `login_hint` (string): The `login_hint` parameter suppresses the account chooser and either pre-fills the email box on the sign-in form, or selects the proper session. `hd` (string): The `hd` parameter limits the login/registration process to a Google Organization, e.g. `mycollege.edu`. `prompt` (string): The `prompt` specifies whether the Authorization Server prompts the End-User for reauthentication and consent, e.g. `select_account`.
UpstreamParameters map[string]interface{} `json:"upstream_parameters,omitempty"`
}
@ -228,6 +230,38 @@ func (o *UpdateLoginFlowWithOidcMethod) SetTraits(v map[string]interface{}) {
o.Traits = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateLoginFlowWithOidcMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateLoginFlowWithOidcMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateLoginFlowWithOidcMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateLoginFlowWithOidcMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetUpstreamParameters returns the UpstreamParameters field value if set, zero value otherwise.
func (o *UpdateLoginFlowWithOidcMethod) GetUpstreamParameters() map[string]interface{} {
if o == nil || o.UpstreamParameters == nil {
@ -280,6 +314,9 @@ func (o UpdateLoginFlowWithOidcMethod) MarshalJSON() ([]byte, error) {
if o.Traits != nil {
toSerialize["traits"] = o.Traits
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if o.UpstreamParameters != nil {
toSerialize["upstream_parameters"] = o.UpstreamParameters
}

View File

@ -27,6 +27,8 @@ type UpdateLoginFlowWithPasswordMethod struct {
Password string `json:"password"`
// Identifier is the email or username of the user trying to log in. This field is deprecated!
PasswordIdentifier *string `json:"password_identifier,omitempty"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateLoginFlowWithPasswordMethod instantiates a new UpdateLoginFlowWithPasswordMethod object
@ -185,6 +187,38 @@ func (o *UpdateLoginFlowWithPasswordMethod) SetPasswordIdentifier(v string) {
o.PasswordIdentifier = &v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateLoginFlowWithPasswordMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateLoginFlowWithPasswordMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateLoginFlowWithPasswordMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateLoginFlowWithPasswordMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateLoginFlowWithPasswordMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -202,6 +236,9 @@ func (o UpdateLoginFlowWithPasswordMethod) MarshalJSON() ([]byte, error) {
if o.PasswordIdentifier != nil {
toSerialize["password_identifier"] = o.PasswordIdentifier
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -23,6 +23,8 @@ type UpdateLoginFlowWithTotpMethod struct {
Method string `json:"method"`
// The TOTP code.
TotpCode string `json:"totp_code"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateLoginFlowWithTotpMethod instantiates a new UpdateLoginFlowWithTotpMethod object
@ -124,6 +126,38 @@ func (o *UpdateLoginFlowWithTotpMethod) SetTotpCode(v string) {
o.TotpCode = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateLoginFlowWithTotpMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateLoginFlowWithTotpMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateLoginFlowWithTotpMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateLoginFlowWithTotpMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateLoginFlowWithTotpMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -135,6 +169,9 @@ func (o UpdateLoginFlowWithTotpMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["totp_code"] = o.TotpCode
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -23,6 +23,8 @@ type UpdateLoginFlowWithWebAuthnMethod struct {
Identifier string `json:"identifier"`
// Method should be set to \"webAuthn\" when logging in using the WebAuthn strategy.
Method string `json:"method"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// Login a WebAuthn Security Key This must contain the ID of the WebAuthN connection.
WebauthnLogin *string `json:"webauthn_login,omitempty"`
}
@ -126,6 +128,38 @@ func (o *UpdateLoginFlowWithWebAuthnMethod) SetMethod(v string) {
o.Method = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateLoginFlowWithWebAuthnMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateLoginFlowWithWebAuthnMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateLoginFlowWithWebAuthnMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateLoginFlowWithWebAuthnMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetWebauthnLogin returns the WebauthnLogin field value if set, zero value otherwise.
func (o *UpdateLoginFlowWithWebAuthnMethod) GetWebauthnLogin() string {
if o == nil || o.WebauthnLogin == nil {
@ -169,6 +203,9 @@ func (o UpdateLoginFlowWithWebAuthnMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["method"] = o.Method
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if o.WebauthnLogin != nil {
toSerialize["webauthn_login"] = o.WebauthnLogin
}

View File

@ -25,6 +25,8 @@ type UpdateRecoveryFlowWithCodeMethod struct {
Email *string `json:"email,omitempty"`
// Method is the method that should be used for this recovery flow Allowed values are `link` and `code`. link RecoveryStrategyLink code RecoveryStrategyCode
Method string `json:"method"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateRecoveryFlowWithCodeMethod instantiates a new UpdateRecoveryFlowWithCodeMethod object
@ -165,6 +167,38 @@ func (o *UpdateRecoveryFlowWithCodeMethod) SetMethod(v string) {
o.Method = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateRecoveryFlowWithCodeMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateRecoveryFlowWithCodeMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateRecoveryFlowWithCodeMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateRecoveryFlowWithCodeMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateRecoveryFlowWithCodeMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Code != nil {
@ -179,6 +213,9 @@ func (o UpdateRecoveryFlowWithCodeMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["method"] = o.Method
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -23,6 +23,8 @@ type UpdateRecoveryFlowWithLinkMethod struct {
Email string `json:"email"`
// Method is the method that should be used for this recovery flow Allowed values are `link` and `code` link RecoveryStrategyLink code RecoveryStrategyCode
Method string `json:"method"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateRecoveryFlowWithLinkMethod instantiates a new UpdateRecoveryFlowWithLinkMethod object
@ -124,6 +126,38 @@ func (o *UpdateRecoveryFlowWithLinkMethod) SetMethod(v string) {
o.Method = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateRecoveryFlowWithLinkMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateRecoveryFlowWithLinkMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateRecoveryFlowWithLinkMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateRecoveryFlowWithLinkMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateRecoveryFlowWithLinkMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -135,6 +169,9 @@ func (o UpdateRecoveryFlowWithLinkMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["method"] = o.Method
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -29,6 +29,8 @@ type UpdateSettingsFlowWithLookupMethod struct {
LookupSecretReveal *bool `json:"lookup_secret_reveal,omitempty"`
// Method Should be set to \"lookup\" when trying to add, update, or remove a lookup pairing.
Method string `json:"method"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateSettingsFlowWithLookupMethod instantiates a new UpdateSettingsFlowWithLookupMethod object
@ -233,6 +235,38 @@ func (o *UpdateSettingsFlowWithLookupMethod) SetMethod(v string) {
o.Method = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithLookupMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateSettingsFlowWithLookupMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateSettingsFlowWithLookupMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateSettingsFlowWithLookupMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateSettingsFlowWithLookupMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -253,6 +287,9 @@ func (o UpdateSettingsFlowWithLookupMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["method"] = o.Method
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -25,6 +25,8 @@ type UpdateSettingsFlowWithOidcMethod struct {
Method string `json:"method"`
// The identity's traits in: body
Traits map[string]interface{} `json:"traits,omitempty"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// Unlink this provider Either this or `link` must be set. type: string in: body
Unlink *string `json:"unlink,omitempty"`
// UpstreamParameters are the parameters that are passed to the upstream identity provider. These parameters are optional and depend on what the upstream identity provider supports. Supported parameters are: `login_hint` (string): The `login_hint` parameter suppresses the account chooser and either pre-fills the email box on the sign-in form, or selects the proper session. `hd` (string): The `hd` parameter limits the login/registration process to a Google Organization, e.g. `mycollege.edu`. `prompt` (string): The `prompt` specifies whether the Authorization Server prompts the End-User for reauthentication and consent, e.g. `select_account`.
@ -169,6 +171,38 @@ func (o *UpdateSettingsFlowWithOidcMethod) SetTraits(v map[string]interface{}) {
o.Traits = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithOidcMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateSettingsFlowWithOidcMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateSettingsFlowWithOidcMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateSettingsFlowWithOidcMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetUnlink returns the Unlink field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithOidcMethod) GetUnlink() string {
if o == nil || o.Unlink == nil {
@ -247,6 +281,9 @@ func (o UpdateSettingsFlowWithOidcMethod) MarshalJSON() ([]byte, error) {
if o.Traits != nil {
toSerialize["traits"] = o.Traits
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if o.Unlink != nil {
toSerialize["unlink"] = o.Unlink
}

View File

@ -23,6 +23,8 @@ type UpdateSettingsFlowWithPasswordMethod struct {
Method string `json:"method"`
// Password is the updated password
Password string `json:"password"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateSettingsFlowWithPasswordMethod instantiates a new UpdateSettingsFlowWithPasswordMethod object
@ -124,6 +126,38 @@ func (o *UpdateSettingsFlowWithPasswordMethod) SetPassword(v string) {
o.Password = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithPasswordMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateSettingsFlowWithPasswordMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateSettingsFlowWithPasswordMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateSettingsFlowWithPasswordMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateSettingsFlowWithPasswordMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -135,6 +169,9 @@ func (o UpdateSettingsFlowWithPasswordMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["password"] = o.Password
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -23,6 +23,8 @@ type UpdateSettingsFlowWithProfileMethod struct {
Method string `json:"method"`
// Traits The identity's traits.
Traits map[string]interface{} `json:"traits"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateSettingsFlowWithProfileMethod instantiates a new UpdateSettingsFlowWithProfileMethod object
@ -124,6 +126,38 @@ func (o *UpdateSettingsFlowWithProfileMethod) SetTraits(v map[string]interface{}
o.Traits = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithProfileMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateSettingsFlowWithProfileMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateSettingsFlowWithProfileMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateSettingsFlowWithProfileMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateSettingsFlowWithProfileMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -135,6 +169,9 @@ func (o UpdateSettingsFlowWithProfileMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["traits"] = o.Traits
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -25,6 +25,8 @@ type UpdateSettingsFlowWithTotpMethod struct {
TotpCode *string `json:"totp_code,omitempty"`
// UnlinkTOTP if true will remove the TOTP pairing, effectively removing the credential. This can be used to set up a new TOTP device.
TotpUnlink *bool `json:"totp_unlink,omitempty"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateSettingsFlowWithTotpMethod instantiates a new UpdateSettingsFlowWithTotpMethod object
@ -165,6 +167,38 @@ func (o *UpdateSettingsFlowWithTotpMethod) SetTotpUnlink(v bool) {
o.TotpUnlink = &v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithTotpMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateSettingsFlowWithTotpMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateSettingsFlowWithTotpMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateSettingsFlowWithTotpMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateSettingsFlowWithTotpMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -179,6 +213,9 @@ func (o UpdateSettingsFlowWithTotpMethod) MarshalJSON() ([]byte, error) {
if o.TotpUnlink != nil {
toSerialize["totp_unlink"] = o.TotpUnlink
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -21,6 +21,8 @@ type UpdateSettingsFlowWithWebAuthnMethod struct {
CsrfToken *string `json:"csrf_token,omitempty"`
// Method Should be set to \"webauthn\" when trying to add, update, or remove a webAuthn pairing.
Method string `json:"method"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// Register a WebAuthn Security Key It is expected that the JSON returned by the WebAuthn registration process is included here.
WebauthnRegister *string `json:"webauthn_register,omitempty"`
// Name of the WebAuthn Security Key to be Added A human-readable name for the security key which will be added.
@ -103,6 +105,38 @@ func (o *UpdateSettingsFlowWithWebAuthnMethod) SetMethod(v string) {
o.Method = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithWebAuthnMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateSettingsFlowWithWebAuthnMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateSettingsFlowWithWebAuthnMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateSettingsFlowWithWebAuthnMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetWebauthnRegister returns the WebauthnRegister field value if set, zero value otherwise.
func (o *UpdateSettingsFlowWithWebAuthnMethod) GetWebauthnRegister() string {
if o == nil || o.WebauthnRegister == nil {
@ -207,6 +241,9 @@ func (o UpdateSettingsFlowWithWebAuthnMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["method"] = o.Method
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if o.WebauthnRegister != nil {
toSerialize["webauthn_register"] = o.WebauthnRegister
}

View File

@ -25,6 +25,8 @@ type UpdateVerificationFlowWithCodeMethod struct {
Email *string `json:"email,omitempty"`
// Method is the method that should be used for this verification flow Allowed values are `link` and `code`. link VerificationStrategyLink code VerificationStrategyCode
Method string `json:"method"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateVerificationFlowWithCodeMethod instantiates a new UpdateVerificationFlowWithCodeMethod object
@ -165,6 +167,38 @@ func (o *UpdateVerificationFlowWithCodeMethod) SetMethod(v string) {
o.Method = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateVerificationFlowWithCodeMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateVerificationFlowWithCodeMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateVerificationFlowWithCodeMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateVerificationFlowWithCodeMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateVerificationFlowWithCodeMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Code != nil {
@ -179,6 +213,9 @@ func (o UpdateVerificationFlowWithCodeMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["method"] = o.Method
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -23,6 +23,8 @@ type UpdateVerificationFlowWithLinkMethod struct {
Email string `json:"email"`
// Method is the method that should be used for this verification flow Allowed values are `link` and `code` link VerificationStrategyLink code VerificationStrategyCode
Method string `json:"method"`
// Transient data to pass along to any webhooks
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
}
// NewUpdateVerificationFlowWithLinkMethod instantiates a new UpdateVerificationFlowWithLinkMethod object
@ -124,6 +126,38 @@ func (o *UpdateVerificationFlowWithLinkMethod) SetMethod(v string) {
o.Method = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *UpdateVerificationFlowWithLinkMethod) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateVerificationFlowWithLinkMethod) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *UpdateVerificationFlowWithLinkMethod) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *UpdateVerificationFlowWithLinkMethod) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
func (o UpdateVerificationFlowWithLinkMethod) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
@ -135,6 +169,9 @@ func (o UpdateVerificationFlowWithLinkMethod) MarshalJSON() ([]byte, error) {
if true {
toSerialize["method"] = o.Method
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
return json.Marshal(toSerialize)
}

View File

@ -32,6 +32,8 @@ type VerificationFlow struct {
ReturnTo *string `json:"return_to,omitempty"`
// State represents the state of this request: choose_method: ask the user to choose a method (e.g. verify your email) sent_email: the email has been sent to the user passed_challenge: the request was successful and the verification challenge was passed.
State interface{} `json:"state"`
// TransientPayload is used to pass data from the verification flow to hooks and email templates
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// The flow type can either be `api` or `browser`.
Type string `json:"type"`
Ui UiContainer `json:"ui"`
@ -268,6 +270,38 @@ func (o *VerificationFlow) SetState(v interface{}) {
o.State = v
}
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *VerificationFlow) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
var ret map[string]interface{}
return ret
}
return o.TransientPayload
}
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VerificationFlow) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *VerificationFlow) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
return true
}
return false
}
// SetTransientPayload gets a reference to the given map[string]interface{} and assigns it to the TransientPayload field.
func (o *VerificationFlow) SetTransientPayload(v map[string]interface{}) {
o.TransientPayload = v
}
// GetType returns the Type field value
func (o *VerificationFlow) GetType() string {
if o == nil {
@ -339,6 +373,9 @@ func (o VerificationFlow) MarshalJSON() ([]byte, error) {
if o.State != nil {
toSerialize["state"] = o.State
}
if o.TransientPayload != nil {
toSerialize["transient_payload"] = o.TransientPayload
}
if true {
toSerialize["type"] = o.Type
}

View File

@ -97,6 +97,10 @@ func (t *testFlow) SetState(state State) {
t.State = state
}
func (t *testFlow) GetTransientPayload() json.RawMessage {
return nil
}
func newTestFlow(r *http.Request, flowType Type) Flow {
id := x.NewUUID()
requestURL := x.RequestURL(r).String()

View File

@ -5,6 +5,7 @@ package flow
import (
"context"
"encoding/json"
"net/http"
"net/url"
@ -39,6 +40,7 @@ type Flow interface {
GetState() State
SetState(State)
GetFlowName() FlowName
GetTransientPayload() json.RawMessage
}
type FlowWithRedirect interface {

View File

@ -140,6 +140,11 @@ type Flow struct {
// Only used internally
RawIDTokenNonce string `json:"-" db:"-"`
// TransientPayload is used to pass data from the login to hooks and email templates
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" faker:"-" db:"-"`
}
var _ flow.Flow = new(Flow)
@ -290,3 +295,7 @@ func (f *Flow) GetFlowName() flow.FlowName {
func (f *Flow) SetState(state flow.State) {
f.State = State(state)
}
func (t *Flow) GetTransientPayload() json.RawMessage {
return t.TransientPayload
}

View File

@ -103,6 +103,11 @@ type Flow struct {
// Contains possible actions that could follow this flow
ContinueWith []flow.ContinueWith `json:"continue_with,omitempty" faker:"-" db:"-"`
// TransientPayload is used to pass data from the recovery flow to hooks and email templates
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" faker:"-" db:"-"`
}
var _ flow.Flow = new(Flow)
@ -239,3 +244,7 @@ func (f *Flow) GetFlowName() flow.FlowName {
func (f *Flow) SetState(state State) {
f.State = state
}
func (t *Flow) GetTransientPayload() json.RawMessage {
return t.TransientPayload
}

View File

@ -458,6 +458,7 @@ func (h *Handler) updateRecoveryFlow(w http.ResponseWriter, r *http.Request, ps
h.d.RecoveryFlowErrorHandler().WriteFlowError(w, r, f, g, err)
return
}
updatedFlow.TransientPayload = f.TransientPayload
h.d.Writer().Write(w, r, updatedFlow)
}

View File

@ -98,6 +98,8 @@ type Flow struct {
OrganizationID uuid.NullUUID `json:"organization_id,omitempty" faker:"-" db:"organization_id"`
// TransientPayload is used to pass data from the registration to a webhook
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" faker:"-" db:"-"`
// Contains a list of actions, that could follow this flow
@ -269,3 +271,7 @@ func (f *Flow) GetFlowName() flow.FlowName {
func (f *Flow) SetState(state State) {
f.State = state
}
func (t *Flow) GetTransientPayload() json.RawMessage {
return t.TransientPayload
}

View File

@ -119,6 +119,11 @@ type Flow struct {
//
// required: false
ContinueWithItems []flow.ContinueWith `json:"continue_with,omitempty" db:"-" faker:"-" `
// TransientPayload is used to pass data from the settings flow to hooks and email templates
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" faker:"-" db:"-"`
}
var _ flow.Flow = new(Flow)
@ -256,3 +261,7 @@ func (f *Flow) GetFlowName() flow.FlowName {
func (f *Flow) SetState(state State) {
f.State = state
}
func (t *Flow) GetTransientPayload() json.RawMessage {
return t.TransientPayload
}

View File

@ -92,6 +92,11 @@ type Flow struct {
// UpdatedAt is a helper struct field for gobuffalo.pop.
UpdatedAt time.Time `json:"-" faker:"-" db:"updated_at"`
NID uuid.UUID `json:"-" faker:"-" db:"nid"`
// TransientPayload is used to pass data from the verification flow to hooks and email templates
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" faker:"-" db:"-"`
}
type OAuth2LoginChallengeParams struct {
@ -288,3 +293,7 @@ func (f *Flow) GetFlowName() flow.FlowName {
func (f *Flow) SetState(state State) {
f.State = state
}
func (t *Flow) GetTransientPayload() json.RawMessage {
return t.TransientPayload
}

View File

@ -48,6 +48,13 @@ import (
"github.com/ory/x/snapshotx"
)
var transientPayload = json.RawMessage(`{
"stuff": {
"name": "fubar",
"numbers": [42, 12345, 3.1415]
}
}`)
func TestWebHooks(t *testing.T) {
_, reg := internal.NewFastRegistryWithMocks(t)
logger := logrusx.New("kratos", "test")
@ -112,8 +119,8 @@ func TestWebHooks(t *testing.T) {
bodyWithFlowOnly := func(req *http.Request, f flow.Flow) string {
h, _ := json.Marshal(req.Header)
return fmt.Sprintf(`{
"flow_id": "%s",
"headers": %s,
"flow_id": "%s",
"headers": %s,
"method": "%s",
"url": "%s",
"cookies": {
@ -124,28 +131,12 @@ func TestWebHooks(t *testing.T) {
}`, f.GetID(), string(h), req.Method, "http://www.ory.sh/some_end_point")
}
bodyWithFlowAndIdentity := func(req *http.Request, f flow.Flow, s *session.Session) string {
h, _ := json.Marshal(req.Header)
return fmt.Sprintf(`{
"flow_id": "%s",
"identity_id": "%s",
"headers": %s,
"method": "%s",
"url": "%s",
"cookies": {
"Some-Cookie-1": "Some-Cookie-Value",
"Some-Cookie-2": "Some-other-Cookie-Value",
"Some-Cookie-3": "Third-Cookie-Value"
}
}`, f.GetID(), s.Identity.ID, string(h), req.Method, "http://www.ory.sh/some_end_point")
}
bodyWithFlowAndIdentityAndTransientPayload := func(req *http.Request, f flow.Flow, s *session.Session, tp json.RawMessage) string {
h, _ := json.Marshal(req.Header)
return fmt.Sprintf(`{
"flow_id": "%s",
"flow_id": "%s",
"identity_id": "%s",
"headers": %s,
"headers": %s,
"method": "%s",
"url": "%s",
"cookies": {
@ -175,12 +166,12 @@ func TestWebHooks(t *testing.T) {
},
{
uc: "Post Login Hook",
createFlow: func() flow.Flow { return &login.Flow{ID: x.NewUUID()} },
createFlow: func() flow.Flow { return &login.Flow{ID: x.NewUUID(), TransientPayload: transientPayload} },
callWebHook: func(wh *hook.WebHook, req *http.Request, f flow.Flow, s *session.Session) error {
return wh.ExecuteLoginPostHook(nil, req, node.PasswordGroup, f.(*login.Flow), s)
},
expectedBody: func(req *http.Request, f flow.Flow, s *session.Session) string {
return bodyWithFlowAndIdentity(req, f, s)
return bodyWithFlowAndIdentityAndTransientPayload(req, f, s, transientPayload)
},
},
{
@ -197,55 +188,45 @@ func TestWebHooks(t *testing.T) {
uc: "Post Registration Hook",
createFlow: func() flow.Flow {
return &registration.Flow{
ID: x.NewUUID(),
TransientPayload: json.RawMessage(`{
"stuff": {
"name": "fubar",
"numbers": [42, 12345, 3.1415]
}
}`),
ID: x.NewUUID(),
TransientPayload: transientPayload,
}
},
callWebHook: func(wh *hook.WebHook, req *http.Request, f flow.Flow, s *session.Session) error {
return wh.ExecutePostRegistrationPostPersistHook(nil, req, f.(*registration.Flow), s)
},
expectedBody: func(req *http.Request, f flow.Flow, s *session.Session) string {
return bodyWithFlowAndIdentityAndTransientPayload(req, f, s, json.RawMessage(`{
"stuff": {
"name": "fubar",
"numbers": [42, 12345, 3.1415]
}
}`))
return bodyWithFlowAndIdentityAndTransientPayload(req, f, s, transientPayload)
},
},
{
uc: "Post Recovery Hook",
createFlow: func() flow.Flow { return &recovery.Flow{ID: x.NewUUID()} },
createFlow: func() flow.Flow { return &recovery.Flow{ID: x.NewUUID(), TransientPayload: transientPayload} },
callWebHook: func(wh *hook.WebHook, req *http.Request, f flow.Flow, s *session.Session) error {
return wh.ExecutePostRecoveryHook(nil, req, f.(*recovery.Flow), s)
},
expectedBody: func(req *http.Request, f flow.Flow, s *session.Session) string {
return bodyWithFlowAndIdentity(req, f, s)
return bodyWithFlowAndIdentityAndTransientPayload(req, f, s, transientPayload)
},
},
{
uc: "Post Verification Hook",
createFlow: func() flow.Flow { return &verification.Flow{ID: x.NewUUID()} },
createFlow: func() flow.Flow { return &verification.Flow{ID: x.NewUUID(), TransientPayload: transientPayload} },
callWebHook: func(wh *hook.WebHook, req *http.Request, f flow.Flow, s *session.Session) error {
return wh.ExecutePostVerificationHook(nil, req, f.(*verification.Flow), s.Identity)
},
expectedBody: func(req *http.Request, f flow.Flow, s *session.Session) string {
return bodyWithFlowAndIdentity(req, f, s)
return bodyWithFlowAndIdentityAndTransientPayload(req, f, s, transientPayload)
},
},
{
uc: "Post Settings Hook",
createFlow: func() flow.Flow { return &settings.Flow{ID: x.NewUUID()} },
createFlow: func() flow.Flow { return &settings.Flow{ID: x.NewUUID(), TransientPayload: transientPayload} },
callWebHook: func(wh *hook.WebHook, req *http.Request, f flow.Flow, s *session.Session) error {
return wh.ExecuteSettingsPostPersistHook(nil, req, f.(*settings.Flow), s.Identity, s)
},
expectedBody: func(req *http.Request, f flow.Flow, s *session.Session) string {
return bodyWithFlowAndIdentity(req, f, s)
return bodyWithFlowAndIdentityAndTransientPayload(req, f, s, transientPayload)
},
},
} {

View File

@ -27,6 +27,10 @@
},
"csrf_token": {
"type": "string"
},
"transient_payload": {
"type": "object",
"additionalProperties": true
}
}
}

View File

@ -23,6 +23,10 @@
},
"csrf_token": {
"type": "string"
},
"transient_payload": {
"type": "object",
"additionalProperties": true
}
}
}

View File

@ -23,6 +23,10 @@
},
"csrf_token": {
"type": "string"
},
"transient_payload": {
"type": "object",
"additionalProperties": true
}
}
}

View File

@ -69,6 +69,11 @@ func (s *Sender) SendCode(ctx context.Context, f flow.Flow, id *identity.Identit
WithSensitiveField("address", addresses).
Debugf("Preparing %s code", f.GetFlowName())
transientPayload, err := x.ParseRawMessageOrEmpty(f.GetTransientPayload())
if err != nil {
return errors.WithStack(err)
}
// send to all addresses
for _, address := range addresses {
// We have to generate a unique code per address, or otherwise it is not possible to link which
@ -101,6 +106,7 @@ func (s *Sender) SendCode(ctx context.Context, f flow.Flow, id *identity.Identit
RegistrationCode: rawCode,
Traits: model,
RequestURL: f.GetRequestURL(),
TransientPayload: transientPayload,
}
s.deps.Audit().
@ -142,17 +148,19 @@ func (s *Sender) SendCode(ctx context.Context, f flow.Flow, id *identity.Identit
switch address.Via {
case identity.ChannelTypeEmail:
t = email.NewLoginCodeValid(s.deps, &email.LoginCodeValidModel{
To: address.To,
LoginCode: rawCode,
Identity: model,
RequestURL: f.GetRequestURL(),
To: address.To,
LoginCode: rawCode,
Identity: model,
RequestURL: f.GetRequestURL(),
TransientPayload: transientPayload,
})
case identity.ChannelTypeSMS:
t = sms.NewLoginCodeValid(s.deps, &sms.LoginCodeValidModel{
To: address.To,
LoginCode: rawCode,
Identity: model,
RequestURL: f.GetRequestURL(),
To: address.To,
LoginCode: rawCode,
Identity: model,
RequestURL: f.GetRequestURL(),
TransientPayload: transientPayload,
})
}
@ -188,11 +196,17 @@ func (s *Sender) SendRecoveryCode(ctx context.Context, f *recovery.Flow, via ide
WithField("strategy", "code").
WithField("was_notified", notifyUnknownRecipients).
Info("Account recovery was requested for an unknown address.")
transientPayload, err := x.ParseRawMessageOrEmpty(f.GetTransientPayload())
if err != nil {
return errors.WithStack(err)
}
if !notifyUnknownRecipients {
// do nothing
} else if err := s.send(ctx, string(via), email.NewRecoveryCodeInvalid(s.deps, &email.RecoveryCodeInvalidModel{
To: to,
RequestURL: f.RequestURL,
To: to,
RequestURL: f.RequestURL,
TransientPayload: transientPayload,
})); err != nil {
return err
}
@ -227,7 +241,7 @@ func (s *Sender) SendRecoveryCode(ctx context.Context, f *recovery.Flow, via ide
return s.SendRecoveryCodeTo(ctx, i, rawCode, code, f)
}
func (s *Sender) SendRecoveryCodeTo(ctx context.Context, i *identity.Identity, codeString string, code *RecoveryCode, f flow.Flow) error {
func (s *Sender) SendRecoveryCodeTo(ctx context.Context, i *identity.Identity, codeString string, code *RecoveryCode, f *recovery.Flow) error {
s.deps.Audit().
WithField("via", code.RecoveryAddress.Via).
WithField("identity_id", code.RecoveryAddress.IdentityID).
@ -241,11 +255,17 @@ func (s *Sender) SendRecoveryCodeTo(ctx context.Context, i *identity.Identity, c
return err
}
transientPayload, err := x.ParseRawMessageOrEmpty(f.GetTransientPayload())
if err != nil {
return errors.WithStack(err)
}
emailModel := email.RecoveryCodeValidModel{
To: code.RecoveryAddress.Value,
RecoveryCode: codeString,
Identity: model,
RequestURL: f.GetRequestURL(),
To: code.RecoveryAddress.Value,
RecoveryCode: codeString,
Identity: model,
RequestURL: f.GetRequestURL(),
TransientPayload: transientPayload,
}
return s.send(ctx, string(code.RecoveryAddress.Via), email.NewRecoveryCodeValid(s.deps, &emailModel))
@ -271,11 +291,17 @@ func (s *Sender) SendVerificationCode(ctx context.Context, f *verification.Flow,
WithSensitiveField("email_address", to).
WithField("was_notified", notifyUnknownRecipients).
Info("Address verification was requested for an unknown address.")
transientPayload, err := x.ParseRawMessageOrEmpty(f.GetTransientPayload())
if err != nil {
return errors.WithStack(err)
}
if !notifyUnknownRecipients {
// do nothing
} else if err := s.send(ctx, string(via), email.NewVerificationCodeInvalid(s.deps, &email.VerificationCodeInvalidModel{
To: to,
RequestURL: f.GetRequestURL(),
To: to,
RequestURL: f.GetRequestURL(),
TransientPayload: transientPayload,
})); err != nil {
return err
}
@ -302,10 +328,7 @@ func (s *Sender) SendVerificationCode(ctx context.Context, f *verification.Flow,
return err
}
if err := s.SendVerificationCodeTo(ctx, f, i, rawCode, code); err != nil {
return err
}
return nil
return s.SendVerificationCodeTo(ctx, f, i, rawCode, code)
}
func (s *Sender) constructVerificationLink(ctx context.Context, fID uuid.UUID, codeStr string) string {
@ -331,6 +354,11 @@ func (s *Sender) SendVerificationCodeTo(ctx context.Context, f *verification.Flo
return err
}
transientPayload, err := x.ParseRawMessageOrEmpty(f.GetTransientPayload())
if err != nil {
return errors.WithStack(err)
}
var t courier.Template
// TODO: this can likely be abstracted by making templates not specific to the channel they're using
@ -342,6 +370,7 @@ func (s *Sender) SendVerificationCodeTo(ctx context.Context, f *verification.Flo
Identity: model,
VerificationCode: codeString,
RequestURL: f.GetRequestURL(),
TransientPayload: transientPayload,
})
case identity.ChannelTypeSMS:
t = sms.NewVerificationCodeValid(s.deps, &sms.VerificationCodeValidModel{
@ -349,6 +378,7 @@ func (s *Sender) SendVerificationCodeTo(ctx context.Context, f *verification.Flo
VerificationCode: codeString,
Identity: model,
RequestURL: f.GetRequestURL(),
TransientPayload: transientPayload,
})
default:
return errors.WithStack(herodot.ErrInternalServerError.WithReasonf("Expected email or sms but got %s", code.VerifiableAddress.Via))

View File

@ -6,6 +6,7 @@ package code
import (
"context"
"database/sql"
"encoding/json"
"net/http"
"strings"
@ -57,6 +58,11 @@ type updateLoginFlowWithCodeMethod struct {
// Resend is set when the user wants to resend the code
// required: false
Resend string `json:"resend" form:"resend"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (s *Strategy) RegisterLoginRoutes(*x.RouterPublic) {}
@ -173,6 +179,8 @@ func (s *Strategy) Login(w http.ResponseWriter, r *http.Request, f *login.Flow,
return nil, s.HandleLoginError(r, f, &p, err)
}
f.TransientPayload = p.TransientPayload
if err := flow.EnsureCSRF(s.deps, r, f.Type, s.deps.Config().DisableAPIFlowEnforcement(ctx), s.deps.GenerateCSRFToken, p.CSRFToken); err != nil {
return nil, s.HandleLoginError(r, f, &p, err)
}

View File

@ -4,6 +4,7 @@
package code
import (
"encoding/json"
"net/http"
"net/url"
"time"
@ -83,6 +84,11 @@ type updateRecoveryFlowWithCodeMethod struct {
//
// required: true
Method recovery.RecoveryMethod `json:"method"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (s Strategy) isCodeFlow(f *recovery.Flow) bool {
@ -107,6 +113,8 @@ func (s *Strategy) Recover(w http.ResponseWriter, r *http.Request, f *recovery.F
return s.HandleRecoveryError(w, r, nil, body, err)
}
f.TransientPayload = body.TransientPayload
if f.DangerousSkipCSRFCheck {
s.deps.Logger().
WithRequest(r).
@ -460,11 +468,12 @@ func (s *Strategy) HandleRecoveryError(w http.ResponseWriter, r *http.Request, f
}
type recoverySubmitPayload struct {
Method string `json:"method" form:"method"`
Code string `json:"code" form:"code"`
CSRFToken string `json:"csrf_token" form:"csrf_token"`
Flow string `json:"flow" form:"flow"`
Email string `json:"email" form:"email"`
Method string `json:"method" form:"method"`
Code string `json:"code" form:"code"`
CSRFToken string `json:"csrf_token" form:"csrf_token"`
Flow string `json:"flow" form:"flow"`
Email string `json:"email" form:"email"`
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (s *Strategy) decodeRecovery(r *http.Request) (*recoverySubmitPayload, error) {

View File

@ -50,15 +50,15 @@ type updateRegistrationFlowWithCodeMethod struct {
// required: true
Method string `json:"method" form:"method"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
// Resend restarts the flow with a new code
//
// required: false
Resend string `json:"resend" form:"resend"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (p *updateRegistrationFlowWithCodeMethod) GetResend() string {
@ -99,7 +99,7 @@ func WithCredentials(via identity.CodeAddressType, usedAt sql.NullTime) options
}
}
func (s *Strategy) handleIdentityTraits(ctx context.Context, f *registration.Flow, traits json.RawMessage, transientPayload json.RawMessage, i *identity.Identity, opts ...options) error {
func (s *Strategy) handleIdentityTraits(ctx context.Context, f *registration.Flow, traits, transientPayload json.RawMessage, i *identity.Identity, opts ...options) error {
f.TransientPayload = transientPayload
if len(traits) == 0 {
traits = json.RawMessage("{}")
@ -152,6 +152,8 @@ func (s *Strategy) Register(w http.ResponseWriter, r *http.Request, f *registrat
return s.HandleRegistrationError(ctx, r, f, &p, err)
}
f.TransientPayload = p.TransientPayload
if err := flow.EnsureCSRF(s.deps, r, f.Type, s.deps.Config().DisableAPIFlowEnforcement(ctx), s.deps.GenerateCSRFToken, p.CSRFToken); err != nil {
return s.HandleRegistrationError(ctx, r, f, &p, err)
}

View File

@ -5,6 +5,7 @@ package code
import (
"context"
"encoding/json"
"net/http"
"time"
@ -110,6 +111,11 @@ type updateVerificationFlowWithCodeMethod struct {
// The id of the flow
Flow string `json:"-" form:"-"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
// getMethod returns the method of this submission or "" if no method could be found
@ -134,6 +140,8 @@ func (s *Strategy) Verify(w http.ResponseWriter, r *http.Request, f *verificatio
return s.handleVerificationError(w, r, nil, body, err)
}
f.TransientPayload = body.TransientPayload
if err := flow.MethodEnabledAndAllowed(r.Context(), f.GetFlowName(), s.VerificationStrategyID(), string(body.getMethod()), s.deps); err != nil {
return s.handleVerificationError(w, r, f, body, err)
}

View File

@ -19,6 +19,10 @@
},
"csrf_token": {
"type": "string"
},
"transient_payload": {
"type": "object",
"additionalProperties": true
}
}
}

View File

@ -19,6 +19,10 @@
},
"csrf_token": {
"type": "string"
},
"transient_payload": {
"type": "object",
"additionalProperties": true
}
}
}

View File

@ -73,11 +73,17 @@ func (s *Sender) SendRecoveryLink(ctx context.Context, f *recovery.Flow, via ide
WithSensitiveField("email_address", address).
WithField("was_notified", notifyUnknownRecipients).
Info("Account recovery was requested for an unknown address.")
transientPayload, err := x.ParseRawMessageOrEmpty(f.GetTransientPayload())
if err != nil {
return errors.WithStack(err)
}
if !notifyUnknownRecipients {
// do nothing
} else if err := s.send(ctx, string(via), email.NewRecoveryInvalid(s.r, &email.RecoveryInvalidModel{
To: to,
RequestURL: f.GetRequestURL(),
To: to,
RequestURL: f.GetRequestURL(),
TransientPayload: transientPayload,
})); err != nil {
return err
}
@ -125,11 +131,17 @@ func (s *Sender) SendVerificationLink(ctx context.Context, f *verification.Flow,
WithSensitiveField("email_address", to).
WithField("was_notified", notifyUnknownRecipients).
Info("Address verification was requested for an unknown address.")
transientPayload, err := x.ParseRawMessageOrEmpty(f.GetTransientPayload())
if err != nil {
return errors.WithStack(err)
}
if !notifyUnknownRecipients {
// do nothing
} else if err := s.send(ctx, string(via), email.NewVerificationInvalid(s.r, &email.VerificationInvalidModel{
To: to,
RequestURL: f.GetRequestURL(),
To: to,
RequestURL: f.GetRequestURL(),
TransientPayload: transientPayload,
})); err != nil {
return err
}
@ -170,15 +182,26 @@ func (s *Sender) SendRecoveryTokenTo(ctx context.Context, f *recovery.Flow, i *i
return err
}
transientPayload, err := x.ParseRawMessageOrEmpty(f.GetTransientPayload())
if err != nil {
return errors.WithStack(err)
}
recoveryUrl := urlx.CopyWithQuery(
urlx.AppendPaths(s.r.Config().SelfServiceLinkMethodBaseURL(ctx), recovery.RouteSubmitFlow),
url.Values{
"token": {token.Token},
"flow": {f.ID.String()},
}).
String()
return s.send(ctx, string(address.Via), email.NewRecoveryValid(s.r,
&email.RecoveryValidModel{To: address.Value, RecoveryURL: urlx.CopyWithQuery(
urlx.AppendPaths(s.r.Config().SelfServiceLinkMethodBaseURL(ctx), recovery.RouteSubmitFlow),
url.Values{
"token": {token.Token},
"flow": {f.ID.String()},
}).String(),
Identity: model,
RequestURL: f.GetRequestURL(),
&email.RecoveryValidModel{
To: address.Value,
RecoveryURL: recoveryUrl,
Identity: model,
RequestURL: f.GetRequestURL(),
TransientPayload: transientPayload,
}))
}
@ -196,17 +219,25 @@ func (s *Sender) SendVerificationTokenTo(ctx context.Context, f *verification.Fl
return err
}
transientPayload, err := x.ParseRawMessageOrEmpty(f.GetTransientPayload())
if err != nil {
return errors.WithStack(err)
}
verificationUrl := urlx.CopyWithQuery(
urlx.AppendPaths(s.r.Config().SelfServiceLinkMethodBaseURL(ctx), verification.RouteSubmitFlow),
url.Values{
"flow": {f.ID.String()},
"token": {token.Token},
}).String()
if err := s.send(ctx, string(address.Via), email.NewVerificationValid(s.r,
&email.VerificationValidModel{
To: address.Value,
VerificationURL: urlx.CopyWithQuery(
urlx.AppendPaths(s.r.Config().SelfServiceLinkMethodBaseURL(ctx), verification.RouteSubmitFlow),
url.Values{
"flow": {f.ID.String()},
"token": {token.Token},
}).String(),
Identity: model,
RequestURL: f.GetRequestURL(),
To: address.Value,
VerificationURL: verificationUrl,
Identity: model,
RequestURL: f.GetRequestURL(),
TransientPayload: transientPayload,
})); err != nil {
return err
}

View File

@ -4,6 +4,7 @@
package link
import (
"encoding/json"
"net/http"
"net/url"
"time"
@ -232,6 +233,11 @@ type updateRecoveryFlowWithLinkMethod struct {
//
// required: true
Method recovery.RecoveryMethod `json:"method"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (s *Strategy) Recover(w http.ResponseWriter, r *http.Request, f *recovery.Flow) (err error) {
@ -244,6 +250,8 @@ func (s *Strategy) Recover(w http.ResponseWriter, r *http.Request, f *recovery.F
return s.HandleRecoveryError(w, r, nil, body, err)
}
f.TransientPayload = body.TransientPayload
if len(body.Token) > 0 {
if err := flow.MethodEnabledAndAllowed(r.Context(), f.GetFlowName(), s.RecoveryStrategyID(), s.RecoveryStrategyID(), s.d); err != nil {
return s.HandleRecoveryError(w, r, nil, body, err)
@ -514,11 +522,12 @@ func (s *Strategy) HandleRecoveryError(w http.ResponseWriter, r *http.Request, r
}
type recoverySubmitPayload struct {
Method string `json:"method" form:"method"`
Token string `json:"token" form:"token"`
CSRFToken string `json:"csrf_token" form:"csrf_token"`
Flow string `json:"flow" form:"flow"`
Email string `json:"email" form:"email"`
Method string `json:"method" form:"method"`
Token string `json:"token" form:"token"`
CSRFToken string `json:"csrf_token" form:"csrf_token"`
Flow string `json:"flow" form:"flow"`
Email string `json:"email" form:"email"`
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (s *Strategy) decodeRecovery(r *http.Request) (*recoverySubmitPayload, error) {

View File

@ -5,6 +5,7 @@ package link
import (
"context"
"encoding/json"
"net/http"
"net/url"
"time"
@ -48,11 +49,12 @@ func (s *Strategy) PopulateVerificationMethod(r *http.Request, f *verification.F
}
type verificationSubmitPayload struct {
Method string `json:"method" form:"method"`
Token string `json:"token" form:"token"`
CSRFToken string `json:"csrf_token" form:"csrf_token"`
Flow string `json:"flow" form:"flow"`
Email string `json:"email" form:"email"`
Method string `json:"method" form:"method"`
Token string `json:"token" form:"token"`
CSRFToken string `json:"csrf_token" form:"csrf_token"`
Flow string `json:"flow" form:"flow"`
Email string `json:"email" form:"email"`
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (s *Strategy) decodeVerification(r *http.Request) (*verificationSubmitPayload, error) {
@ -115,6 +117,11 @@ type updateVerificationFlowWithLinkMethod struct {
//
// required: true
Method verification.VerificationStrategy `json:"method"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (s *Strategy) Verify(w http.ResponseWriter, r *http.Request, f *verification.Flow) (err error) {
@ -127,6 +134,7 @@ func (s *Strategy) Verify(w http.ResponseWriter, r *http.Request, f *verificatio
if err != nil {
return s.handleVerificationError(w, r, nil, body, err)
}
f.TransientPayload = body.TransientPayload
if len(body.Token) > 0 {
if err := flow.MethodEnabledAndAllowed(r.Context(), f.GetFlowName(), s.VerificationStrategyID(), s.VerificationStrategyID(), s.d); err != nil {

View File

@ -15,6 +15,10 @@
},
"lookup_secret": {
"type": "string"
},
"transient_payload": {
"type": "object",
"additionalProperties": true
}
}
}

View File

@ -20,6 +20,10 @@
},
"lookup_secret_confirm": {
"type": "boolean"
},
"transient_payload": {
"type": "object",
"additionalProperties": true
}
}
}

View File

@ -82,6 +82,11 @@ type updateSettingsFlowWithLookupMethod struct {
//
// swagger:ignore
Flow string `json:"flow"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (p *updateSettingsFlowWithLookupMethod) GetFlowID() uuid.UUID {

View File

@ -33,6 +33,10 @@
},
"additionalProperties": false
}
},
"transient_payload": {
"type": "object",
"additionalProperties": true
}
}
}

View File

@ -100,6 +100,11 @@ type UpdateLoginFlowWithOidcMethod struct {
//
// required: false
IDTokenNonce string `json:"id_token_nonce,omitempty"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (s *Strategy) processLogin(w http.ResponseWriter, r *http.Request, loginFlow *login.Flow, token *oauth2.Token, claims *Claims, provider Provider, container *AuthCodeContainer) (*registration.Flow, error) {
@ -146,6 +151,7 @@ func (s *Strategy) processLogin(w http.ResponseWriter, r *http.Request, loginFlo
registrationFlow.IDToken = loginFlow.IDToken
registrationFlow.RawIDTokenNonce = loginFlow.RawIDTokenNonce
registrationFlow.RequestURL, err = x.TakeOverReturnToParameter(loginFlow.RequestURL, registrationFlow.RequestURL)
registrationFlow.TransientPayload = loginFlow.TransientPayload
if err != nil {
return nil, s.handleError(w, r, loginFlow, provider.Config().ID, nil, err)
}
@ -195,6 +201,7 @@ func (s *Strategy) Login(w http.ResponseWriter, r *http.Request, f *login.Flow,
f.IDToken = p.IDToken
f.RawIDTokenNonce = p.IDTokenNonce
f.TransientPayload = p.TransientPayload
pid := p.Provider // this can come from both url query and post body
if pid == "" {

View File

@ -84,11 +84,6 @@ type UpdateRegistrationFlowWithOidcMethod struct {
// required: true
Method string `json:"method"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty"`
// UpstreamParameters are the parameters that are passed to the upstream identity provider.
//
// These parameters are optional and depend on what the upstream identity provider supports.
@ -117,6 +112,11 @@ type UpdateRegistrationFlowWithOidcMethod struct {
//
// required: false
IDTokenNonce string `json:"id_token_nonce,omitempty"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (s *Strategy) newLinkDecoder(p interface{}, r *http.Request) error {
@ -157,15 +157,15 @@ func (s *Strategy) Register(w http.ResponseWriter, r *http.Request, f *registrat
return s.handleError(w, r, f, "", nil, err)
}
f.TransientPayload = p.TransientPayload
f.IDToken = p.IDToken
f.RawIDTokenNonce = p.IDTokenNonce
pid := p.Provider // this can come from both url query and post body
if pid == "" {
return errors.WithStack(flow.ErrStrategyNotResponsible)
}
f.TransientPayload = p.TransientPayload
f.IDToken = p.IDToken
f.RawIDTokenNonce = p.IDTokenNonce
if !strings.EqualFold(strings.ToLower(p.Method), s.SettingsStrategyID()) && p.Method != "" {
// the user is sending a method that is not oidc, but the payload includes a provider
s.d.Audit().
@ -274,6 +274,7 @@ func (s *Strategy) registrationToLogin(w http.ResponseWriter, r *http.Request, r
if err != nil {
return nil, err
}
lf.TransientPayload = rf.TransientPayload
return lf, nil
}

View File

@ -38,13 +38,20 @@ import (
//go:embed .schema/settings.schema.json
var settingsSchema []byte
var _ settings.Strategy = new(Strategy)
var UnknownConnectionValidationError = &jsonschema.ValidationError{
Message: "can not unlink non-existing OpenID Connect connection", InstancePtr: "#/"}
var (
_ settings.Strategy = new(Strategy)
UnknownConnectionValidationError = &jsonschema.ValidationError{
Message: "can not unlink non-existing OpenID Connect connection", InstancePtr: "#/",
}
)
var ConnectionExistValidationError = &jsonschema.ValidationError{
Message: "can not link unknown or already existing OpenID Connect connection", InstancePtr: "#/"}
Message: "can not link unknown or already existing OpenID Connect connection", InstancePtr: "#/",
}
var UnlinkAllFirstFactorConnectionsError = &jsonschema.ValidationError{
Message: "can not unlink OpenID Connect connection because it is the last remaining first factor credential", InstancePtr: "#/"}
Message: "can not unlink OpenID Connect connection because it is the last remaining first factor credential", InstancePtr: "#/",
}
func (s *Strategy) RegisterSettingsRoutes(router *x.RouterPublic) {}
@ -237,6 +244,11 @@ type updateSettingsFlowWithOidcMethod struct {
//
// required: false
UpstreamParameters json.RawMessage `json:"upstream_parameters"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (p *updateSettingsFlowWithOidcMethod) GetFlowID() uuid.UUID {
@ -252,6 +264,7 @@ func (s *Strategy) Settings(w http.ResponseWriter, r *http.Request, f *settings.
if err := s.decoderSettings(&p, r); err != nil {
return nil, err
}
f.TransientPayload = p.TransientPayload
ctxUpdate, err := settings.PrepareUpdate(s.d, w, r, f, ss, settings.ContinuityKey(s.SettingsStrategyID()), &p)
if errors.Is(err, settings.ErrContinuePreviousAction) {
@ -306,7 +319,8 @@ func (s *Strategy) Settings(w http.ResponseWriter, r *http.Request, f *settings.
return nil, s.handleSettingsError(w, r, ctxUpdate, &p, errors.WithStack(errors.WithStack(&jsonschema.ValidationError{
Message: "missing properties: link, unlink", InstancePtr: "#/",
Context: &jsonschema.ValidationErrorContextRequired{Missing: []string{"link", "unlink"}}})))
Context: &jsonschema.ValidationErrorContextRequired{Missing: []string{"link", "unlink"}},
})))
}
func (s *Strategy) isLinkable(r *http.Request, ctxUpdate *settings.UpdateContext, toLink string) (*identity.Identity, error) {
@ -391,7 +405,8 @@ func (s *Strategy) initLinkProvider(w http.ResponseWriter, r *http.Request, ctxU
func (s *Strategy) linkProvider(w http.ResponseWriter, r *http.Request, ctxUpdate *settings.UpdateContext, token *oauth2.Token, claims *Claims, provider Provider) error {
p := &updateSettingsFlowWithOidcMethod{
Link: provider.Config().ID, FlowID: ctxUpdate.Flow.ID.String()}
Link: provider.Config().ID, FlowID: ctxUpdate.Flow.ID.String(),
}
if ctxUpdate.Session.AuthenticatedAt.Add(s.d.Config().SelfServiceFlowSettingsPrivilegedSessionMaxAge(r.Context())).Before(time.Now()) {
return s.handleSettingsError(w, r, ctxUpdate, p, errors.WithStack(settings.NewFlowNeedsReAuth()))
}
@ -490,7 +505,6 @@ func (s *Strategy) unlinkProvider(w http.ResponseWriter, r *http.Request, ctxUpd
creds.Config, err = json.Marshal(&identity.CredentialsOIDC{Providers: updatedProviders})
if err != nil {
return s.handleSettingsError(w, r, ctxUpdate, p, errors.WithStack(err))
}
i.Credentials[s.ID()] = *creds
@ -527,7 +541,7 @@ func (s *Strategy) Link(ctx context.Context, i *identity.Identity, credentialsCo
if len(credentialsOIDCConfig.Providers) != 1 {
return errors.New("No oidc provider was set")
}
var credentialsOIDCProvider = credentialsOIDCConfig.Providers[0]
credentialsOIDCProvider := credentialsOIDCConfig.Providers[0]
if err := s.linkCredentials(
ctx,

View File

@ -16,6 +16,10 @@
},
"method": {
"type": "string"
},
"transient_payload": {
"type": "object",
"additionalProperties": true
}
},
"allOf": [

View File

@ -15,6 +15,10 @@
"password": {
"type": "string",
"minLength": 1
},
"transient_payload": {
"type": "object",
"additionalProperties": true
}
}
}

View File

@ -63,6 +63,7 @@ func (s *Strategy) Login(w http.ResponseWriter, r *http.Request, f *login.Flow,
decoderx.HTTPDecoderJSONFollowsFormFormat()); err != nil {
return nil, s.handleLoginError(w, r, f, &p, err)
}
f.TransientPayload = p.TransientPayload
if err := flow.EnsureCSRF(s.d, r, f.Type, s.d.Config().DisableAPIFlowEnforcement(r.Context()), s.d.GenerateCSRFToken, p.CSRFToken); err != nil {
return nil, s.handleLoginError(w, r, f, &p, err)

View File

@ -50,7 +50,7 @@ type UpdateRegistrationFlowWithPasswordMethod struct {
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty"`
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (s *Strategy) RegisterRegistrationRoutes(_ *x.RouterPublic) {

View File

@ -56,6 +56,11 @@ type updateSettingsFlowWithPasswordMethod struct {
//
// swagger:ignore
Flow string `json:"flow"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (p *updateSettingsFlowWithPasswordMethod) GetFlowID() uuid.UUID {

View File

@ -3,9 +3,7 @@
package password
import (
"github.com/ory/kratos/ui/container"
)
import "encoding/json"
// Update Login Flow with Password Method
//
@ -32,9 +30,9 @@ type updateLoginFlowWithPasswordMethod struct {
//
// required: true
Identifier string `json:"identifier"`
}
// FlowMethod contains the configuration for this selfservice strategy.
type FlowMethod struct {
*container.Container
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}

View File

@ -12,6 +12,10 @@
"traits": {},
"csrf_token": {
"type": "string"
},
"transient_payload": {
"type": "object",
"additionalProperties": true
}
}
}

View File

@ -208,6 +208,11 @@ type updateSettingsFlowWithProfileMethod struct {
//
// This token is only required when performing browser flows.
CSRFToken string `json:"csrf_token"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (p *updateSettingsFlowWithProfileMethod) GetFlowID() uuid.UUID {

View File

@ -16,6 +16,10 @@
"totp_code": {
"type": "string",
"minLength": 6
},
"transient_payload": {
"type": "object",
"additionalProperties": true
}
}
}

View File

@ -14,6 +14,10 @@
},
"totp_unlink": {
"type": "boolean"
},
"transient_payload": {
"type": "object",
"additionalProperties": true
}
},
"if": {

View File

@ -83,6 +83,11 @@ type updateLoginFlowWithTotpMethod struct {
//
// required: true
TOTPCode string `json:"totp_code"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (s *Strategy) Login(w http.ResponseWriter, r *http.Request, f *login.Flow, sess *session.Session) (i *identity.Identity, err error) {
@ -101,6 +106,7 @@ func (s *Strategy) Login(w http.ResponseWriter, r *http.Request, f *login.Flow,
decoderx.HTTPDecoderJSONFollowsFormFormat()); err != nil {
return nil, s.handleLoginError(r, f, err)
}
f.TransientPayload = p.TransientPayload
if err := flow.EnsureCSRF(s.d, r, f.Type, s.d.Config().DisableAPIFlowEnforcement(r.Context()), s.d.GenerateCSRFToken, p.CSRFToken); err != nil {
return nil, s.handleLoginError(r, f, err)

View File

@ -68,6 +68,11 @@ type updateSettingsFlowWithTotpMethod struct {
//
// swagger:ignore
Flow string `json:"flow"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (p *updateSettingsFlowWithTotpMethod) GetFlowID() uuid.UUID {

View File

@ -15,6 +15,10 @@
"identifier": {
"type": "string",
"minLength": 1
},
"transient_payload": {
"type": "object",
"additionalProperties": true
}
},
"if": {

View File

@ -17,6 +17,10 @@
},
"webauthn_remove": {
"type": "string"
},
"transient_payload": {
"type": "object",
"additionalProperties": true
}
},
"if": {

View File

@ -199,6 +199,11 @@ type updateLoginFlowWithWebAuthnMethod struct {
//
// This must contain the ID of the WebAuthN connection.
Login string `json:"webauthn_login"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (s *Strategy) Login(w http.ResponseWriter, r *http.Request, f *login.Flow, sess *session.Session) (i *identity.Identity, err error) {
@ -213,6 +218,7 @@ func (s *Strategy) Login(w http.ResponseWriter, r *http.Request, f *login.Flow,
decoderx.HTTPDecoderJSONFollowsFormFormat()); err != nil {
return nil, s.handleLoginError(r, f, err)
}
f.TransientPayload = p.TransientPayload
if len(p.Login) > 0 || p.Method == s.SettingsStrategyID() {
// This method has only two submit buttons

View File

@ -64,7 +64,7 @@ type updateRegistrationFlowWithWebAuthnMethod struct {
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty"`
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (s *Strategy) RegisterRegistrationRoutes(_ *x.RouterPublic) {

View File

@ -83,6 +83,11 @@ type updateSettingsFlowWithWebAuthnMethod struct {
//
// swagger:ignore
Flow string `json:"flow"`
// Transient data to pass along to any webhooks
//
// required: false
TransientPayload json.RawMessage `json:"transient_payload,omitempty" form:"transient_payload"`
}
func (p *updateSettingsFlowWithWebAuthnMethod) GetFlowID() uuid.UUID {

View File

@ -1331,6 +1331,10 @@
"state": {
"description": "State represents the state of this request:\n\nchoose_method: ask the user to choose a method to sign in with\nsent_email: the email has been sent to the user\npassed_challenge: the request was successful and the login challenge was passed."
},
"transient_payload": {
"description": "TransientPayload is used to pass data from the login to hooks and email templates",
"type": "object"
},
"type": {
"$ref": "#/components/schemas/selfServiceFlowType"
},
@ -1629,6 +1633,10 @@
"state": {
"description": "State represents the state of this request:\n\nchoose_method: ask the user to choose a method (e.g. recover account via email)\nsent_email: the email has been sent to the user\npassed_challenge: the request was successful and the recovery challenge was passed."
},
"transient_payload": {
"description": "TransientPayload is used to pass data from the recovery flow to hooks and email templates",
"type": "object"
},
"type": {
"$ref": "#/components/schemas/selfServiceFlowType"
},
@ -1989,6 +1997,10 @@
"state": {
"description": "State represents the state of this flow. It knows two states:\n\nshow_form: No user data has been collected, or it is invalid, and thus the form should be shown.\nsuccess: Indicates that the settings flow has been updated successfully with the provided data.\nDone will stay true when repeatedly checking. If set to true, done will revert back to false only\nwhen a flow with invalid (e.g. \"please use a valid phone number\") data was sent."
},
"transient_payload": {
"description": "TransientPayload is used to pass data from the settings flow to hooks and email templates",
"type": "object"
},
"type": {
"$ref": "#/components/schemas/selfServiceFlowType"
},
@ -2573,6 +2585,10 @@
"resend": {
"description": "Resend is set when the user wants to resend the code",
"type": "string"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
},
"required": [
@ -2630,6 +2646,10 @@
"description": "The identity traits. This is a placeholder for the registration flow.",
"type": "object"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
},
"upstream_parameters": {
"description": "UpstreamParameters are the parameters that are passed to the upstream identity provider.\n\nThese parameters are optional and depend on what the upstream identity provider supports.\nSupported parameters are:\n`login_hint` (string): The `login_hint` parameter suppresses the account chooser and either pre-fills the email box on the sign-in form, or selects the proper session.\n`hd` (string): The `hd` parameter limits the login/registration process to a Google Organization, e.g. `mycollege.edu`.\n`prompt` (string): The `prompt` specifies whether the Authorization Server prompts the End-User for reauthentication and consent, e.g. `select_account`.",
"type": "object"
@ -2663,6 +2683,10 @@
"password_identifier": {
"description": "Identifier is the email or username of the user trying to log in.\nThis field is deprecated!",
"type": "string"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
},
"required": [
@ -2686,6 +2710,10 @@
"totp_code": {
"description": "The TOTP code.",
"type": "string"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
},
"required": [
@ -2709,6 +2737,10 @@
"description": "Method should be set to \"webAuthn\" when logging in using the WebAuthn strategy.",
"type": "string"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
},
"webauthn_login": {
"description": "Login a WebAuthn Security Key\n\nThis must contain the ID of the WebAuthN connection.",
"type": "string"
@ -2761,6 +2793,10 @@
],
"type": "string",
"x-go-enum-desc": "link RecoveryStrategyLink\ncode RecoveryStrategyCode"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
},
"required": [
@ -2787,6 +2823,10 @@
],
"type": "string",
"x-go-enum-desc": "link RecoveryStrategyLink\ncode RecoveryStrategyCode"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
},
"required": [
@ -3025,6 +3065,10 @@
"method": {
"description": "Method\n\nShould be set to \"lookup\" when trying to add, update, or remove a lookup pairing.",
"type": "string"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
},
"required": [
@ -3051,6 +3095,10 @@
"description": "The identity's traits\n\nin: body",
"type": "object"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
},
"unlink": {
"description": "Unlink this provider\n\nEither this or `link` must be set.\n\ntype: string\nin: body",
"type": "string"
@ -3079,6 +3127,10 @@
"password": {
"description": "Password is the updated password",
"type": "string"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
},
"required": [
@ -3101,6 +3153,10 @@
"traits": {
"description": "Traits\n\nThe identity's traits.",
"type": "object"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
},
"required": [
@ -3127,6 +3183,10 @@
"totp_unlink": {
"description": "UnlinkTOTP if true will remove the TOTP pairing,\neffectively removing the credential. This can be used\nto set up a new TOTP device.",
"type": "boolean"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
},
"required": [
@ -3145,6 +3205,10 @@
"description": "Method\n\nShould be set to \"webauthn\" when trying to add, update, or remove a webAuthn pairing.",
"type": "string"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
},
"webauthn_register": {
"description": "Register a WebAuthn Security Key\n\nIt is expected that the JSON returned by the WebAuthn registration process\nis included here.",
"type": "string"
@ -3203,6 +3267,10 @@
],
"type": "string",
"x-go-enum-desc": "link VerificationStrategyLink\ncode VerificationStrategyCode"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
},
"required": [
@ -3229,6 +3297,10 @@
],
"type": "string",
"x-go-enum-desc": "link VerificationStrategyLink\ncode VerificationStrategyCode"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
},
"required": [
@ -3323,6 +3395,10 @@
"state": {
"description": "State represents the state of this request:\n\nchoose_method: ask the user to choose a method (e.g. verify your email)\nsent_email: the email has been sent to the user\npassed_challenge: the request was successful and the verification challenge was passed."
},
"transient_payload": {
"description": "TransientPayload is used to pass data from the verification flow to hooks and email templates",
"type": "object"
},
"type": {
"$ref": "#/components/schemas/selfServiceFlowType"
},

View File

@ -4459,6 +4459,10 @@
"state": {
"description": "State represents the state of this request:\n\nchoose_method: ask the user to choose a method to sign in with\nsent_email: the email has been sent to the user\npassed_challenge: the request was successful and the login challenge was passed."
},
"transient_payload": {
"description": "TransientPayload is used to pass data from the login to hooks and email templates",
"type": "object"
},
"type": {
"$ref": "#/definitions/selfServiceFlowType"
},
@ -4743,6 +4747,10 @@
"state": {
"description": "State represents the state of this request:\n\nchoose_method: ask the user to choose a method (e.g. recover account via email)\nsent_email: the email has been sent to the user\npassed_challenge: the request was successful and the recovery challenge was passed."
},
"transient_payload": {
"description": "TransientPayload is used to pass data from the recovery flow to hooks and email templates",
"type": "object"
},
"type": {
"$ref": "#/definitions/selfServiceFlowType"
},
@ -5094,6 +5102,10 @@
"state": {
"description": "State represents the state of this flow. It knows two states:\n\nshow_form: No user data has been collected, or it is invalid, and thus the form should be shown.\nsuccess: Indicates that the settings flow has been updated successfully with the provided data.\nDone will stay true when repeatedly checking. If set to true, done will revert back to false only\nwhen a flow with invalid (e.g. \"please use a valid phone number\") data was sent."
},
"transient_payload": {
"description": "TransientPayload is used to pass data from the settings flow to hooks and email templates",
"type": "object"
},
"type": {
"$ref": "#/definitions/selfServiceFlowType"
},
@ -5612,6 +5624,10 @@
"resend": {
"description": "Resend is set when the user wants to resend the code",
"type": "string"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
}
},
@ -5669,6 +5685,10 @@
"description": "The identity traits. This is a placeholder for the registration flow.",
"type": "object"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
},
"upstream_parameters": {
"description": "UpstreamParameters are the parameters that are passed to the upstream identity provider.\n\nThese parameters are optional and depend on what the upstream identity provider supports.\nSupported parameters are:\n`login_hint` (string): The `login_hint` parameter suppresses the account chooser and either pre-fills the email box on the sign-in form, or selects the proper session.\n`hd` (string): The `hd` parameter limits the login/registration process to a Google Organization, e.g. `mycollege.edu`.\n`prompt` (string): The `prompt` specifies whether the Authorization Server prompts the End-User for reauthentication and consent, e.g. `select_account`.",
"type": "object"
@ -5703,6 +5723,10 @@
"password_identifier": {
"description": "Identifier is the email or username of the user trying to log in.\nThis field is deprecated!",
"type": "string"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
}
},
@ -5725,6 +5749,10 @@
"totp_code": {
"description": "The TOTP code.",
"type": "string"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
}
},
@ -5748,6 +5776,10 @@
"description": "Method should be set to \"webAuthn\" when logging in using the WebAuthn strategy.",
"type": "string"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
},
"webauthn_login": {
"description": "Login a WebAuthn Security Key\n\nThis must contain the ID of the WebAuthN connection.",
"type": "string"
@ -5785,6 +5817,10 @@
"code"
],
"x-go-enum-desc": "link RecoveryStrategyLink\ncode RecoveryStrategyCode"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
}
},
@ -5812,6 +5848,10 @@
"code"
],
"x-go-enum-desc": "link RecoveryStrategyLink\ncode RecoveryStrategyCode"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
}
},
@ -5994,6 +6034,10 @@
"method": {
"description": "Method\n\nShould be set to \"lookup\" when trying to add, update, or remove a lookup pairing.",
"type": "string"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
}
},
@ -6020,6 +6064,10 @@
"description": "The identity's traits\n\nin: body",
"type": "object"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
},
"unlink": {
"description": "Unlink this provider\n\nEither this or `link` must be set.\n\ntype: string\nin: body",
"type": "string"
@ -6049,6 +6097,10 @@
"password": {
"description": "Password is the updated password",
"type": "string"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
}
},
@ -6071,6 +6123,10 @@
"traits": {
"description": "Traits\n\nThe identity's traits.",
"type": "object"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
}
},
@ -6096,6 +6152,10 @@
"totp_unlink": {
"description": "UnlinkTOTP if true will remove the TOTP pairing,\neffectively removing the credential. This can be used\nto set up a new TOTP device.",
"type": "boolean"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
}
},
@ -6114,6 +6174,10 @@
"description": "Method\n\nShould be set to \"webauthn\" when trying to add, update, or remove a webAuthn pairing.",
"type": "string"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
},
"webauthn_register": {
"description": "Register a WebAuthn Security Key\n\nIt is expected that the JSON returned by the WebAuthn registration process\nis included here.",
"type": "string"
@ -6158,6 +6222,10 @@
"code"
],
"x-go-enum-desc": "link VerificationStrategyLink\ncode VerificationStrategyCode"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
}
},
@ -6185,6 +6253,10 @@
"code"
],
"x-go-enum-desc": "link VerificationStrategyLink\ncode VerificationStrategyCode"
},
"transient_payload": {
"description": "Transient data to pass along to any webhooks",
"type": "object"
}
}
},
@ -6282,6 +6354,10 @@
"state": {
"description": "State represents the state of this request:\n\nchoose_method: ask the user to choose a method (e.g. verify your email)\nsent_email: the email has been sent to the user\npassed_challenge: the request was successful and the verification challenge was passed."
},
"transient_payload": {
"description": "TransientPayload is used to pass data from the verification flow to hooks and email templates",
"type": "object"
},
"type": {
"$ref": "#/definitions/selfServiceFlowType"
},

Binary file not shown.

View File

@ -8,7 +8,7 @@ const WEBHOOK_TARGET = "https://webhook-target-gsmwn5ab4a-uc.a.run.app"
const documentUrl = (key: string) => `${WEBHOOK_TARGET}/documents/${key}`
const jsonnet = Buffer.from("function(ctx) ctx").toString("base64")
export const testRegistrationWebhook = (
export const testFlowWebhook = (
configSetup: (
hooks: Array<{ hook: string; config?: any }>,
) => Cypress.Chainable<void>,
@ -24,7 +24,6 @@ export const testRegistrationWebhook = (
method: "PUT",
},
},
{ hook: "session" },
])
const transient_payload = {
@ -34,27 +33,31 @@ export const testRegistrationWebhook = (
},
consent: true,
}
cy.intercept("POST", /.*\/self-service\/registration.*/, (req) => {
switch (typeof req.body) {
case "string":
req.body =
req.body +
"&transient_payload=" +
encodeURIComponent(JSON.stringify(transient_payload))
break
case "object":
req.body = {
...req.body,
transient_payload,
}
break
cy.intercept(
"POST",
/.*\/self-service\/(registration|login|recovery|verification|settings).*/,
(req) => {
switch (typeof req.body) {
case "string":
req.body =
req.body +
"&transient_payload=" +
encodeURIComponent(JSON.stringify(transient_payload))
break
case "object":
req.body = {
...req.body,
transient_payload,
}
break
default:
fail()
break
}
req.continue()
})
default:
fail()
break
}
req.continue()
},
)
act()

Some files were not shown because too many files have changed in this diff Show More