api

package
v0.0.0-...-bbc5cb9 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PresignImageUploadRequestPerUser ratelimit.BucketName = "PresignImageUploadRequestPerUser"
)

Variables

View Source
var AccountManagementV1IdentificationOAuthSchema = validation.NewSimpleSchema(`
	{
		"type": "object",
		"properties": {
			"token": {
				"type": "string",
				"minLength": 1
			},
			"query": {
				"type": "string",
				"minLength": 1
			}
		},
		"required": ["token", "query"]
	}
`)
View Source
var AccountManagementV1IdentificationSchema = validation.NewSimpleSchema(`
	{
		"type": "object",
		"properties": {
			"identification": {
				"type": "string",
				"const": "oauth"
			},
			"alias": {
				"type": "string",
				"minLength": 1
			},
			"redirect_uri": {
				"type": "string",
				"format": "uri"
			},
			"exclude_state_in_authorization_url": {
				"type": "boolean"
			}
		},
		"required": ["identification", "alias", "redirect_uri"]
	}
`)
View Source
var AnonymousUserPromotionCodeAPIRequestSchema = validation.NewSimpleSchema(`
	{
		"type": "object",
		"additionalProperties": false,
		"properties": {
			"session_type": {
				"type": "string",
				"enum": ["cookie", "refresh_token"]
			},
			"refresh_token": { "type": "string" }
		},
		"required": ["session_type"]
	}
`)
View Source
var AnonymousUserPromotionCodeResponseSchema = validation.NewSimpleSchema(`
	{
		"type": "object",
		"properties": {
			"promotion_code": { "type": "string" },
			"expire_at": { "type": "string" }
		},
		"required": ["promotion_code", "expire_at"]
	}
`)
View Source
var AnonymousUserSignupAPIRequestSchema = validation.NewSimpleSchema(`
	{
		"type": "object",
		"additionalProperties": false,
		"properties": {
			"client_id": { "type": "string" },
			"session_type": {
				"type": "string",
				"enum": ["cookie", "refresh_token"]
			},
			"refresh_token": { "type": "string" }
		},
		"required": ["session_type"],
		"allOf": [
			{
				"if": { "properties": { "session_type": { "const": "refresh_token" } } },
				"then": {
					"required": ["client_id"]
				}
			}
		]
	}
`)
View Source
var AnonymousUserSignupAPIResponseSchema = validation.NewSimpleSchema(`
	{
		"type": "object",
		"properties": {
			"token_type": { "type": "string" },
			"access_token": { "type": "string" },
			"refresh_token": { "type": "string" },
			"expires_in": { "type": "integer" }
		},
		"required": ["token_type", "access_token", "expires_in"]
	}
`)
View Source
var AuthenticationFlowV1NonRestfulCreateRequestSchema *validation.SimpleSchema
View Source
var AuthenticationFlowV1NonRestfulGetRequestSchema = validation.NewSimpleSchema(`
	{
		"type": "object",
		"properties": {
			"state_token": { "type": "string" }
		},
		"required": ["state_token"]
	}
`)
View Source
var AuthenticationFlowV1NonRestfulInputRequestSchema = validation.NewSimpleSchema(`
	{
		"type": "object",
		"required": [],
		"properties": {
			"state_token": { "type": "string" }
		},
		"oneOf": [
			{
				"properties": {
					"input": {
						"type": "object"
					}
				},
				"required": ["input"]
			},
			{
				"properties": {
					"batch_input": {
						"type": "array",
						"items": {
							"type": "object"
						},
						"minItems": 1
					}
				},
				"required": ["batch_input"]
			}
		]
	}
`)
View Source
var WorkflowInputRequestSchema = validation.NewSimpleSchema(`
	{
		"type": "object",
		"additionalProperties": false,
		"properties": {
			"input": {
				"type": "object",
				"properties": {
					"kind": { "type": "string" },
					"data": { "type": "object" }
				},
				"required": ["kind", "data"]
			}
		},
		"required": ["input"]
	}
`)
View Source
var WorkflowNewRequestSchema = validation.NewSimpleSchema(`
	{
		"type": "object",
		"additionalProperties": false,
		"properties": {
			"intent": {
				"type": "object",
				"properties": {
					"kind": { "type": "string" },
					"data": { "type": "object" }
				},
				"required": ["kind", "data"]
			},
			"bind_user_agent": { "type": "boolean" }
		},
		"required": ["intent"]
	}
`)
View Source
var WorkflowV2RequestSchema = validation.NewSimpleSchema(`
	{
		"type": "object",
		"properties": {
			"action": {
				"enum": ["create", "input", "batch_input", "get"]
			}
		},
		"required": ["action"],
		"allOf": [
			{
				"if": {
					"properties": {
						"action": { "const": "create" }
					},
					"required": ["action"]
				},
				"then": {
					"properties": {
						"url_query": { "type": "string" },
						"intent": {
							"type": "object",
							"properties": {
								"kind": { "type": "string" },
								"data": { "type": "object" }
							},
							"required": ["kind", "data"]
						},
						"bind_user_agent": { "type": "boolean" },
						"batch_input": {
							"type": "array",
							"items": {
								"type": "object",
								"properties": {
									"kind": { "type": "string" },
									"data": { "type": "object" }
								},
								"required": ["kind", "data"]
							}
						}
					},
					"required": ["intent"]
				}
			},
			{
				"if": {
					"properties": {
						"action": { "const": "input" }
					},
					"required": ["action"]
				},
				"then": {
					"properties": {
						"workflow_id": { "type": "string" },
						"instance_id": { "type": "string" },
						"input": {
							"type": "object",
							"properties": {
								"kind": { "type": "string" },
								"data": { "type": "object" }
							},
							"required": ["kind", "data"]
						}
					},
					"required": ["workflow_id", "instance_id", "input"]
				}
			},
			{
				"if": {
					"properties": {
						"action": { "const": "batch_input" }
					},
					"required": ["action"]
				},
				"then": {
					"properties": {
						"workflow_id": { "type": "string" },
						"instance_id": { "type": "string" },
						"batch_input": {
							"type": "array",
							"items": {
								"type": "object",
								"properties": {
									"kind": { "type": "string" },
									"data": { "type": "object" }
								},
								"required": ["kind", "data"]
							},
							"minItems": 1
						}
					},
					"required": ["workflow_id", "instance_id", "batch_input"]
				}
			},
			{
				"if": {
					"properties": {
						"action": { "const": "get" }
					},
					"required": ["action"]
				},
				"then": {
					"properties": {
						"workflow_id": { "type": "string" },
						"instance_id": { "type": "string" }
					},
					"required": ["workflow_id", "instance_id"]
				}
			}
		]
	}
`)

