Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract application of access:uptime from API endpoint implementation #154

Closed
justinkambic opened this issue Feb 28, 2020 · 0 comments · Fixed by elastic/kibana#62576
Closed
Assignees
Labels
enhancement New feature or request

Comments

@justinkambic
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants