pinme-auth

Solid

Use when a PinMe project (Worker TypeScript) needs to integrate user authentication — creating email/password users, verifying id_tokens, querying user info, or listing users via Identity Platform auth proxy APIs.

API & Backend 3,659 stars 270 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
100
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# PinMe Worker Auth API Integration Guides how to call PinMe platform's Identity Platform auth proxy APIs in a PinMe Worker (TypeScript). ## Environment Variables ```typescript // backend/src/worker.ts export interface Env { DB: D1Database; API_KEY: string; // 项目 API Key — 用于所有 auth 接口认证 PROJECT_NAME: string; // 项目名 — 所有 auth 接口必须同时传递 BASE_URL?: string; // 可选,默认 https://pinme.cloud } ``` > `API_KEY` 和 `PROJECT_NAME` 是所有 auth 接口的必填凭证,缺一不可。 --- ## 认证方式(所有接口通用) | 参数 | 传递方式 | 必填 | 说明 | |------|---------|------|------| | `X-API-Key` | 请求头 | 是 | 项目 API Key | | `project_name` | Query 参数 | 是 | 必须与 `X-API-Key` 对应同一个项目 | 服务端会先校验这两个字段是否匹配同一个项目,再从项目配置中取出 `tenant_id`,然后转调 Identity Platform。 --- ## 通用错误 | 场景 | HTTP | `data.error` | |------|------|-------------| | 缺少 `X-API-Key` | 401 | `X-API-Key header is required` | | 缺少 `project_name` | 400 | `project_name is required` | | API Key 和项目不匹配 | 401 | `Invalid API key or project name` | | 项目未配置认证租户 | 400 | `Auth service not configured for this project` | --- ## 通用 TypeScript 类型 ```typescript type ApiEnvelope<T> = { code: number // 200=成功,其他=失败 msg: string // "ok" | "fail" | "invalid param" data: T } type ApiErrorData = { error?: string } type UserInfo = { uid: string email: string display_name: string photo_url?: string disabled: boolean email_verified: boolean } ``` --- ## API 1: 创建用户 **Endpoint:** `POST {BASE_URL}/api/v1/auth/create_user?project_name={project_name}` 仅用于邮箱密码注册。成功时...

Details

Author
glitternetwork
Repository
glitternetwork/pinme
Created
1 years ago
Last Updated
1 weeks ago
Language
TypeScript
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category