mirror of
https://github.com/hanzoai/flow.git
synced 2026-10-17 01:29:18 +00:00
auth: name the identity provider Hanzo IAM, not the vendor it never was
The IAM seam comments credited Casdoor for behavior that is ours: Hanzo IAM is original work, and the Casdoor-derived server (iam-v1) is retired and ships in nothing. "Hanzo IAM is Casdoor-derived" was simply false. Claim handling is unchanged — org still reads `owner` before `org`/`organization`, and built-in/admin are still skipped as non-tenants. Only the attribution moves. Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -49,7 +49,7 @@ class IAMConfig:
|
||||
issuer: str
|
||||
jwks_url: str
|
||||
audience: str = ""
|
||||
# Claim names — Hanzo IAM is Casdoor-derived; org falls back to the `owner` claim.
|
||||
# Claim names — org falls back to the `owner` claim.
|
||||
org_claim: str = "org"
|
||||
org_fallback_claim: str = "owner"
|
||||
project_claim: str = "project"
|
||||
|
||||
@@ -3,7 +3,7 @@ Hanzo IAM Organization extraction for Flow (Flow fork).
|
||||
|
||||
Extracts the IAM organization slug from:
|
||||
1. X-IAM-Org-Id request header (set by gateway)
|
||||
2. JWT `owner` claim (from Casdoor OIDC token)
|
||||
2. JWT `owner` claim (from the IAM OIDC token)
|
||||
3. JWT `org` or `organization` claim (generic OIDC)
|
||||
|
||||
Updates the user's org_id in the database on each authenticated request.
|
||||
@@ -40,10 +40,10 @@ def extract_org_from_request(request: Request) -> str | None:
|
||||
def extract_org_from_jwt_payload(payload: dict) -> str | None:
|
||||
"""Extract org slug from a decoded JWT payload.
|
||||
|
||||
Casdoor uses the `owner` field. We also check `org` and `organization`
|
||||
for compatibility with other OIDC providers.
|
||||
Hanzo IAM carries the org in the `owner` field. We also check `org` and
|
||||
`organization` for compatibility with other OIDC providers.
|
||||
|
||||
Skip the Casdoor built-in org as it's not a real tenant.
|
||||
Skip the built-in org as it's not a real tenant.
|
||||
"""
|
||||
org = (
|
||||
payload.get("owner")
|
||||
|
||||
Reference in New Issue
Block a user