controller

package
v1.9.17 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: AGPL-3.0 Imports: 66 Imported by: 0

Documentation

Overview

Package controller provides HTTP handlers for plugin management operations

Index

Constants

This section is empty.

Variables

View Source
var AfterPublicAPI func(host, projectID, userID, protocol string)

AfterPublicAPI is nil in the public engine. A cloud build may set it. The host is the request host. This function does not open a connection.

Functions

func ApplyDBConfigFromMap added in v1.6.0

func ApplyDBConfigFromMap(d *models.DriverCredentials, dbConfig map[string]interface{})

ApplyDBConfigFromMap merges db_config map values into driver credentials (open-core fields only).

func CaptureInternalServerError

func CaptureInternalServerError(err error, scopes map[string]interface{}) error

func DatabaseCheckCore added in v1.6.0

func DatabaseCheckCore(a *AuthController, c echo.Context, req *DatabaseRequest) error

DatabaseCheckCore runs open-core database connectivity checks (Mongo, SQL family, coredb). Pro wraps this for hosted providers.

func DatabaseCheckPort added in v1.6.0

func DatabaseCheckPort(v interface{}, defaultPort string) string

DatabaseCheckPort coerces JSON port values for database check requests.

func GetFieldByType

func GetFieldByType(name string, inputType string, fieldType string, validation *models.Validation, argType string, update bool) interface{}

Types

type AuthController added in v1.6.0

type AuthController struct {
	Cfg *models.Config
	// contains filtered or unexported fields
}

func GetAuthController

func GetAuthController(cfg *models.Config, commonFn *resolver.GraphQLServer) *AuthController

func (*AuthController) AdminResetPasswordV2 added in v1.6.0

func (a *AuthController) AdminResetPasswordV2(c echo.Context) error

AdminResetPasswordV2 handles POST /admin/reset-password. Requires APITO_ADMIN_RESET_SECRET in request body and config.

func (*AuthController) CLICapabilities added in v1.9.0

func (a *AuthController) CLICapabilities(c echo.Context) error

func (*AuthController) CLILoginApprove added in v1.9.0

func (a *AuthController) CLILoginApprove(c echo.Context) error

func (*AuthController) CLILoginPoll added in v1.9.0

func (a *AuthController) CLILoginPoll(c echo.Context) error

func (*AuthController) CLILoginStart added in v1.9.0

func (a *AuthController) CLILoginStart(c echo.Context) error

func (*AuthController) CLILoginVerify added in v1.9.0

func (a *AuthController) CLILoginVerify(c echo.Context) error

func (*AuthController) CSVTempGen added in v1.6.0

func (a *AuthController) CSVTempGen(c echo.Context) error

func (*AuthController) ChangePasswordV2 added in v1.6.0

func (a *AuthController) ChangePasswordV2(c echo.Context) error

func (*AuthController) CreateAccessToken added in v1.8.0

func (a *AuthController) CreateAccessToken(c echo.Context) error

CreateAccessToken mints a new apt_ token (reveal once).

func (*AuthController) DatabaseCheck added in v1.6.0

func (a *AuthController) DatabaseCheck(c echo.Context) error

func (*AuthController) DeleteSyncToken added in v1.6.0

func (a *AuthController) DeleteSyncToken(c echo.Context) error

func (*AuthController) DemoProjectSwitch added in v1.6.0

func (a *AuthController) DemoProjectSwitch(c echo.Context) error

func (*AuthController) ForgetPasswordConfirmedV2 added in v1.6.0

func (a *AuthController) ForgetPasswordConfirmedV2(c echo.Context) error

func (*AuthController) ForgetPasswordRequestV2 added in v1.6.0

func (a *AuthController) ForgetPasswordRequestV2(c echo.Context) error

func (*AuthController) GenerateSyncToken added in v1.6.0

func (a *AuthController) GenerateSyncToken(c echo.Context) error

func (*AuthController) GetAccessTokenMe added in v1.8.12

func (a *AuthController) GetAccessTokenMe(c echo.Context) error

GetAccessTokenMe self-introspects the Bearer apt_ access token (AccessTokenPublic). Console session / ak_ callers get 400 — this endpoint is for apt_ principals only. Never accepts another token id/secret; never returns the raw secret.

func (*AuthController) GetProfile added in v1.6.0

func (a *AuthController) GetProfile(c echo.Context) error

func (*AuthController) GetProjectUserIdentity added in v1.9.0

func (a *AuthController) GetProjectUserIdentity(c echo.Context) error

GetProjectUserIdentity verifies an app-user bearer and returns only the server-derived identity needed by a trusted BFF. Bootstrap project keys and apt_ operator credentials are rejected by ValidateAppUserFunctionBearer. Client-supplied identity headers are intentionally ignored.

func (*AuthController) Journey added in v1.6.0

func (a *AuthController) Journey(c echo.Context) error

func (*AuthController) ListAccessTokenCatalog added in v1.8.0

func (a *AuthController) ListAccessTokenCatalog(c echo.Context) error

ListAccessTokenCatalog returns capability registry + presets for Console.

func (*AuthController) ListAccessTokens added in v1.8.0

func (a *AuthController) ListAccessTokens(c echo.Context) error

ListAccessTokens returns public inventory for the current system user.

func (*AuthController) ListAdministrableProjects added in v1.8.0

func (a *AuthController) ListAdministrableProjects(c echo.Context) error

ListAdministrableProjects returns projects the issuer can currently administer (for "all projects" preview).

func (*AuthController) ListSyncTokens added in v1.6.0

func (a *AuthController) ListSyncTokens(c echo.Context) error

func (*AuthController) LoginV2 added in v1.6.0

func (a *AuthController) LoginV2(c echo.Context) error

func (*AuthController) LogoutV2 added in v1.6.0

func (a *AuthController) LogoutV2(c echo.Context) error

func (*AuthController) MCPLoginApprove added in v1.9.0

func (a *AuthController) MCPLoginApprove(c echo.Context) error

func (*AuthController) MCPLoginPoll added in v1.9.0

func (a *AuthController) MCPLoginPoll(c echo.Context) error

func (*AuthController) MCPLoginStart added in v1.9.0

func (a *AuthController) MCPLoginStart(c echo.Context) error

func (*AuthController) MCPLoginVerify added in v1.9.0

func (a *AuthController) MCPLoginVerify(c echo.Context) error

func (*AuthController) MountRemoteMCP added in v1.9.0

func (a *AuthController) MountRemoteMCP(e *echo.Echo, authorize echo.MiddlewareFunc) error

MountRemoteMCP registers the URL-only MCP OAuth and Streamable HTTP routes on the existing engine router.

func (*AuthController) ProjectCreation added in v1.6.0

func (a *AuthController) ProjectCreation(c echo.Context) error

func (*AuthController) ProjectDelete added in v1.6.0

func (a *AuthController) ProjectDelete(c echo.Context) error

func (*AuthController) ProjectList added in v1.6.0

func (a *AuthController) ProjectList(c echo.Context) error

func (*AuthController) ProjectNameCheck added in v1.6.0

func (a *AuthController) ProjectNameCheck(c echo.Context) error

func (*AuthController) ProjectSwitchV2 added in v1.6.0

func (a *AuthController) ProjectSwitchV2(c echo.Context) error

func (*AuthController) RegisterV2 added in v1.6.0

func (a *AuthController) RegisterV2(c echo.Context) error

func (*AuthController) RevokeAccessToken added in v1.8.0

func (a *AuthController) RevokeAccessToken(c echo.Context) error

RevokeAccessToken revokes by id (preferred) or raw token.

func (*AuthController) RotateAccessToken added in v1.8.0

func (a *AuthController) RotateAccessToken(c echo.Context) error

RotateAccessToken issues a replacement secret with the same grants.

func (*AuthController) SyncProject added in v1.6.0

func (a *AuthController) SyncProject(c echo.Context) error

func (*AuthController) UpdateProfile added in v1.6.0

func (a *AuthController) UpdateProfile(c echo.Context) error

func (*AuthController) VerifyV2 added in v1.6.0

func (a *AuthController) VerifyV2(c echo.Context) error

type DatabaseRequest added in v1.0.7