Functions

func ConfigureAccountManagementV1IdentificationOAuthRoute

func ConfigureAccountManagementV1IdentificationOAuthRoute(route httproute.Route) httproute.Route

func ConfigureAccountManagementV1IdentificationRoute

func ConfigureAccountManagementV1IdentificationRoute(route httproute.Route) httproute.Route

func ConfigureAnonymousUserPromotionCodeRoute

func ConfigureAnonymousUserPromotionCodeRoute(route httproute.Route) httproute.Route

func ConfigureAnonymousUserSignupRoute

func ConfigureAnonymousUserSignupRoute(route httproute.Route) httproute.Route

func ConfigureAuthenticationFlowV1CreateRoute

func ConfigureAuthenticationFlowV1CreateRoute(route httproute.Route) httproute.Route

func ConfigureAuthenticationFlowV1GetRoute

func ConfigureAuthenticationFlowV1GetRoute(route httproute.Route) httproute.Route

func ConfigureAuthenticationFlowV1InputRoute

func ConfigureAuthenticationFlowV1InputRoute(route httproute.Route) httproute.Route

func ConfigureAuthenticationFlowV1WebsocketRoute

func ConfigureAuthenticationFlowV1WebsocketRoute(route httproute.Route) httproute.Route

func ConfigurePresignImagesUploadRoute

func ConfigurePresignImagesUploadRoute(route httproute.Route) httproute.Route

func ConfigureWorkflowGetRoute

func ConfigureWorkflowGetRoute(route httproute.Route) httproute.Route

func ConfigureWorkflowInputRoute

func ConfigureWorkflowInputRoute(route httproute.Route) httproute.Route

func ConfigureWorkflowNewRoute

func ConfigureWorkflowNewRoute(route httproute.Route) httproute.Route

func ConfigureWorkflowV2Route

func ConfigureWorkflowV2Route(route httproute.Route) httproute.Route

func ConfigureWorkflowWebsocketRoute

func ConfigureWorkflowWebsocketRoute(route httproute.Route) httproute.Route

func PresignImageUploadRequestBucketSpec

func PresignImageUploadRequestBucketSpec(userID string) ratelimit.BucketSpec

Types

type AccountManagementV1IdentificationHandler

type AccountManagementV1IdentificationHandler struct {
	JSON    JSONResponseWriter
	Service AccountManagementV1IdentificationHandlerService
}

func (*AccountManagementV1IdentificationHandler) ServeHTTP

type AccountManagementV1IdentificationHandlerService

type AccountManagementV1IdentificationHandlerService interface {
	StartAdding(ctx context.Context, input *accountmanagement.StartAddingInput) (*accountmanagement.StartAddingOutput, error)
}

type AccountManagementV1IdentificationOAuthHandler

type AccountManagementV1IdentificationOAuthHandler struct {
	JSON    JSONResponseWriter
	Service AccountManagementV1IdentificationOAuthHandlerService
}

func (*AccountManagementV1IdentificationOAuthHandler) ServeHTTP

type AccountManagementV1IdentificationOAuthHandlerService

type AccountManagementV1IdentificationOAuthHandlerService interface {
	FinishAdding(ctx context.Context, input *accountmanagement.FinishAddingInput) (*accountmanagement.FinishAddingOutput, error)
}

type AccountManagementV1IdentificationOAuthRequest

type AccountManagementV1IdentificationOAuthRequest struct {
	Token string `json:"token,omitempty"`
	Query string `json:"query,omitempty"`
}

type AccountManagementV1IdentificationRequest

type AccountManagementV1IdentificationRequest struct {
	Identification                 string `json:"identification,omitempty"`
	Alias                          string `json:"alias,omitempty"`
	RedirectURI                    string `json:"redirect_uri,omitempty"`
	ExcludeStateInAuthorizationURL *bool  `json:"exclude_state_in_authorization_url,omitempty"`
}

type AnonymousUserHandler

type AnonymousUserHandler interface {
	SignupAnonymousUser(
		ctx context.Context,
		req *http.Request,
		clientID string,
		sessionType oauthhandler.WebSessionType,
		refreshToken string,
	) (*oauthhandler.SignupAnonymousUserResult, error)
}

type AnonymousUserPromotionCodeAPIHandler

type AnonymousUserPromotionCodeAPIHandler struct {
	Logger         AnonymousUserPromotionCodeAPIHandlerLogger
	Database       *appdb.Handle
	JSON           JSONResponseWriter
	PromotionCodes PromotionCodeIssuer
}

func (*AnonymousUserPromotionCodeAPIHandler) ServeHTTP

type AnonymousUserPromotionCodeAPIHandlerLogger

type AnonymousUserPromotionCodeAPIHandlerLogger struct{ *log.Logger }

type AnonymousUserPromotionCodeRequest

type AnonymousUserPromotionCodeRequest struct {
	SessionType  oauthhandler.WebSessionType `json:"session_type"`
	RefreshToken string                      `json:"refresh_token"`
}

type AnonymousUserPromotionCodeResponse

