mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Refresh .security-tokens
index in tests before simulating "missing refresh token" scenario. (#163466)
## Summary
Elasticsearch no longer refreshes `.security-tokens` index after token
is created, and we need to respect that in the tests that simulate
"expired refresh token" scenario.
Checked locally with:
```bash
ES_SNAPSHOT_MANIFEST="20230808
-202136_29386737/manifest.json"
```
__Caused by: https://github.com/elastic/elasticsearch/pull/98102__
__Fixes: https://github.com/elastic/kibana/issues/163455__
__Fixes: https://github.com/elastic/kibana/issues/163456__
This commit is contained in:
parent
253954c15f
commit
729acf76fd
4 changed files with 17 additions and 4 deletions
|
@ -431,8 +431,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
});
|
||||
|
||||
// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/163456
|
||||
describe.skip('API access with missing access token document or expired refresh token.', () => {
|
||||
describe('API access with missing access token document or expired refresh token.', () => {
|
||||
let sessionCookie: Cookie;
|
||||
|
||||
beforeEach(async () => {
|
||||
|
@ -447,6 +446,9 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
sessionCookie = parseCookie(cookies[0])!;
|
||||
checkCookieIsSet(sessionCookie);
|
||||
|
||||
// Let's make sure that created tokens are available for search.
|
||||
await getService('es').indices.refresh({ index: '.security-tokens' });
|
||||
|
||||
// Let's delete tokens from `.security-tokens` index directly to simulate the case when
|
||||
// Elasticsearch automatically removes access/refresh token document from the index after
|
||||
// some period of time.
|
||||
|
|
|
@ -621,6 +621,9 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
it('should properly set cookie and start new OIDC handshake', async function () {
|
||||
// Let's make sure that created tokens are available for search.
|
||||
await getService('es').indices.refresh({ index: '.security-tokens' });
|
||||
|
||||
// Let's delete tokens from `.security-tokens` index directly to simulate the case when
|
||||
// Elasticsearch automatically removes access/refresh token document from the index
|
||||
// after some period of time.
|
||||
|
|
|
@ -593,8 +593,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
});
|
||||
|
||||
// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/163455
|
||||
describe.skip('API access with missing access token document.', () => {
|
||||
describe('API access with missing access token document.', () => {
|
||||
let sessionCookie: Cookie;
|
||||
|
||||
beforeEach(async () => {
|
||||
|
@ -615,6 +614,9 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
sessionCookie = parseCookie(samlAuthenticationResponse.headers['set-cookie'][0])!;
|
||||
|
||||
// Let's make sure that created tokens are available for search.
|
||||
await getService('es').indices.refresh({ index: '.security-tokens' });
|
||||
|
||||
// Let's delete tokens from `.security` index directly to simulate the case when
|
||||
// Elasticsearch automatically removes access/refresh token document from the index
|
||||
// after some period of time.
|
||||
|
@ -700,6 +702,9 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
[
|
||||
'when access token document is missing',
|
||||
async () => {
|
||||
// Let's make sure that created tokens are available for search.
|
||||
await getService('es').indices.refresh({ index: '.security-tokens' });
|
||||
|
||||
const esResponse = await getService('es').deleteByQuery({
|
||||
index: '.security-tokens',
|
||||
body: { query: { match: { doc_type: 'token' } } },
|
||||
|
|
|
@ -189,6 +189,9 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
beforeEach(async () => (sessionCookie = await createSessionCookie()));
|
||||
|
||||
it('should clear cookie and redirect to login', async function () {
|
||||
// Let's make sure that created tokens are available for search.
|
||||
await getService('es').indices.refresh({ index: '.security-tokens' });
|
||||
|
||||
// Let's delete tokens from `.security` index directly to simulate the case when
|
||||
// Elasticsearch automatically removes access/refresh token document from the index
|
||||
// after some period of time.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue