-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix creating PDF reports in x-pack without authentication context (#4358
) * Added default hashUsername to xpack without authContext * changelog: add PR entry Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com> Co-authored-by: Antonio <34042064+Desvelao@users.noreply.github.com> (cherry picked from commit 72af12c)
- Loading branch information
1 parent
7564f72
commit 59ed124
Showing
4 changed files
with
10 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import { ISecurityFactory } from '../'; | ||
import { ELASTIC_NAME } from '../../../../common/constants'; | ||
import { KibanaRequest, RequestHandlerContext } from 'src/core/server'; | ||
import md5 from 'md5'; | ||
|
||
export class DefaultFactory implements ISecurityFactory{ | ||
platform: string = ''; | ||
async getCurrentUser(request: KibanaRequest, context?:RequestHandlerContext) { | ||
return { | ||
username: 'elastic', | ||
authContext: { username: 'elastic' }, | ||
hashUsername: md5('elastic') | ||
username: ELASTIC_NAME, | ||
authContext: { username: ELASTIC_NAME }, | ||
hashUsername: md5(ELASTIC_NAME) | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters