parent
345851bf1d
commit
9675e79441
@ -35,7 +35,7 @@ export class StatsController {
|
|||||||
|
|
||||||
@Get("/authorized")
|
@Get("/authorized")
|
||||||
@UseBefore(StatsAuth)
|
@UseBefore(StatsAuth)
|
||||||
@OpenAPI({ description: "A demo endpoint for authorized stats." })
|
@OpenAPI({ description: "A demo endpoint for authorized stats.", security: [{ "StatsApiToken": [] }] })
|
||||||
async getAuthorized() {
|
async getAuthorized() {
|
||||||
let connection = getConnection();
|
let connection = getConnection();
|
||||||
let runners = await connection.getRepository(Runner).find({ relations: ["scans"] });
|
let runners = await connection.getRepository(Runner).find({ relations: ["scans"] });
|
||||||
|
@ -35,6 +35,11 @@ export default async (app: Application) => {
|
|||||||
"in": "cookie",
|
"in": "cookie",
|
||||||
"name": "lfk_backend__refresh_token",
|
"name": "lfk_backend__refresh_token",
|
||||||
description: "A cookie containing a JWT based refreh token. Attention: Doesn't work in swagger-ui. Use /api/auth/login or /api/auth/refresh to get one."
|
description: "A cookie containing a JWT based refreh token. Attention: Doesn't work in swagger-ui. Use /api/auth/login or /api/auth/refresh to get one."
|
||||||
|
},
|
||||||
|
"StatsApiToken": {
|
||||||
|
"type": "http",
|
||||||
|
"scheme": "bearer",
|
||||||
|
description: "Api token that can be obtained by creating a new stats client (post to /api/statsclients)."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -44,6 +44,11 @@ const spec = routingControllersToSpec(
|
|||||||
"in": "cookie",
|
"in": "cookie",
|
||||||
"name": "lfk_backend__refresh_token",
|
"name": "lfk_backend__refresh_token",
|
||||||
description: "A cookie containing a JWT based refreh token. Attention: Doesn't work in swagger-ui. Use /api/auth/login or /api/auth/refresh to get one."
|
description: "A cookie containing a JWT based refreh token. Attention: Doesn't work in swagger-ui. Use /api/auth/login or /api/auth/refresh to get one."
|
||||||
|
},
|
||||||
|
"StatsApiToken": {
|
||||||
|
"type": "http",
|
||||||
|
"scheme": "bearer",
|
||||||
|
description: "Api token that can be obtained by creating a new stats client (post to /api/statsclients)."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user