Support periodic auth checks in SecurityContext on web socket connections
This commit is contained in:
27
src/auth/event/AuthCheckFailed.ts
Normal file
27
src/auth/event/AuthCheckFailed.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import {BaseEvent, BaseSerializer, ObjectSerializer} from '../../support/bus'
|
||||
import {Awaitable} from '../../util'
|
||||
|
||||
/** An event raised when a required auth check has failed. */
|
||||
export class AuthCheckFailed extends BaseEvent {
|
||||
eventName = '@extollo/lib:AuthCheckFailed'
|
||||
}
|
||||
|
||||
/** Serializes AuthCheckFailed events. */
|
||||
@ObjectSerializer()
|
||||
export class AuthCheckFailedSerializer extends BaseSerializer<AuthCheckFailed, { authCheckFailed: true }> {
|
||||
protected decodeSerial(): Awaitable<AuthCheckFailed> {
|
||||
return new AuthCheckFailed()
|
||||
}
|
||||
|
||||
protected encodeActual(): Awaitable<{ authCheckFailed: true }> {
|
||||
return { authCheckFailed: true }
|
||||
}
|
||||
|
||||
protected getName(): string {
|
||||
return '@extollo/lib:AuthCheckFailedSerializer'
|
||||
}
|
||||
|
||||
matchActual(some: AuthCheckFailed): boolean {
|
||||
return some instanceof AuthCheckFailed
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user