Skip to content

Commit

Permalink
Fixes basic auth tests
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
  • Loading branch information
DarshitChanpura committed Mar 21, 2024
1 parent 43c8499 commit 573c715
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions test/jest_integration/basic_auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,7 @@ describe('start OpenSearch Dashboards server', () => {
expect(response.status).toEqual(200);
});

it('cannot access home page as anonymous user if no credentials are supplied', async () => {
const response = await osdTestServer.request
.get(root, '/app/home#/')
.unset(AUTHORIZATION_HEADER_NAME);
expect(response.status).toEqual(302);
});

it('can access home page as anonymous user', async () => {
const response = await osdTestServer.request.get(root, '/app/home#/');
expect(response.status).toEqual(200);
});

it('call authinfo API as admin', async () => {
const testUserCredentials = Buffer.from(ADMIN_CREDENTIALS);
const response = await osdTestServer.request
.get(root, '/api/v1/auth/authinfo')
.set(AUTHORIZATION_HEADER_NAME, ADMIN_CREDENTIALS);
Expand All @@ -158,11 +145,6 @@ describe('start OpenSearch Dashboards server', () => {
expect(response.status).toEqual(401);
});

it('call authinfo API as anonymous user', async () => {
const response = await osdTestServer.request.get(root, '/api/v1/auth/authinfo');
expect(response.status).toEqual(200);
});

it('call authinfo API with cookie', async () => {
const authCookie = await getAuthCookie(root, ADMIN_USER, ADMIN_PASSWORD);

Expand Down

0 comments on commit 573c715

Please sign in to comment.