Today, when we create a REST API endpoint, we specify a number of options like so:
export const createGetMonitorDurationRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({
method: 'GET',
path: '/api/uptime/monitor/duration',
validate: {
query: schema.object({ ... }),
},
options: {
tags: ['access:uptime'],
},
handler: async ({ callES }, _context, request, response): Promise<any> => { ... },
});
Under options, we specify a tags field with access:uptime as the sole item. We need to specify this for all of our API functions, and it shouldn't be up to the implementer to make sure it gets done, as we already have a wrapper function that abstractions some other parts of the route creation.
We should add this abstraction to our existing wrapper.