Service Layer medium complexity backend
0
Dependencies
0
Dependents
3
Entities
0
Integrations

Description

Backend service that handles admin-initiated session revocation by invalidating the session record and the full refresh-token chain for the targeted account. Enforces strict tenant scoping so cross-tenant revocation is never permitted.

Feature: Session Management

session-revocation-service

Sources & reasoning

Core business logic for the feature. Tenant-scoped revocation with full refresh-token chain invalidation is the security-critical operation that distinguishes this feature from a simple delete. Audit logging and the non-retryable 401 contract with the mobile client are mandatory behaviours cited in the implementation notes.

No source references — this artifact was included based on reasoning alone (see above).

Responsibilities

  • Revoke a single session by ID, marking it invalid in the sessions table
  • Invalidate the full refresh-token chain associated with the revoked session
  • Enforce tenant isolation - only sessions belonging to the admin's tenant may be revoked
  • Emit an audit log entry for every admin-initiated revocation
  • Return a non-retryable 401 signal so mobile ApiHttpClient forces the user to the login screen

Interfaces

revokeSession(sessionId, requestingAdminId): RevocationResult
revokeAllSessionsForUser(userId, tenantId, requestingAdminId): BulkRevocationResult
bulkRevokeSessions(sessionIds[], tenantId, requestingAdminId): BulkRevocationResult
getActiveSessionsForTenant(tenantId, pagination): SessionPage
isSessionRevoked(sessionId): boolean

Related Data Entities (3)

Data entities managed by this component