Skip to main content

Auth: hbf-nlp

How this service handles authentication. Full flows: docs/architecture/auth-flows.md

Tokens This Service Accepts

Token typeWhere validatedGuard / middleware
User JWTRemote validation via hbf-core /users/meHBFGuard
Local JWTLocal verification (signing key)JWTGuard

Tokens This Service Sends

CallingToken usedHow attached
hbf-core (via hbf-core-api library)HBF_CORE_API_TOKEN env varBearer header

Tokens This Service Issues

None.

Roles / Scopes Enforced

Endpoint patternRequired role
Org-admin endpointsHBF_ORG_ADMIN (via MemberOrgRoleGuard)
Org-editor endpointsHBF_ORG_EDITOR (via MemberOrgRoleGuard)
Org-viewer endpointsHBF_ORG_VIEWER (via MemberOrgRoleGuard)
Tenant-admin endpointsHBF_TENANT_ADMIN (via CanManageTenantGuard)
Tenant-editor endpointsHBF_TENANT_EDITOR (via CanEditTenantGuard)
Tenant-viewer endpointsHBF_TENANT_VIEWER (via CanReadTenantGuard)
Moderator-only endpointsisModerator (via ModeratorGuard)

Auth Notes

  • Full RBAC enforcement at both org and tenant levels. No public endpoints exist.
  • HBFGuard calls hbf-core /users/me to validate the user JWT and retrieve user details.
  • Guards available: HBFGuard, JWTGuard, MemberOrgRoleGuard, CanEditTenantGuard, CanManageTenantGuard, CanReadTenantGuard, ModeratorGuard.
  • Env config: HBF_CORE_API_TOKEN (service token for hbf-core calls), HBF_CORE_URL (hbf-core base URL).