mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
# Backport This will backport the following commits from `main` to `8.11`: - [action oauth : quieter logs (#171210)](https://github.com/elastic/kibana/pull/171210) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Pierre Gayvallet","email":"pierre.gayvallet@elastic.co"},"sourceCommit":{"committedDate":"2023-11-14T21:19:38Z","message":"action oauth : quieter logs (#171210)\n\n## Summary\r\n\r\nRemove unnecessary details from warning log when fetching an oauth token\r\nthrows an error.","sha":"6ebad69948c9a50b7d6c1c9d790d9e89dc71ba21","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","backport:prev-MAJOR","v8.12.0"],"number":171210,"url":"https://github.com/elastic/kibana/pull/171210","mergeCommit":{"message":"action oauth : quieter logs (#171210)\n\n## Summary\r\n\r\nRemove unnecessary details from warning log when fetching an oauth token\r\nthrows an error.","sha":"6ebad69948c9a50b7d6c1c9d790d9e89dc71ba21"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/171210","number":171210,"mergeCommit":{"message":"action oauth : quieter logs (#171210)\n\n## Summary\r\n\r\nRemove unnecessary details from warning log when fetching an oauth token\r\nthrows an error.","sha":"6ebad69948c9a50b7d6c1c9d790d9e89dc71ba21"}}]}] BACKPORT--> Co-authored-by: Pierre Gayvallet <pierre.gayvallet@elastic.co>
This commit is contained in:
parent
394262848d
commit
8d16b463c4
4 changed files with 4 additions and 8 deletions
|
@ -123,7 +123,7 @@ describe('requestOAuthClientCredentialsToken', () => {
|
|||
|
||||
expect(mockLogger.warn.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
"error thrown getting the access token from https://test for params: {\\"scope\\":\\"test\\",\\"client_id\\":\\"123456\\",\\"client_secret\\":\\"secrert123\\"}: {\\"error\\":\\"invalid_scope\\",\\"error_description\\":\\"AADSTS70011: The provided value for the input parameter 'scope' is not valid.\\"}",
|
||||
"error thrown getting the access token from https://test: {\\"error\\":\\"invalid_scope\\",\\"error_description\\":\\"AADSTS70011: The provided value for the input parameter 'scope' is not valid.\\"}",
|
||||
]
|
||||
`);
|
||||
});
|
||||
|
|
|
@ -125,7 +125,7 @@ describe('requestOAuthJWTToken', () => {
|
|||
|
||||
expect(mockLogger.warn.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
"error thrown getting the access token from https://test for params: {\\"assertion\\":\\"someJWTvalueishere\\",\\"scope\\":\\"test\\",\\"client_id\\":\\"client-id-1\\",\\"client_secret\\":\\"some-client-secret\\"}: {\\"error\\":\\"invalid_scope\\",\\"error_description\\":\\"AADSTS70011: The provided value for the input parameter 'scope' is not valid.\\"}",
|
||||
"error thrown getting the access token from https://test: {\\"error\\":\\"invalid_scope\\",\\"error_description\\":\\"AADSTS70011: The provided value for the input parameter 'scope' is not valid.\\"}",
|
||||
]
|
||||
`);
|
||||
});
|
||||
|
|
|
@ -132,7 +132,7 @@ describe('requestOAuthToken', () => {
|
|||
|
||||
expect(mockLogger.warn.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
"error thrown getting the access token from https://test for params: {\\"client_id\\":\\"123456\\",\\"client_secret\\":\\"secrert123\\",\\"some_additional_param\\":\\"test\\"}: {\\"error\\":\\"invalid_scope\\",\\"error_description\\":\\"AADSTS70011: The provided value for the input parameter 'scope' is not valid.\\"}",
|
||||
"error thrown getting the access token from https://test: {\\"error\\":\\"invalid_scope\\",\\"error_description\\":\\"AADSTS70011: The provided value for the input parameter 'scope' is not valid.\\"}",
|
||||
]
|
||||
`);
|
||||
});
|
||||
|
|
|
@ -52,11 +52,7 @@ export async function requestOAuthToken<T>(
|
|||
};
|
||||
} else {
|
||||
const errString = stringify(res.data);
|
||||
logger.warn(
|
||||
`error thrown getting the access token from ${tokenUrl} for params: ${JSON.stringify(
|
||||
bodyRequest
|
||||
)}: ${errString}`
|
||||
);
|
||||
logger.warn(`error thrown getting the access token from ${tokenUrl}: ${errString}`);
|
||||
throw new Error(errString);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue