Documentation
¶
Index ¶
- type AuthInfo
- type Server
- func (s *Server) CreateFeed(w http.ResponseWriter, r *http.Request)
- func (s *Server) CreateSchedulerJob(w http.ResponseWriter, r *http.Request)
- func (s *Server) CredentialsService() *credentials.Service
- func (s *Server) DeleteArticle(w http.ResponseWriter, r *http.Request, id string)
- func (s *Server) DeleteFeed(w http.ResponseWriter, r *http.Request, id string)
- func (s *Server) DeleteSchedulerJob(w http.ResponseWriter, r *http.Request, id string)
- func (s *Server) GetArticle(w http.ResponseWriter, r *http.Request, id string, ...)
- func (s *Server) GetDigest(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetFeed(w http.ResponseWriter, r *http.Request, id string)
- func (s *Server) Handler() http.Handler
- func (s *Server) LinkCodes() *auth.LinkCodeStore
- func (s *Server) ListArticles(w http.ResponseWriter, r *http.Request, params apiserver.ListArticlesParams)
- func (s *Server) ListFeedEntries(w http.ResponseWriter, r *http.Request, feedId string, ...)
- func (s *Server) ListFeeds(w http.ResponseWriter, r *http.Request, params apiserver.ListFeedsParams)
- func (s *Server) ListSchedulerJobRuns(w http.ResponseWriter, r *http.Request, id string)
- func (s *Server) ListSchedulerJobs(w http.ResponseWriter, r *http.Request)
- func (s *Server) PollFeed(w http.ResponseWriter, r *http.Request, id string, ...)
- func (s *Server) SaveArticle(w http.ResponseWriter, r *http.Request)
- func (s *Server) SetSchedulerService(svc *scheduler.Service)
- func (s *Server) SetTokenService(svc *auth.TokenService)
- func (s *Server) SetVaultRecipient(r *age.X25519Recipient)
- func (s *Server) SetVaultService(svc *vault.Service)
- func (s *Server) TriggerSchedulerJob(w http.ResponseWriter, r *http.Request, id string)
- func (s *Server) UpdateArticle(w http.ResponseWriter, r *http.Request, id string)
- func (s *Server) UpdateFeed(w http.ResponseWriter, r *http.Request, id string)
- func (s *Server) UpdateFeedEntry(w http.ResponseWriter, r *http.Request, feedId string, id string)
- func (s *Server) UpdateSchedulerJob(w http.ResponseWriter, r *http.Request, id string)
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) CreateFeed ¶ added in v0.22.0
func (s *Server) CreateFeed(w http.ResponseWriter, r *http.Request)
func (*Server) CreateSchedulerJob ¶ added in v0.22.0
func (s *Server) CreateSchedulerJob(w http.ResponseWriter, r *http.Request)
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) DeleteArticle ¶ added in v0.22.0
func (*Server) DeleteFeed ¶ added in v0.22.0
func (*Server) DeleteSchedulerJob ¶ added in v0.22.0
func (*Server) GetArticle ¶ added in v0.22.0
func (s *Server) GetArticle(w http.ResponseWriter, r *http.Request, id string, params apiserver.GetArticleParams)
func (*Server) GetDigest ¶ added in v0.22.0
func (s *Server) GetDigest(w http.ResponseWriter, r *http.Request)
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) ListArticles ¶ added in v0.22.0
func (s *Server) ListArticles(w http.ResponseWriter, r *http.Request, params apiserver.ListArticlesParams)
func (*Server) ListFeedEntries ¶ added in v0.22.0
func (s *Server) ListFeedEntries(w http.ResponseWriter, r *http.Request, feedId string, params apiserver.ListFeedEntriesParams)
func (*Server) ListFeeds ¶ added in v0.22.0
func (s *Server) ListFeeds(w http.ResponseWriter, r *http.Request, params apiserver.ListFeedsParams)
func (*Server) ListSchedulerJobRuns ¶ added in v0.22.0
func (*Server) ListSchedulerJobs ¶ added in v0.22.0
func (s *Server) ListSchedulerJobs(w http.ResponseWriter, r *http.Request)
func (*Server) PollFeed ¶ added in v0.22.0
func (s *Server) PollFeed(w http.ResponseWriter, r *http.Request, id string, params apiserver.PollFeedParams)
func (*Server) SaveArticle ¶ added in v0.22.0
func (s *Server) SaveArticle(w http.ResponseWriter, r *http.Request)
func (*Server) SetSchedulerService ¶ added in v0.22.0
SetSchedulerService wires the live scheduler service into the admin server. When set, create and delete job handlers go through the service (live + DB). If not set, those handlers write DB-only.
func (*Server) SetTokenService ¶ added in v0.20.0
func (s *Server) SetTokenService(svc *auth.TokenService)
SetTokenService wires bearer token authentication into the admin server.
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.
func (*Server) TriggerSchedulerJob ¶ added in v0.22.0
func (*Server) UpdateArticle ¶ added in v0.22.0
func (*Server) UpdateFeed ¶ added in v0.22.0
func (*Server) UpdateFeedEntry ¶ added in v0.22.0
func (*Server) UpdateSchedulerJob ¶ added in v0.22.0
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
- recally_handlers.go
- render.go
- response.go
- routes.go
- scheduler.go
- server.go
- sessions.go
- skills.go
- skills_scoped.go
- skills_upload.go
- tools.go
- users.go
- vault.go
- weixin_qr.go