type DatabaseRequest struct {
	File     string      `json:"file"`
	Type     string      `json:"type"`
	Host     string      `json:"host"`
	Port     interface{} `json:"port"`
	Database string      `json:"database"`
	Username string      `json:"username"`
	Password string      `json:"password"`
	SSLMode  string      `json:"ssl_mode"`
}

type FilesController added in v1.7.0

type FilesController struct {
	Cfg *models.Config

	Storage func(project *models.Project, cfg *models.Config) (ObjectUploader, error)
	// contains filtered or unexported fields
}

FilesController handles /secured/files REST endpoints.

func NewFilesController added in v1.7.0

func NewFilesController(cfg *models.Config, server *resolver.GraphQLServer) *FilesController

NewFilesController creates a FilesController with default S3 storage factory.

func (*FilesController) Delete added in v1.7.0

func (fc *FilesController) Delete(c echo.Context) error

Delete handles POST /secured/files/delete.

func (*FilesController) List added in v1.7.0

func (fc *FilesController) List(c echo.Context) error

List handles GET /secured/files/list.

func (*FilesController) Upload added in v1.7.0

func (fc *FilesController) Upload(c echo.Context) error

Upload handles POST /secured/files/upload (multipart field "file", optional "file_type").

type GraphCtrl

type GraphCtrl struct {
	// contains filtered or unexported fields
}

func GetGraphQLController

func GetGraphQLController(cfg *models.Config, commonFn *resolver.GraphQLServer) *GraphCtrl

func (*GraphCtrl) FunctionExecute

func (g *GraphCtrl) FunctionExecute(c echo.Context) error

func (*GraphCtrl) GetGraphQLAggregateField

func (g *GraphCtrl) GetGraphQLAggregateField(name string, field *models.FieldInfo, update bool) *graphql.Field

func (*GraphCtrl) GetGraphQLArgumentObjectField

func (g *GraphCtrl) GetGraphQLArgumentObjectField(name string, field *models.FieldInfo, update bool) *graphql.InputObjectFieldConfig

func (*GraphCtrl) GetGraphQLField

func (g *GraphCtrl) GetGraphQLField(name string, field *models.FieldInfo, update bool) *graphql.Field

func (*GraphCtrl) GetSystemCacheInfo

func (g *GraphCtrl) GetSystemCacheInfo(i echo.Context) error

func (*GraphCtrl) IssueSubscriptionTicket added in v1.9.7

func (g *GraphCtrl) IssueSubscriptionTicket(c echo.Context) error

IssueSubscriptionTicket returns a 30-second ticket for browser sockets that cannot set the Authorization header. The raw credential never goes in the URL.

func (*GraphCtrl) PluginUpload

func (g *GraphCtrl) PluginUpload(router echo.Context) error

func (*GraphCtrl) PublicGraphQL

func (g *GraphCtrl) PublicGraphQL(i echo.Context) error

func (*GraphCtrl) PublicSubscriptionWrapHandler added in v1.7.0

func (g *GraphCtrl) PublicSubscriptionWrapHandler(c echo.Context) error

PublicSubscriptionWrapHandler serves per-project public GraphQL subscriptions. A WebSocket upgrade streams <model>Changed and broadcast. A normal POST runs the same schema so the console explorer can introspect it.

func (*GraphCtrl) RESTApiDocGenerator

func (g *GraphCtrl) RESTApiDocGenerator(c echo.Context) error

func (*GraphCtrl) RedeemSubscriptionTicket added in v1.9.7

func (g *GraphCtrl) RedeemSubscriptionTicket(next echo.HandlerFunc) echo.HandlerFunc

RedeemSubscriptionTicket copies a one-time web ticket onto the request before Authorize runs. Mobile clients send normal headers and skip this.

func (*GraphCtrl) RestToGraphQL

func (g *GraphCtrl) RestToGraphQL(c echo.Context) error

func (*GraphCtrl) SubscriptionWrapHandler

func (g *GraphCtrl) SubscriptionWrapHandler(c echo.Context) error

func (*GraphCtrl) SystemGraphQL

func (g *GraphCtrl) SystemGraphQL(i echo.Context) error

func (*GraphCtrl) SystemHealth added in v1.2.1

func (g *GraphCtrl) SystemHealth(c echo.Context) error

type ObjectUploader added in v1.7.0

type ObjectUploader interface {
	Upload(ctx context.Context, key string, body io.Reader, contentType string, size int64) (publicURL string, err error)
	DeleteObjects(ctx context.Context, keys []string) (failed []string, err error)
}

ObjectUploader uploads and deletes blobs in project storage (injectable for tests).

type PaymentController added in v1.9.7

type PaymentController struct {
	Server *resolver.GraphQLServer
}

PaymentController exposes the provider-neutral OSS payment routes.

func NewPaymentController added in v1.9.7

func NewPaymentController(server *resolver.GraphQLServer) *PaymentController

func (*PaymentController) Callback added in v1.9.7

func (pc *PaymentController) Callback(c echo.Context) error

func (*PaymentController) Checkout added in v1.9.7

func (pc *PaymentController) Checkout(c echo.Context) error

func (*PaymentController) GetTransaction added in v1.9.7

func (pc *PaymentController) GetTransaction(c echo.Context) error

func (*PaymentController) List added in v1.9.7

func (pc *PaymentController) List(c echo.Context) error

func (*PaymentController) Proceed added in v1.9.12

func (pc *PaymentController) Proceed(c echo.Context) error

Proceed calls the provider for a prepared row and sends the browser to its page.

func (*PaymentController) Providers added in v1.9.7

func (pc *PaymentController) Providers(c echo.Context) error

func (*PaymentController) Reconcile added in v1.9.7

func (pc *PaymentController) Reconcile(c echo.Context) error

func (*PaymentController) Review added in v1.9.12

func (pc *PaymentController) Review(c echo.Context) error

Review is the public page the shopper opens before the provider is called. The HTML comes from the plugin that registered this provider.

func (*PaymentController) Webhook added in v1.9.7

func (pc *PaymentController) Webhook(c echo.Context) error

type PlatformInfo added in v1.2.0

type PlatformInfo struct {
	OS           string `json:"os"`
	Architecture string `json:"architecture"`
	Version      string `json:"version"`
	Hostname     string `json:"hostname"`
}

PlatformInfo represents server platform information

type PlatformResponse added in v1.2.0

type PlatformResponse struct {
	Success  bool         `json:"success"`
	Message  string       `json:"message"`
	Platform PlatformInfo `json:"platform"`
}

PlatformResponse represents the platform API response

type PluginListResponse added in v1.2.0

type PluginListResponse struct {
	Success bool               `json:"success"`
	Message string             `json:"message"`
	Plugins []PluginStatusInfo `json:"plugins"`
}

type PluginManifestEntry added in v1.8.21

type PluginManifestEntry struct {
	ID              string                       `json:"id"`
	Version         string                       `json:"version"`
	Title           string                       `json:"title"`
	Capabilities    []string                     `json:"capabilities"`
	Activated       bool                         `json:"activated"`
	Official        bool                         `json:"official"`
	Signed          bool                         `json:"signed"`
	Publisher       string                       `json:"publisher,omitempty"`
	BundleURL       string                       `json:"bundle_url,omitempty"`
	BundleSHA256    string                       `json:"bundle_sha256,omitempty"`
	ExtensionPoints []string                     `json:"extension_points"`
	BlockedReason   string                       `json:"blocked_reason,omitempty"`
	Contributions   *pluginService.Contributions `json:"contributions,omitempty"`
}

type PluginManifestResponse added in v1.8.21

type PluginManifestResponse struct {
	Success bool                  `json:"success"`
	Message string                `json:"message"`
	Plugins []PluginManifestEntry `json:"plugins"`
}

type PluginOperationResponse added in v1.2.0

type PluginOperationResponse struct {
	Success  bool   `json:"success"`
	Message  string `json:"message"`
	PluginID string `json:"plugin_id,omitempty"`
	Status   string `json:"status,omitempty"`
	Error    string `json:"error,omitempty"`
}

type PluginStatusInfo added in v1.2.0

