bloom_auth_server 0.3.2
bloom_auth_server: ^0.3.2 copied to clipboard
Server-side authentication primitives for the Bloom framework, including password hashing, session/bearer token issuance, rate limiting, password reset workflows, and auth middleware.
0.3.2 - 2026-08-31 #
Security & Reliability Hardening #
- Verified Auth UserId & Claims Binding:
BloomAuthRequestExtension.authUserIdnow strictly extracts the user ID from cryptographically verified claims attached byBloomAuthMiddleware, eliminating fallback to mutable request parameters. AddedhasAnyRoleandauthRoleshelpers adhering to the same strict verified-claims boundary. - Strict JWT Session Token Typing:
verifySessionTokennow strictly requirestoken_type == 'session'. Tokens missing thetoken_typeclaim or specifying any non-session type are rejected with a typedSessionTokenException. - OAuth State Store & CSRF Verification: Added
BloomOAuthStateStoreinterface,InMemoryOAuthStateStore,BloomOAuthStateException, and state verification extension points inBloomOAuthFlow.handleCallbackcan now require and atomically consume generated state tokens. Updated documentation to clarify that state token storage and verification are required for CSRF protection. - Password Reset TTL Validation & Revocation Extension: Enforced strictly positive duration validation in
generatePasswordResetToken. AddedBloomPasswordResetRevocationStore,InMemoryPasswordResetRevocationStore, andverifyAndConsumePasswordResetTokenextension points for stateful single-use revocation tracking.
0.3.1 - 2026-08-25 #
Fixed #
- Bumped
bloom_serverdependency constraint from^0.1.0to^0.2.0— the stale constraint was incompatible with any sibling package (bloom_cache,bloom_i18n) requiringbloom_server ^0.2.0, breakingpub getin any app combining them.
0.3.0 - 2026-08-25 #
Added #
- OAuth2 / social login. New
BloomOAuthProviderinterface with real Google and GitHub Authorization Code flow implementations (GoogleOAuthProvider,GitHubOAuthProvider) — authorization URL construction, code exchange, and profile fetch (GitHub's primary-verified-email lookup included).BloomOAuthFlowties a provider to the existing JWT session-token issuance via an app-suppliedresolveUsercallback, and includes a CSRF-safestategenerator. Closes the previous local-password-only auth gap.
0.2.0 - 2026-08-23 #
Breaking #
- Now depends on
bloom_serverinstead ofbloom_framework. Imports change frompackage:bloom_framework/bloom_server.darttopackage:bloom_server/bloom_server.dart. - No longer requires Flutter. The package now resolves against the Flutter-free
bloom_servercore, so it can be used from a plaindart run/dart compilebackend.
0.1.0 #
- Initial release of
bloom_auth_server. - Password Hashing & Verification: Strong, constant-time BCrypt hashing (
hashPassword,verifyPassword,dummyVerifyPassword) with configurable cost factor and user-enumeration defense. - Session & Bearer Token Issuance: Cryptographically signed Bearer JWT issuance (
issueSessionToken,verifySessionToken) bound with expiration, user identity, and custom claims. - Sliding-Window Rate Limiting & Account Lockout: In-memory rate limiting (
InMemoryRateLimiter) and persistent-style lockout tracker (InMemoryLockoutManager,AuthRateLimiter) with fail-closed security semantics. - Password Reset Workflows: Single-purpose, time-limited, HMAC-signed password reset tokens (
generatePasswordResetToken,verifyPasswordResetToken) cryptographically bound to the user's current password hash to ensure instant invalidation upon password modification. - Bloom Server Middleware: Drop-in
BloomAuthMiddlewareforBloomApiRoutersupporting Bearer token extraction, claim hydration, role validation, andBloomRequestcontext extensions (request.auth,request.authUserId,request.isAuthenticated).