Skip to content

feat: authorization - #3

Merged
obany merged 25 commits into
nextfrom
feature/authorization
Oct 23, 2026
Merged

obany merged 25 commits into
nextfrom
feature/authorization

Conversation

@obany

@obany obany commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

📝 Description

This PR introduces route-level authorization for authentication APIs, adds protected cross-tenant overrides and a password policy endpoint, and extracts reusable authentication audit and rate functionality into standalone packages. It replaces scope-based user data with authorization rules, includes migration support for existing user entities, and aligns the new packages with the latest next namespace and build configuration.

🔄 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • ⚡ Performance improvement
  • ♻️ Code refactoring
  • 📦 Dependencies update

🛠️ Changes Made

  • Replace the user scope field with route-level authorization rules and only allow callers holding the configurable escalatedPrivilegeRole to modify accounts that hold it.
  • Add TenantOverrideProcessor to authorise cross-tenant requests, validate target tenants, and retain the original tenant context.
  • Add configurable minimum and maximum password lengths and a passwordPolicy endpoint returning IPasswordOptions.
  • Add configurable caching for verified authentication tokens in AuthHeaderProcessor via tokenCacheTtlMs, tokenCacheCapacity and tokenCacheMutexTimeoutMs, exposing the resolved IAuthTokenContext.
  • Add AuthenticationUserV0 and migration support for existing user entities.
  • Extract reusable authentication audit and rate models, services, and REST clients into the standalone api-auth-models, api-auth-service and api-auth-rest-client packages, updating package documentation and release configuration.
  • Align the new packages with the @3sixty namespace and the incremental TypeScript build configuration from next.

🧪 Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this change manually
  • Testing not required for changes

@obany
obany merged commit 5688693 into next Oct 23, 2026
3 checks passed
@obany
obany deleted the feature/authorization branch October 23, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant