Skip to content

Return a dependable, identifiable error when API Keys are not enabled #47759

Closed
@cjcenizal

Description

@cjcenizal

If xpack.security.authc.api_key.enabled=false then the API keys API responds to requests with this error:

{
  status: 500,
  displayName: 'InternalServerError',
  message: '[illegal_state_exception] api keys are not enabled',
  body: {
    error: {
      root_cause: [
        Array
      ],
      type: 'illegal_state_exception',
      reason: 'api keys are not enabled'
    },
    status: 500
  },
  statusCode: 500
}

Currently, the UI needs to inspect the message string to determine whether the error is due to API keys being disabled or something else. This is brittle because there's no guarantee this message won't change.

This could be addressed by #35665.

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Security/AuthenticationLogging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc)Team:Deployment ManagementMeta label for Management Experience - Deployment Management team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions