Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计异常

authentication身份认证

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

261

周安装

11

GitHub Stars

1

下载量

92
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:authentication(身份认证)
来源仓库:https://github.com/cheehoolabs/spureeskills
仓库路径:skills/authentication
安装命令:
npx skills add https://github.com/cheehoolabs/spureeskills --skill authentication
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/cheehoolabs/spureeskills --skill authentication

简介

Authentication 辅助进行安全审计与权限检查,识别凭据风险与认证漏洞。

  • 支持 JWT 令牌管理、API 密钥轮换及 OAuth2 流程模拟等关键操作。
  • 适合生成安全复核清单并分析鉴权逻辑中的潜在隐患点。
  • 处理敏感信息时必须确认最小权限原则,并对输出结果进行脱敏处理。
  • authentication 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Authentication

Overview

Spuree is an agent-friendly cloud storage. Projects contain folders (nestable) and files at any level. Authenticate with a JWT token or API key to access all V1 endpoints.

Tokens follow OAuth2 conventions and are issued as NextAuth-compatible JWTs.

Use this skill when an agent needs to:

  • Set up API access for the first time
  • Log in with email and password to get an access token
  • Refresh an expired access token using a refresh token
  • Exchange an authorization code for tokens (browser SSO flow)
  • Create, list, or revoke API keys

Getting Started

First-time setup — three options:

Option A: User creates API key from web UI

  1. Create a Spuree account at studio.spuree.com
  2. Go to studio.spuree.com/api-keys and create a key. Save it immediately — the key is only shown once.
  3. Set the environment variable: export SPUREE_API_KEY="<your-api-key>"

Option B: Agent logs in with email and password

If the user provides their email and password, the agent can set up its own API key:

  1. Log in with POST /auth/token to get a temporary JWT
  2. Create an API key with POST /v1/api-keys
  3. Store the key in $SPUREE_API_KEY

Option C: Agent opens browser for SSO login

The agent can authenticate without the user sharing their password:

  1. Start a local HTTP server on an ephemeral port (49152–65535) to receive the callback.
  2. Open the user's browser to the Spuree sign-in page with source=api and the port: https://studio.spuree.com/auth/signin?source=api&port=<port> The user logs in via Google SSO (or email/password) in the browser.
  3. After login, Spuree redirects to http://localhost:<port>/callback?token=<exchange-code>. The agent receives the exchange code from this callback (valid for 60 seconds).
  4. Exchange the code for a JWT: curl -X POST "https://studio.spuree.com/api/auth/token/exchange" \ -H "Content-Type: application/json" \ -d '{"code": "<exchange-code>"}'
  5. Create an API key with the JWT (POST /v1/api-keys) and store it in $SPUREE_API_KEY.

Once $SPUREE_API_KEY is set, the agent authenticates with X-API-Key: $SPUREE_API_KEY on all requests. No login or token refresh needed.

Verify it works — ask your agent:

"List my Spuree projects"

The agent should show you which projects you have access to. If it works, your API key is set up correctly.

Try it out — ask your agent something like:

"Upload this file to my Spuree project"

Base URLs

Spuree uses two hosts:

HostPurposeEndpoints
https://studio.spuree.com/apiAuthentication (login, refresh, exchange)/auth/token, /auth/token/refresh, /auth/token/exchange
https://data.spuree.com/apiAll V1 data APIs (projects, files, etc.)/v1/projects, /v1/files, /v1/api-keys,...

All other skills in this repo use https://data.spuree.com/api. Only the token endpoints below use studio.spuree.com.

Token Lifecycle

TokenLifetimeFormat
access_token1 hourNextAuth JWT
refresh_token30 daysOpaque hex string
exchange_code60 secondsOpaque string

The access_token is what you pass as Authorization: Bearer <access_token> to V1 API endpoints.

Alternatively, you can create API keys for long-lived, non-interactive access. API keys are passed via X-API-Key header and can be scoped to specific organizations.

Token Response Format

All three endpoints return the same OAuth2-compliant response:

{
  "access_token": "eyJhbGciOiJkaXIiLCJlbmMiOi...",
  "refresh_token": "a1b2c3d4e5f6...",
  "expires_in": 3600,
  "user": {
    "id": "64a7b8c9d1e2f3a4b5c6d7e8",
    "email": "user@example.com",
    "name": "User Name",
    "image": "https://...",
    "organizationId": "64a7b8c9d1e2f3a4b5c6d7f0",
    "role": "admin",
    "workspaces": [
      {
        "workspaceId": "64a7b8c9d1e2f3a4b5c6d7f1",
        "workspaceName": "My Workspace",
        "role": "owner"
      }
    ]
  }
}

Endpoints

POST /auth/token

Log in with email and password.

Description: Validates credentials and returns an access token and refresh token. Rate limited to 10 requests per minute per IP.

Request Body:

FieldTypeRequiredDescription
emailstringYesUser's email address
passwordstringYesUser's password

Status Codes:

CodeDescription
200Login successful, tokens returned
400Invalid request body or missing fields
401Invalid email or password, or account locked
429Rate limit exceeded (10 req/min)
500Internal server error

Error Messages (401):

MessageCause
Invalid email or passwordWrong credentials
Password is not set for this userUser registered via OAuth only
Account is temporarily locked...Too many failed attempts (5 failures → 15 min lock)

Example:

curl -X POST "https://studio.spuree.com/api/auth/token" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "mypassword"
  }'

POST /auth/token/refresh

Refresh an expired access token.

Description: Exchanges a valid refresh token for a new access token and refresh token pair. The old refresh token is atomically revoked to prevent reuse. Rate limited to 10 requests per minute per IP.

Request Body:

FieldTypeRequiredDescription
refresh_tokenstringYesThe refresh token from a previous login or refresh

Status Codes:

CodeDescription
200New tokens issued
400Missing refresh token
401Invalid or expired refresh token
429Rate limit exceeded
500Internal server error

Example:

curl -X POST "https://studio.spuree.com/api/auth/token/refresh" \
  -H "Content-Type: application/json" \
  -d '{
    "refresh_token": "a1b2c3d4e5f6..."
  }'

Notes:

  • Each refresh token can only be used once. After refresh, use the new refresh_token for subsequent refreshes.
  • If a refresh token is reused (already revoked), it returns 401.

POST /auth/token/exchange

Exchange an authorization code for tokens.

Description: Exchanges a one-time authorization code for an access token and refresh token. Used by agents and desktop apps that authenticate via the browser (see Getting Started Option C). The login flow starts at studio.spuree.com/auth/signin?source=api — after the user completes login, the exchange code is delivered to the agent's local callback server. Rate limited to 10 requests per minute per IP.

Request Body:

FieldTypeRequiredDescription
codestringYesThe authorization exchange code

Status Codes:

CodeDescription
200Tokens issued
400Missing exchange code
401Invalid or expired exchange code
429Rate limit exceeded
500Internal server error

Example:

curl -X POST "https://studio.spuree.com/api/auth/token/exchange" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "exchange-code-here"
  }'

Notes:

  • Exchange codes expire after 60 seconds.
  • Each code can only be used once.

API Keys

API keys provide long-lived authentication for automated workflows. They are scoped to a user and optionally restricted to specific organizations.

All V1 endpoints accept either Authorization: Bearer <jwt> or X-API-Key: <api-key>. When both are provided, JWT takes priority.

POST /v1/api-keys

Create a new API key.

Auth: Requires JWT (Bearer token only, not API key).

Request Body:

FieldTypeRequiredDescription
namestringYesDescriptive name for the key
scopesobjectNo{"organizations": ["orgId1",...]} — restrict to specific orgs. Omit for all orgs.
expiresAtdatetimeNoExpiration timestamp (ISO 8601). Omit for no expiry.

Response:

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "CI Pipeline Key",
  "key": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2",
  "createdAt": "2024-01-15T10:00:00Z",
  "expiresAt": null,
  "lastUsedAt": null,
  "scopes": { "organizations": ["64a7b8c9d1e2f3a4b5c6d7f0"] },
  "status": "active"
}
Important: The key field is only returned once at creation. Store it securely.

Example:

curl -X POST "https://data.spuree.com/api/v1/api-keys" \
  -H "Authorization: Bearer $SPUREE_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "CI Pipeline Key",
    "scopes": { "organizations": ["64a7b8c9d1e2f3a4b5c6d7f0"] }
  }'

GET /v1/api-keys

List all active API keys for the authenticated user.

Auth: Requires JWT (Bearer token only).

Response:

[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "CI Pipeline Key",
    "createdAt": "2024-01-15T10:00:00Z",
    "expiresAt": null,
    "lastUsedAt": "2024-03-10T14:30:00Z",
    "scopes": { "organizations": ["64a7b8c9d1e2f3a4b5c6d7f0"] },
    "status": "active"
  }
]

Example:

curl "https://data.spuree.com/api/v1/api-keys" \
  -H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"

DELETE /v1/api-keys/{key_id}

Revoke an API key (soft delete).

Auth: Requires JWT (Bearer token only).

Response:

{ "success": true }

Example:

curl -X DELETE "https://data.spuree.com/api/v1/api-keys/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"

Token Storage

Store tokens in environment variables using these standard names:

SPUREE_ACCESS_TOKEN=eyJhbGci...    # JWT access token (1 hour)
SPUREE_REFRESH_TOKEN=a1b2c3d4...   # For refreshing access token (30 days)
SPUREE_API_KEY=a1b2c3d4...             # API key (64-char hex, long-lived)

All Spuree skills reference these variable names. V1 endpoints accept either Authorization: Bearer $SPUREE_ACCESS_TOKEN or X-API-Key: $SPUREE_API_KEY.

Common Patterns

Agent Login Flow

  1. Obtain tokens with email and password: POST /auth/token → {access_token, refresh_token, expires_in, user}
  2. Use access token for V1 API calls: Authorization: Bearer {access_token}
  3. Refresh before the token expires (every ~55 minutes): POST /auth/token/refresh → {access_token, refresh_token,...}

Token Refresh Strategy

  • expires_in is 3600 (1 hour). Refresh proactively at ~55 minutes to avoid failed requests.
  • Always store and use the latest refresh_token — old ones are revoked after use.
  • If refresh fails with 401, the user must log in again with email/password.

API Key for Automation

For CI/CD pipelines or long-running agents that can't refresh tokens:

  1. Log in to get a JWT
  2. Create an API key scoped to the needed organizations: POST /v1/api-keys → {key: "a1b2c3d4..."}
  3. Use the API key for all subsequent requests: X-API-Key: a1b2c3d4...

API keys don't expire by default (unless expiresAt is set) and don't need refreshing.

Error Handling

ErrorCauseResolution
401 (invalid credentials)Wrong email or passwordVerify credentials
401 (account locked)5 failed login attemptsWait 15 minutes, then retry
401 (invalid refresh token)Token expired, revoked, or reusedLog in again with email/password
401 (invalid exchange code)Code expired or already usedRequest a new exchange code
429 (rate limit)More than 10 requests/min from same IPWait and retry with backoff

Rate Limits

All authentication endpoints share the same rate limit: 10 requests per minute per IP. Implement exponential backoff when receiving 429 responses.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.97%
按下载量换算35

Claude

29.05%
按下载量换算27

Cursor

20.07%
按下载量换算18

Gemini CLI

9.63%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills