-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[kbn-test] call Kibana API to fetch current user profile #186279
[kbn-test] call Kibana API to fetch current user profile #186279
Conversation
/ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did add a couple of questions, but LGTM.
|
||
test(`'getUserData' should call security API and return user profile data`, async () => { | ||
const testData: UserProfile = { | ||
username: '6ta90xc', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a hashed value or smth?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cloud generates unique string so I just put a random one. The most important to show it is not related to role/email/full name
@@ -117,6 +134,15 @@ describe('SamlSessionManager', () => { | |||
|
|||
test(`doesn't throw error when supportedRoles is not defined`, async () => { | |||
const nonExistingRole = 'tester'; | |||
const testData: UserProfile = { | |||
username: '6ta90xc', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above? What is this value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just random string, user has no control over it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah got it, thanks mate!
/ci |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Public APIs missing exports
History
To update your PR or re-run it, just comment with: |
) Related to elastic#185870 In this PR I move user_profile fetching out of SAML session creation to its `sessionManager.getUserData()`: - rely on Kibana Security API for both local/Kibana CI and MKI cases (currently it is cloud and cached on saml session creation) - do not cache profile data in test service, Kibana API is fast enough I deleted the tests that no longer relevant
Related to #185870
In this PR I move user_profile fetching out of SAML session creation to its
sessionManager.getUserData()
:I deleted the tests that no longer relevant