type AnonymousUserPromotionCodeResponse struct {
	PromotionCode string    `json:"promotion_code"`
	ExpireAt      time.Time `json:"expire_at"`
}

type AnonymousUserSignupAPIHandler

type AnonymousUserSignupAPIHandler struct {
	Logger               AnonymousUserSignupAPIHandlerLogger
	Database             *appdb.Handle
	JSON                 JSONResponseWriter
	AnonymousUserHandler AnonymousUserHandler
}

func (*AnonymousUserSignupAPIHandler) ServeHTTP

type AnonymousUserSignupAPIHandlerLogger

type AnonymousUserSignupAPIHandlerLogger struct{ *log.Logger }

func NewAnonymousUserSignupAPIHandlerLogger

func NewAnonymousUserSignupAPIHandlerLogger(lf *log.Factory) AnonymousUserSignupAPIHandlerLogger

type AnonymousUserSignupAPIRequest

type AnonymousUserSignupAPIRequest struct {
	ClientID     string                      `json:"client_id"`
	SessionType  oauthhandler.WebSessionType `json:"session_type"`
	RefreshToken string                      `json:"refresh_token"`
}

type AuthenticationFlowV1CookieManager

type AuthenticationFlowV1CookieManager interface {
	GetCookie(r *http.Request, def *httputil.CookieDef) (*http.Cookie, error)
	ClearCookie(def *httputil.CookieDef) *http.Cookie
	ValueCookie(def *httputil.CookieDef, value string) *http.Cookie
}

type AuthenticationFlowV1CreateHandler

type AuthenticationFlowV1CreateHandler struct {
	LoggerFactory  *log.Factory
	RedisHandle    *appredis.Handle
	JSON           JSONResponseWriter
	Cookies        AuthenticationFlowV1CookieManager
	Workflows      AuthenticationFlowV1WorkflowService
	OAuthSessions  AuthenticationFlowV1OAuthSessionService
	UIInfoResolver AuthenticationFlowV1UIInfoResolver
}

func (*AuthenticationFlowV1CreateHandler) ServeHTTP

type AuthenticationFlowV1GetHandler

type AuthenticationFlowV1GetHandler struct {
	LoggerFactory *log.Factory
	RedisHandle   *appredis.Handle
	JSON          JSONResponseWriter
	Workflows     AuthenticationFlowV1WorkflowService
}

func (*AuthenticationFlowV1GetHandler) ServeHTTP

type AuthenticationFlowV1InputHandler

type AuthenticationFlowV1InputHandler struct {
	LoggerFactory *log.Factory
	RedisHandle   *appredis.Handle
	JSON          JSONResponseWriter
	Cookies       AuthenticationFlowV1CookieManager
	Workflows     AuthenticationFlowV1WorkflowService
}

func (*AuthenticationFlowV1InputHandler) ServeHTTP

type AuthenticationFlowV1NonRestfulCreateRequest

type AuthenticationFlowV1NonRestfulCreateRequest struct {
	Type       authflow.FlowType `json:"type,omitempty"`
	Name       string            `json:"name,omitempty"`
	URLQuery   string            `json:"url_query,omitempty"`
	BatchInput []json.RawMessage `json:"batch_input,omitempty"`
}

func (*AuthenticationFlowV1NonRestfulCreateRequest) GetFlowReference

type AuthenticationFlowV1NonRestfulGetRequest

type AuthenticationFlowV1NonRestfulGetRequest struct {
	StateToken string `json:"state_token,omitempty"`
}

type AuthenticationFlowV1NonRestfulInputRequest

type AuthenticationFlowV1NonRestfulInputRequest struct {
	StateToken string            `json:"state_token,omitempty"`
	Input      json.RawMessage   `json:"input,omitempty"`
	BatchInput []json.RawMessage `json:"batch_input,omitempty"`
}

type AuthenticationFlowV1OAuthSessionService

type AuthenticationFlowV1OAuthSessionService interface {
	Get(ctx context.Context, entryID string) (*oauthsession.Entry, error)
}

type AuthenticationFlowV1UIInfoResolver

type AuthenticationFlowV1UIInfoResolver interface {
	GetOAuthSessionID(req *http.Request, urlQuery string) (string, bool)
	RemoveOAuthSessionID(w http.ResponseWriter, r *http.Request)
	ResolveForUI(ctx context.Context, r protocol.AuthorizationRequest) (*oidc.UIInfo, error)
}

type AuthenticationFlowV1WebsocketEventStore

type AuthenticationFlowV1WebsocketEventStore interface {
	ChannelName(websocketChannelName string) string
}

type AuthenticationFlowV1WebsocketHandler

type AuthenticationFlowV1WebsocketHandler struct {
	LoggerFactory *log.Factory
	RedisHandle   *appredis.Handle
	OriginMatcher AuthenticationFlowV1WebsocketOriginMatcher
	Events        AuthenticationFlowV1WebsocketEventStore
}

func (*AuthenticationFlowV1WebsocketHandler) Accept

func (*AuthenticationFlowV1WebsocketHandler) OnRedisSubscribe

func (h *AuthenticationFlowV1WebsocketHandler) OnRedisSubscribe(r *http.Request) error

func (*AuthenticationFlowV1WebsocketHandler) ServeHTTP

type AuthenticationFlowV1WebsocketOriginMatcher

type AuthenticationFlowV1WebsocketOriginMatcher interface {
	PrepareOriginMatcher(r *http.Request) (*originmatcher.T, error)
}

type AuthenticationFlowV1WorkflowService

type AuthenticationFlowV1WorkflowService interface {
	CreateNewFlow(ctx context.Context, intent authflow.PublicFlow, sessionOptions *authflow.SessionOptions) (*authflow.ServiceOutput, error)
	Get(ctx context.Context, stateToken string) (*authflow.ServiceOutput, error)
	FeedInput(ctx context.Context, stateToken string, rawMessage json.RawMessage) (*authflow.ServiceOutput, error)
}

type JSONResponseWriter

type JSONResponseWriter interface {
	WriteResponse(rw http.ResponseWriter, resp *api.Response)
}

type PresignImagesUploadHandler

type PresignImagesUploadHandler struct {
	Turbo           TurboResponseWriter
	HTTPProto       httputil.HTTPProto
	HTTPHost        httputil.HTTPHost
	AppID           config.AppID
	RateLimiter     RateLimiter
	PresignProvider PresignProvider
	Logger          PresignImagesUploadHandlerLogger
}

func (*PresignImagesUploadHandler) ServeHTTP

func (h *PresignImagesUploadHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request)

type PresignImagesUploadHandlerLogger

type PresignImagesUploadHandlerLogger struct{ *log.Logger }

func NewPresignImagesUploadHandlerLogger

func NewPresignImagesUploadHandlerLogger(lf *log.Factory) PresignImagesUploadHandlerLogger

type PresignImagesUploadResponse

type PresignImagesUploadResponse struct {
	UploadURL string `json:"upload_url"`
}

type PresignProvider

type PresignProvider interface {
	PresignPostRequest(url *url.URL) error
}

type PromotionCodeIssuer

type PromotionCodeIssuer interface {
	IssuePromotionCode(
		ctx context.Context,
		req *http.Request,
		sessionType oauthhandler.WebSessionType,
		refreshToken string,
	) (code string, codeObj *anonymous.PromotionCode, err error)
}

type RateLimiter

type RateLimiter interface {
	Allow(ctx context.Context, spec ratelimit.BucketSpec) (*ratelimit.FailedReservation, error)
}

type TurboResponseWriter

type TurboResponseWriter interface {
	WriteResponse(rw http.ResponseWriter, req *http.Request, resp *api.Response)
}

type WorkflowGetCookieManager

type WorkflowGetCookieManager interface {
	GetCookie(r *http.Request, def *httputil.CookieDef) (*http.Cookie, error)
	ValueCookie(def *httputil.CookieDef, value string) *http.Cookie
}

