Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthInfo ¶ added in v0.9.0
type AuthInfo struct {
UserID int64 `json:"user_id"`
Username string `json:"username"`
Role string `json:"role"`
IsAdmin bool `json:"is_admin"`
}
AuthInfo carries authenticated user data through request context.
func UserFromContext ¶ added in v0.9.0
UserFromContext extracts the AuthInfo from a request context. Returns nil if the user is not authenticated.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides HTTP handlers for the admin API and templ-rendered pages.
func New ¶
func New(store config.Store, authStore auth.AuthStore, engine *auth.PolicyEngine, mem memory.Provider, db *sql.DB, linkCodes *auth.LinkCodeStore, poolManager *agent.PoolManager, pluginHost *pluginhost.Host) *Server
New creates an admin server with all API routes mounted. The linkCodes store is shared with channel bots so codes generated in the admin panel can be consumed by channel handlers.
func (*Server) CredentialsService ¶ added in v0.15.0
func (s *Server) CredentialsService() *credentials.Service
CredentialsService returns the shared credentials service. Used by callers that need to wire in the runner invalidator or access the credentials tool from outside the admin package.
func (*Server) Handler ¶
Handler returns the HTTP handler with CORS, JSON, and auth middleware applied.
func (*Server) LinkCodes ¶ added in v0.9.0
func (s *Server) LinkCodes() *auth.LinkCodeStore
LinkCodes returns the link code store for use by channel handlers.
func (*Server) SetVaultRecipient ¶ added in v0.15.0
func (s *Server) SetVaultRecipient(r *age.X25519Recipient)
SetVaultRecipient sets the master age recipient so that new users created via web registration receive an age keypair. Call before serving requests. If not set (nil), vault key generation is skipped for new users.
func (*Server) SetVaultService ¶ added in v0.15.0
SetVaultService wires the vault service into the admin server. Call before serving requests. If not set (nil), vault API endpoints return 503 Service Unavailable.
Source Files
¶
- agent_access.go
- agent_helpers.go
- agent_users.go
- agents.go
- auth.go
- auth_users.go
- builtin.go
- channels.go
- embed.go
- http.go
- manifest_plugins.go
- middleware.go
- models.go
- oauth.go
- plugins.go
- profile.go
- providers.go
- render.go
- response.go
- routes.go
- scheduler.go
- server.go
- sessions.go
- skills.go
- skills_scoped.go
- tools.go
- users.go
- vault.go
- weixin_qr.go