mirror of
https://github.com/teamhanko/hanko.git
synced 2025-10-29 15:49:41 +08:00
This pull request introduces the new Flowpilot system along with several new features and various improvements. The key enhancements include configurable authorization, registration, and profile flows, as well as the ability to enable and disable user identifiers (e.g., email addresses and usernames) and login methods. --------- Co-authored-by: Frederic Jahn <frederic.jahn@hanko.io> Co-authored-by: Lennart Fleischmann <lennart.fleischmann@hanko.io> Co-authored-by: lfleischmann <67686424+lfleischmann@users.noreply.github.com> Co-authored-by: merlindru <hello@merlindru.com>
41 lines
1.4 KiB
Go
41 lines
1.4 KiB
Go
package flowpilot
|
|
|
|
// defaultActionInitializationContext is the default implementation of the actionInitializationContext interface.
|
|
type defaultActionInitializationContext struct {
|
|
inputSchema initializationInputSchema // initializationInputSchema for action initialization.
|
|
isSuspended bool // Flag indicating if the method is suspended.
|
|
*defaultFlowContext // Embedding the defaultFlowContext for common context fields.
|
|
}
|
|
|
|
func (aic *defaultActionInitializationContext) Payload() payload {
|
|
return aic.payload
|
|
}
|
|
|
|
func (aic *defaultActionInitializationContext) Set(s string, i interface{}) {
|
|
aic.flow.Set(s, i)
|
|
}
|
|
|
|
// AddInputs adds input data to the initializationInputSchema.
|
|
func (aic *defaultActionInitializationContext) AddInputs(inputs ...Input) {
|
|
aic.inputSchema.AddInputs(inputs...)
|
|
}
|
|
|
|
// SuspendAction sets the isSuspended flag to indicate the action is suspended.
|
|
func (aic *defaultActionInitializationContext) SuspendAction() {
|
|
aic.isSuspended = true
|
|
}
|
|
|
|
// Stash returns the ReadOnlyJSONManager for accessing stash data.
|
|
func (aic *defaultActionInitializationContext) Stash() stash {
|
|
return aic.stash
|
|
}
|
|
|
|
// Get returns the context value with the given name.
|
|
func (aic *defaultActionInitializationContext) Get(key string) interface{} {
|
|
return aic.flow.contextValues[key]
|
|
}
|
|
|
|
func (aic *defaultActionInitializationContext) StateIsRevertible() bool {
|
|
return aic.stash.isRevertible()
|
|
}
|