type PluginStatusInfo struct {
	ID           string   `json:"id"`
	Title        string   `json:"title"`
	Version      string   `json:"version"`
	Status       string   `json:"status"` // loaded, stopped, error
	Language     string   `json:"language"`
	Type         string   `json:"type"`
	Capabilities []string `json:"capabilities"`
	Enable       bool     `json:"enable"`
	Debug        bool     `json:"debug"`
	Official     bool     `json:"official"`
	Publisher    string   `json:"publisher,omitempty"`
	Signed       bool     `json:"signed"`
	BundleURL    string   `json:"bundle_url,omitempty"`
	BundleSHA256 string   `json:"bundle_sha256,omitempty"`
	LastUpdated  string   `json:"last_updated"`
	Error        string   `json:"error,omitempty"`
}

type PluginV2Controller added in v1.2.0

type PluginV2Controller struct {
	Server *resolver.GraphQLServer
}

PluginV2Controller handles plugin management operations

func NewPluginV2Controller added in v1.2.0

func NewPluginV2Controller(server *resolver.GraphQLServer) *PluginV2Controller

NewPluginV2Controller creates a new plugin v2 controller

func (*PluginV2Controller) CreateOrUpdatePlugin added in v1.2.0

func (pc *PluginV2Controller) CreateOrUpdatePlugin(c echo.Context) error

CreateOrUpdatePlugin refuses a binary upload. Plugins install from the signed catalog.

func (*PluginV2Controller) DeletePlugin added in v1.2.0

func (pc *PluginV2Controller) DeletePlugin(c echo.Context) error

DeletePlugin removes a plugin completely

func (*PluginV2Controller) DownloadPluginArchive added in v1.9.8

func (pc *PluginV2Controller) DownloadPluginArchive(c echo.Context) error

DownloadPluginArchive streams the installed plugin directory as a zip. Secret env values in config.yml are blank unless include_secrets=true.

func (*PluginV2Controller) GetPlatformInfo added in v1.2.0

func (pc *PluginV2Controller) GetPlatformInfo(c echo.Context) error

GetPlatformInfo returns the server's platform information for compatibility checking

func (*PluginV2Controller) GetPluginCatalog added in v1.8.21

func (pc *PluginV2Controller) GetPluginCatalog(c echo.Context) error

GetPluginCatalog returns the signed registry merged with local install state.

func (*PluginV2Controller) GetPluginManifest added in v1.8.21

func (pc *PluginV2Controller) GetPluginManifest(c echo.Context) error

GetPluginManifest returns authenticated Console UI/extension metadata.

func (*PluginV2Controller) GetPluginStatus added in v1.2.0

func (pc *PluginV2Controller) GetPluginStatus(c echo.Context) error

GetPluginStatus returns the status of a specific plugin

func (*PluginV2Controller) GetPluginUI added in v1.8.21

func (pc *PluginV2Controller) GetPluginUI(c echo.Context) error

GetPluginUI serves the official signed Console bundle extracted next to the plugin binary.

func (*PluginV2Controller) InstallPlugin added in v1.8.21

func (pc *PluginV2Controller) InstallPlugin(c echo.Context) error

InstallPlugin installs a reviewed catalog plugin onto this Engine.

func (*PluginV2Controller) ListPlugins added in v1.2.0

func (pc *PluginV2Controller) ListPlugins(c echo.Context) error

ListPlugins returns the status of all plugins

func (*PluginV2Controller) RestartPlugin added in v1.2.0

func (pc *PluginV2Controller) RestartPlugin(c echo.Context) error

RestartPlugin restarts a specific plugin

func (*PluginV2Controller) StopPlugin added in v1.2.0

func (pc *PluginV2Controller) StopPlugin(c echo.Context) error

StopPlugin stops a specific plugin

func (*PluginV2Controller) UninstallPlugin added in v1.8.21

func (pc *PluginV2Controller) UninstallPlugin(c echo.Context) error

UninstallPlugin removes a system-installed plugin.

func (*PluginV2Controller) UpdatePlugin added in v1.8.21

func (pc *PluginV2Controller) UpdatePlugin(c echo.Context) error

UpdatePlugin installs the currently approved catalog version.

Directories

Path Synopsis
Package middleware provides authentication and authorization middleware for HTTP handlers
Package middleware provides authentication and authorization middleware for HTTP handlers

Jump to

Keyboard shortcuts

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