Add tests for the concurrent refresh token requests.#62027
Add tests for the concurrent refresh token requests.#62027azasypkin merged 4 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/kibana-security (Team:Security) |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
| it('should refresh access token even if multiple concurrent requests try to refresh it', async () => { | ||
| // Send 5 concurrent requests with a cookie that contains an expired access token. | ||
| await Promise.all( | ||
| Array.from({ length: 5 }).map((value, index) => |
There was a problem hiding this comment.
question is there any value to testing that the token we get is the same for all 5 of these requests?
There was a problem hiding this comment.
I'm not sure, technically it's internal implementation detail of Elasticsearch/Kibana and for consumer it doesn't really matter whether we get the same or different tokens as long as they are valid. But even if think it's worth it, we'll need to add code that decrypts cookie in tests and extracts token from it relying on internal cookie structure. Or you meant something else?
There was a problem hiding this comment.
I'm not sure, technically it's internal implementation detail of Elasticsearch/Kibana and for consumer it doesn't really matter whether we get the same or different tokens as long as they are valid.
I guess my concern was making sure they were all valid. If we happen to get different tokens back in different requests, can we be sure that they'll all work correctly? You're right that it's an implementation detail...I was considering taking a defensive approach here, given all of the session timeout issues we've had to triage lately.
At the end of the day, it's not a huge deal to me one way or another. I'm fine to leave these as-is if it's too complex to decrypt and check, or if you don't think it's worthwhile to do.
|
@elasticmachine merge upstream |
💔 Build Failed
Failed CI StepsTest FailuresKibana Pipeline / kibana-oss-agent / Chrome UI Functional Tests.test/functional/apps/visualize/_area_chart·js.visualize app area charts axis scaling does not scale top hit aggStandard OutStack TraceKibana Pipeline / kibana-oss-agent / Chrome UI Functional Tests.test/functional/apps/visualize/_area_chart·js.visualize app area charts axis scaling does not scale top hit aggStandard OutStack TraceKibana Pipeline / kibana-xpack-agent / X-Pack Kerberos API with Anonymous Access Integration Tests.x-pack/test/kerberos_api_integration/apis/security/kerberos_login·ts.apis Kerberos security Kerberos authentication finishing SPNEGO should properly set cookie and authenticate userStandard OutStack TraceHistory
To update your PR or re-run it, just comment with: |
Once elastic/elasticsearch#54289 is fixed we'd need to add a couple of tests to make sure it works as expected in Kibana context.