File size: 848 Bytes
f8b5d42 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
const { validApiKey } = require("../../../utils/middleware/validApiKey");
function apiAuthEndpoints(app) {
if (!app) return;
app.get("/v1/auth", [validApiKey], (_, response) => {
/*
#swagger.tags = ['Authentication']
#swagger.description = 'Verify the attached Authentication header contains a valid API token.'
#swagger.responses[200] = {
description: 'Valid auth token was found.',
content: {
"application/json": {
schema: {
type: 'object',
example: {
authenticated: true,
}
}
}
}
}
#swagger.responses[403] = {
schema: {
"$ref": "#/definitions/InvalidAPIKey"
}
}
*/
response.status(200).json({ authenticated: true });
});
}
module.exports = { apiAuthEndpoints };
|