xrk-auth
Skill140 starsChanged 8 months agoMITView on GitHub
当你需要解释/排查 HTTP 或 WebSocket 的 401、127 回环例外、API Key 机制时使用;确保业务层不重复鉴权。
In this repository43 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- .cursor/rules/vibe-learn-craft.mdcCursor rule
- .cursor/rules/xrk-core-code.mdcCursor rule
- .cursor/rules/xrk-dev-requirements.mdcCursor rule
- .cursor/rules/xrk-infrastructure.mdcCursor rule
- .cursor/rules/xrk-project.mdcCursor rule
- .cursor/rules/xrk-third-party-plugins.mdcCursor rule
- accessibility-complianceSkill
- design-system-patternsSkill
- fronted-designSkill
- immersive-short-videoSkill
- interaction-designSkill
- mobile-android-designSkill
- mobile-ios-designSkill
- react-native-designSkill
- responsive-designSkill
- ui-ux-pro-maxSkill
- visual-design-foundationsSkill
- web-component-designSkill
- xrk-agent-runtimeSkill
- xrk-ai-workflowSkill
- xrk-app-devSkill
- xrk-coding-styleSkill
- xrk-configSkill
- xrk-crawlSkill
- xrk-dockerSkill
- xrk-docsSkill
- xrk-github-researchSkill
- xrk-http-apiSkill
- xrk-infrastructureSkill
- xrk-llmSkill
- xrk-mcpSkill
- xrk-node-runtimeSkill
- xrk-pluginsSkill
- xrk-project-overviewSkill
- xrk-rendererSkill
- xrk-runtime-utilSkill
- xrk-subserverSkill
- xrk-system-coreSkill
- xrk-taskerSkill
- xrk-v3-apiSkill
- xrk-www-compatSkill
The file
Files
文档与代码
docs/AUTH.md- 门面:
src/agent-runtime.js(_authMiddleware、checkApiAuthorization、wsConnect) - 实现:
src/infrastructure/http/runtime-auth.js、runtime-ws.js、auth.js
原则
/api/由HttpApi+AgentRuntime.checkApiAuthorization;公开路由systemAuth: false。- 默认所有客户端须 API Key;
server.auth.loopbackExempt===true时才允许「本机 Host+127」免 Key(公网/反代勿开)。runEnabled=true时即便 exempt 也强制 Key。 - 控制台鉴权模式:公开
GET /api/system/auth-mode→requiresKey;禁止用无 Key 打受保护接口靠 401 探测。 - WS:
wsConnect→runtime-ws;AgentRuntime.wsf[path]可为{ handler, skipAuth: true }跳过系统 Key。
API Key 携带
Header:X-API-Key、Api-Key、Authorization: Bearer|Token|ApiKey <key>;查询仅 api_key / apiKey。不接受 body 与 token/key 等易撞字段。
Node 26
- 扩展时判错用
Error.isError,勿instanceof Error(skillxrk-node-runtime)。 - 业务 Core 不重复实现鉴权;HTTP 超时仍用
AbortSignal.timeout。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

