Documentation
¶
Index ¶
Constants ¶
const ( CtxKeyTokenType = "rpc.token.type" CtxKeyWorkerID = "rpc.token.worker_id" CtxKeyScopes = "rpc.token.scopes" )
const ( ClearReasonActiveTasks = "active_tasks" ClearReasonMultipleWorkers = "multiple_workers" ClearReasonNoContext = "no_context" )
const CtxScopesKey ctxKey = CtxKeyScopes
Mirrors CtxKeyScopes from auth middleware; see CtxWorkerIDKey comment above.
const CtxWorkerIDKey ctxKey = CtxKeyWorkerID
Uses the same string value as CtxKeyWorkerID (auth middleware on gin.Context) so the two stay in sync without a hard import dependency between packages. Exported so tests can construct contexts that simulate worker calls.
Variables ¶
This section is empty.
Functions ¶
func JWTAuthMiddleware ¶
func JWTAuthMiddleware(secret string) gin.HandlerFunc
JWTAuthMiddleware validates the RPC JWT and writes claims to gin.Context. Reads the token from X-API-Key header or api_key query param. Returns 401 on missing, invalid, or expired token.
func RequireBeeOrWorker ¶
func RequireBeeOrWorker() gin.HandlerFunc
RequireBeeOrWorker accepts tokens of either type.
Types ¶
type ActiveTaskSummary ¶
type LinkedWorkerSummary ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server dispatches tool calls.
func NewBeeServer ¶
func NewBeeServer( ws *store.WorkerStore, mgr *worker.Manager, ts *store.TaskStore, ms *store.MessageStore, oms *store.OutboundMessageStore, senders map[string]platform.PlatformSenderAdapter, clearSvc *session.ClearService, es *store.ExecutionStore, constraintStore *store.ConstraintStore, sessionStore *store.SessionStore, ds *store.DepartmentStore, ) *Server
func (*Server) HandleCall ¶
Tool errors are returned as 200 {"error": "..."} to match the RPC-over-HTTP convention.