feat: backend API key auth context and settings hardening (#406)
* feat: add backend api-key auth context and settings hardening * fix: harden api key token hashing
This commit is contained in:
Vendored
+7
-1
@@ -5,7 +5,12 @@ import "@fastify/jwt";
|
||||
export interface AuthUser {
|
||||
id: number;
|
||||
username: string;
|
||||
role: string;
|
||||
}
|
||||
|
||||
export interface AuthContext {
|
||||
method: "session" | "api_key";
|
||||
scope: "read" | "write";
|
||||
apiKeyId?: number;
|
||||
}
|
||||
|
||||
declare module "fastify" {
|
||||
@@ -22,6 +27,7 @@ declare module "fastify" {
|
||||
|
||||
interface FastifyRequest {
|
||||
user?: AuthUser | null;
|
||||
authContext?: AuthContext;
|
||||
correlationId?: string;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user