type WorkflowGetHandler

type WorkflowGetHandler struct {
	JSON      JSONResponseWriter
	Workflows WorkflowGetWorkflowService
	Cookies   WorkflowGetCookieManager
}

func (*WorkflowGetHandler) ServeHTTP

func (h *WorkflowGetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WorkflowGetWorkflowService

type WorkflowGetWorkflowService interface {
	Get(ctx context.Context, workflowID string, instanceID string, userAgentID string) (*workflow.ServiceOutput, error)
}

type WorkflowInputCookieManager

type WorkflowInputCookieManager interface {
	GetCookie(r *http.Request, def *httputil.CookieDef) (*http.Cookie, error)
	ValueCookie(def *httputil.CookieDef, value string) *http.Cookie
}

type WorkflowInputHandler

type WorkflowInputHandler struct {
	JSON      JSONResponseWriter
	Workflows WorkflowInputWorkflowService
	Cookies   WorkflowNewCookieManager
}

func (*WorkflowInputHandler) ServeHTTP

func (h *WorkflowInputHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WorkflowInputRequest

type WorkflowInputRequest struct {
	Input workflow.InputJSON `json:"input"`
}

type WorkflowInputWorkflowService

type WorkflowInputWorkflowService interface {
	Get(ctx context.Context, workflowID string, instanceID string, userAgentID string) (*workflow.ServiceOutput, error)
	FeedInput(ctx context.Context, workflowID string, instanceID string, userAgentID string, input workflow.Input) (*workflow.ServiceOutput, error)
}

type WorkflowNewCookieManager

type WorkflowNewCookieManager interface {
	GetCookie(r *http.Request, def *httputil.CookieDef) (*http.Cookie, error)
	ClearCookie(def *httputil.CookieDef) *http.Cookie
	ValueCookie(def *httputil.CookieDef, value string) *http.Cookie
}

type WorkflowNewHandler

type WorkflowNewHandler struct {
	JSON           JSONResponseWriter
	Cookies        WorkflowNewCookieManager
	Workflows      WorkflowNewWorkflowService
	OAuthSessions  WorkflowNewOAuthSessionService
	UIInfoResolver WorkflowNewUIInfoResolver
}

func (*WorkflowNewHandler) ServeHTTP

func (h *WorkflowNewHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WorkflowNewOAuthSessionService

type WorkflowNewOAuthSessionService interface {
	Get(ctx context.Context, entryID string) (*oauthsession.Entry, error)
}

type WorkflowNewRequest

type WorkflowNewRequest struct {
	Intent        workflow.IntentJSON `json:"intent"`
	BindUserAgent *bool               `json:"bind_user_agent"`
}

func (*WorkflowNewRequest) SetDefaults

func (c *WorkflowNewRequest) SetDefaults()

type WorkflowNewUIInfoResolver

type WorkflowNewUIInfoResolver interface {
	GetOAuthSessionIDLegacy(req *http.Request, urlQuery string) (string, bool)
	RemoveOAuthSessionID(w http.ResponseWriter, r *http.Request)
	ResolveForUI(ctx context.Context, r protocol.AuthorizationRequest) (*oidc.UIInfo, error)
}

type WorkflowNewWorkflowService

type WorkflowNewWorkflowService interface {
	CreateNewWorkflow(ctx context.Context, intent workflow.Intent, sessionOptions *workflow.SessionOptions) (*workflow.ServiceOutput, error)
}

type WorkflowResponse

type WorkflowResponse struct {
	Action   *workflow.WorkflowAction `json:"action"`
	Workflow *workflow.WorkflowOutput `json:"workflow"`
}

type WorkflowUserAgentCookieManager

type WorkflowUserAgentCookieManager interface {
	GetCookie(r *http.Request, def *httputil.CookieDef) (*http.Cookie, error)
	ValueCookie(def *httputil.CookieDef, value string) *http.Cookie
}

type WorkflowV2Action

type WorkflowV2Action string
const (
	WorkflowV2ActionCreate     WorkflowV2Action = "create"
	WorkflowV2ActionInput      WorkflowV2Action = "input"
	WorkflowV2ActionGet        WorkflowV2Action = "get"
	WorkflowV2ActionBatchInput WorkflowV2Action = "batch_input"
)

type WorkflowV2CookieManager

type WorkflowV2CookieManager interface {
	GetCookie(r *http.Request, def *httputil.CookieDef) (*http.Cookie, error)
	ClearCookie(def *httputil.CookieDef) *http.Cookie
	ValueCookie(def *httputil.CookieDef, value string) *http.Cookie
}

type WorkflowV2Handler

type WorkflowV2Handler struct {
	JSON           JSONResponseWriter
	Cookies        WorkflowV2CookieManager
	Workflows      WorkflowV2WorkflowService
	OAuthSessions  WorkflowV2OAuthSessionService
	UIInfoResolver WorkflowV2UIInfoResolver
}

func (*WorkflowV2Handler) ServeHTTP

func (h *WorkflowV2Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WorkflowV2OAuthSessionService

type WorkflowV2OAuthSessionService interface {
	Get(ctx context.Context, entryID string) (*oauthsession.Entry, error)
}

type WorkflowV2Request

type WorkflowV2Request struct {
	Action WorkflowV2Action `json:"action"`

	// Create
	URLQuery      string               `json:"url_query,omitempty"`
	Intent        *workflow.IntentJSON `json:"intent,omitempty"`
	BindUserAgent *bool                `json:"bind_user_agent,omitempty"`

	// Input, Get, or BatchInput
	WorkflowID string `json:"workflow_id,omitempty"`
	InstanceID string `json:"instance_id,omitempty"`

	// Input
	Input *workflow.InputJSON `json:"input,omitempty"`

	// BatchInput, or Create
	BatchInput []*workflow.InputJSON `json:"batch_input,omitempty"`
}

func (*WorkflowV2Request) SetDefaults

func (r *WorkflowV2Request) SetDefaults()

type WorkflowV2UIInfoResolver

type WorkflowV2UIInfoResolver interface {
	GetOAuthSessionIDLegacy(req *http.Request, urlQuery string) (string, bool)
	RemoveOAuthSessionID(w http.ResponseWriter, r *http.Request)
	ResolveForUI(ctx context.Context, r protocol.AuthorizationRequest) (*oidc.UIInfo, error)
}

type WorkflowV2WorkflowService

type WorkflowV2WorkflowService interface {
	CreateNewWorkflow(ctx context.Context, intent workflow.Intent, sessionOptions *workflow.SessionOptions) (*workflow.ServiceOutput, error)
	Get(ctx context.Context, workflowID string, instanceID string, userAgentID string) (*workflow.ServiceOutput, error)
	FeedInput(ctx context.Context, workflowID string, instanceID string, userAgentID string, input workflow.Input) (*workflow.ServiceOutput, error)
}

type WorkflowWebsocketEventStore

type WorkflowWebsocketEventStore interface {
	ChannelName(ctx context.Context, workflowID string) (string, error)
}

type WorkflowWebsocketHandler

type WorkflowWebsocketHandler struct {
	Events        WorkflowWebsocketEventStore
	LoggerFactory *log.Factory
	RedisHandle   *appredis.Handle
	OriginMatcher WorkflowWebsocketOriginMatcher
}

func (*WorkflowWebsocketHandler) Accept

func (*WorkflowWebsocketHandler) OnRedisSubscribe

func (h *WorkflowWebsocketHandler) OnRedisSubscribe(r *http.Request) error

func (*WorkflowWebsocketHandler) ServeHTTP

type WorkflowWebsocketOriginMatcher

type WorkflowWebsocketOriginMatcher interface {
	PrepareOriginMatcher(r *http.Request) (*originmatcher.T, error)
}

Jump to

Keyboard shortcuts

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