Files
cms/packages/auth-iam/package.json
zeekayandHanzo Dev 8210a32307 fix(auth-iam): project isAdmin+groups claims; admin all-tenant write gate
IAM admins have owner != "admin", so the multi-tenant all-tenants gate
(iamOrg === 'admin') matched nobody and every write 403'd. Project the
verified isAdmin (and groups) claims onto the CMS user and honor isAdmin
in the gate.

- strategy: map claims.isAdmin -> user.isAdmin, claims.groups -> user.groups
- iamAuthFields: add isAdmin (checkbox) + groups (json) so Payload persists
  and refreshes them on each SSO login
- types: IAMClaims gains isAdmin, groups
- demo payload.config: userHasAccessToAllTenants also honors user.isAdmin
- auth-iam 1.0.0 -> 1.0.1

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-14 17:00:18 -07:00

48 lines
1.3 KiB
JSON

{
"name": "@hanzo/cms-auth-iam",
"version": "1.0.1",
"description": "Hanzo IAM SSO auth strategy for Hanzo CMS. Verifies IAM (Casdoor) access tokens via JWKS; org == tenant. No separate CMS login.",
"license": "MIT",
"type": "module",
"exports": {
".": {
"import": "./src/index.ts",
"types": "./src/index.ts",
"default": "./src/index.ts"
}
},
"main": "./src/index.ts",
"types": "./src/index.ts",
"files": [
"dist"
],
"scripts": {
"build": "pnpm copyfiles && pnpm build:types && pnpm build:swc",
"build:debug": "pnpm build",
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
"build:types": "tsc --emitDeclarationOnly --outDir dist",
"clean": "rimraf -g {dist,*.tsbuildinfo}",
"copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@hanzo/cms": "workspace:*",
"jose": "5.10.0"
},
"devDependencies": {
"@hanzo/cms-eslint-config": "workspace:*"
},
"publishConfig": {
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts"
}
}