Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问clear审计通过

auth-patterns授权模式

Agent Skill

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

总安装

465

周安装

19

GitHub Stars

160

下载量

149
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/yonatangross/orchestkit --skill auth-patterns

简介

用于辅助安全审计、权限检查和认证流程分析,适合系统安全排查场景。

  • 可梳理敏感配置、检查依赖风险、分析鉴权逻辑,生成安全复核清单。
  • 不能将工具输出直接当最终结论,需人工复核关键操作和结果。
  • 涉及密钥、令牌、用户数据或生产系统时,应确认最小权限和脱敏方式。
  • auth-patterns 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Authentication Patterns

Implement secure authentication with OAuth 2.1, Passkeys, and modern security standards.

Overview

  • Login/signup flows
  • JWT token management
  • Session security
  • OAuth 2.1 with PKCE
  • Passkeys/WebAuthn
  • Multi-factor authentication
  • Role-based access control

Quick Reference

Password Hashing (Argon2id)

from argon2 import PasswordHasher
ph = PasswordHasher()
password_hash = ph.hash(password)
ph.verify(password_hash, password)

JWT Access Token

import jwt
from datetime import datetime, timedelta, timezone
payload = {
    'user_id': user_id,
    'type': 'access',
    'exp': datetime.now(timezone.utc) + timedelta(minutes=15),
}
token = jwt.encode(payload, SECRET_KEY, algorithm='HS256')

OAuth 2.1 with PKCE (Required)

import hashlib, base64, secrets
code_verifier = secrets.token_urlsafe(64)
digest = hashlib.sha256(code_verifier.encode()).digest()
code_challenge = base64.urlsafe_b64encode(digest).rstrip(b'=').decode()

Session Security

app.config['SESSION_COOKIE_SECURE'] = True      # HTTPS only
app.config['SESSION_COOKIE_HTTPONLY'] = True    # No JS access
app.config['SESSION_COOKIE_SAMESITE'] = 'Strict'

Token Expiry (Guidelines)

Token TypeExpiryStorage
Access15 min - 1 hourMemory only
Refresh7-30 daysHTTPOnly cookie

Anti-Patterns (FORBIDDEN)

# ❌ NEVER store passwords in plaintext
user.password = request.form['password']

# ❌ NEVER use implicit OAuth grant
response_type=token  # Deprecated in OAuth 2.1

# ❌ NEVER skip rate limiting on login
@app.route('/login')  # No rate limit!

# ❌ NEVER reveal if email exists
return "Email not found"  # Information disclosure

# ✅ ALWAYS use Argon2id or bcrypt
password_hash = ph.hash(password)

# ✅ ALWAYS use PKCE
code_challenge=challenge&code_challenge_method=S256

# ✅ ALWAYS rate limit auth endpoints
@limiter.limit("5 per minute")

# ✅ ALWAYS use generic error messages
return "Invalid credentials"

Key Decisions

DecisionRecommendation
Password hashArgon2id > bcrypt
Access token expiry15 min - 1 hour
Refresh token expiry7-30 days with rotation
Session cookieHTTPOnly, Secure, SameSite=Strict
Rate limit5 attempts per minute
MFAPasskeys > TOTP > SMS
OAuth2.1 with PKCE (no implicit)

Detailed Documentation

ResourceDescription
references/oauth-2.1-passkeys.mdOAuth 2.1, PKCE, Passkeys/WebAuthn
examples/auth-implementations.mdComplete implementation examples
checklists/auth-checklist.mdSecurity checklist
scripts/auth-middleware-template.pyFlask/FastAPI middleware

Related Skills

  • owasp-top-10 - Security fundamentals
  • input-validation - Data validation
  • api-design-framework - API security

Capability Details

password-hashing

Keywords: password, hashing, bcrypt, argon2, hash Solves:

  • Securely hash passwords with modern algorithms
  • Configure appropriate cost factors
  • Migrate legacy password hashes

jwt-tokens

Keywords: JWT, token, access token, claims, jsonwebtoken Solves:

  • Generate and validate JWT access tokens
  • Implement proper token expiration
  • Handle token refresh securely

oauth2-pkce

Keywords: OAuth, PKCE, OAuth 2.1, authorization code, code verifier Solves:

  • Implement OAuth 2.1 with PKCE flow
  • Secure authorization for SPAs and mobile apps
  • Handle OAuth provider integration

passkeys-webauthn

Keywords: passkey, WebAuthn, FIDO2, passwordless, biometric Solves:

  • Implement passwordless authentication
  • Configure WebAuthn registration and login
  • Support cross-device passkeys

session-management

Keywords: session, cookie, session storage, logout, invalidate Solves:

  • Manage user sessions securely
  • Implement session invalidation on logout
  • Handle concurrent sessions

role-based-access

Keywords: RBAC, role, permission, authorization, access control Solves:

  • Implement role-based access control
  • Define permission hierarchies
  • Check authorization in routes

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

Claude Code

29.82%
按下载量换算44

Gemini CLI

24.95%
按下载量换算37

Antigravity

16.96%
按下载量换算25

windsurf

14.06%
按下载量换算21

trae

8.14%
按下载量换算12

OpenCode

4.14%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills