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

Expose authorization header parser #152559

Merged

Conversation

thomheymann
Copy link
Contributor

Resolves #152116

Summary

Exposes HTTPAuthorizationHeader interface to allow extracting credentials from request headers.

Example

import { HTTPAuthorizationHeader } from '@kbn/security-plugin/server';

HTTPAuthorizationHeader.parseFromRequest(request);

Returns the following object:

HTTPAuthorizationHeader {
  scheme: 'ApiKey',
  credentials: 'ZmhPUm5JWUItbEhKWktnU2VjWlY6TF9CSDB1c3JSd1NsZkNzZ3kzMnNpdw=='
}

@thomheymann thomheymann added Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! release_note:skip Skip the PR/issue when compiling release notes v8.8.0 labels Mar 2, 2023
@thomheymann thomheymann requested a review from a team as a code owner March 2, 2023 11:58
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
security 89 94 +5
Unknown metric groups

API count

id before after diff
security 269 278 +9

ESLint disabled line counts

id before after diff
securitySolution 428 430 +2

Total ESLint disabled count

id before after diff
securitySolution 506 508 +2

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@azasypkin azasypkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomheymann thomheymann merged commit 9a67404 into elastic:main Mar 7, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Mar 7, 2023
sloanelybutsurely pushed a commit to sloanelybutsurely/kibana that referenced this pull request Mar 8, 2023
Resolves elastic#152116

## Summary

Exposes HTTPAuthorizationHeader interface to allow extracting
credentials from request headers.

## Example

```ts
import { HTTPAuthorizationHeader } from '@kbn/security-plugin/server';

HTTPAuthorizationHeader.parseFromRequest(request);
```

Returns the following object:

```
HTTPAuthorizationHeader {
  scheme: 'ApiKey',
  credentials: 'ZmhPUm5JWUItbEhKWktnU2VjWlY6TF9CSDB1c3JSd1NsZkNzZ3kzMnNpdw=='
}
```
bmorelli25 pushed a commit to bmorelli25/kibana that referenced this pull request Mar 10, 2023
Resolves elastic#152116

## Summary

Exposes HTTPAuthorizationHeader interface to allow extracting
credentials from request headers.

## Example

```ts
import { HTTPAuthorizationHeader } from '@kbn/security-plugin/server';

HTTPAuthorizationHeader.parseFromRequest(request);
```

Returns the following object:

```
HTTPAuthorizationHeader {
  scheme: 'ApiKey',
  credentials: 'ZmhPUm5JWUItbEhKWktnU2VjWlY6TF9CSDB1c3JSd1NsZkNzZ3kzMnNpdw=='
}
```
nkhristinin pushed a commit that referenced this pull request Mar 22, 2023
Resolves #152116

## Summary

Exposes HTTPAuthorizationHeader interface to allow extracting
credentials from request headers.

## Example

```ts
import { HTTPAuthorizationHeader } from '@kbn/security-plugin/server';

HTTPAuthorizationHeader.parseFromRequest(request);
```

Returns the following object:

```
HTTPAuthorizationHeader {
  scheme: 'ApiKey',
  credentials: 'ZmhPUm5JWUItbEhKWktnU2VjWlY6TF9CSDB1c3JSd1NsZkNzZ3kzMnNpdw=='
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow API Key components to be extracted from the current KibanaRequest
5 participants