Skip to content

Commit

Permalink
Revert "Enforce authentication on api/status route by default (#943)" (
Browse files Browse the repository at this point in the history
…#950)

This reverts commit 6d6c5b7.

Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon authored Apr 16, 2022
1 parent 350e605 commit 25263e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
4 changes: 2 additions & 2 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ export const configSchema = schema.object({
}),
anonymous_auth_enabled: schema.boolean({ defaultValue: false }),
unauthenticated_routes: schema.arrayOf(schema.string(), {
defaultValue: ['/api/reporting/stats'],
defaultValue: ['/api/status', '/api/reporting/stats'],
}),
forbidden_usernames: schema.arrayOf(schema.string(), { defaultValue: [] }),
logout_url: schema.string({ defaultValue: '' }),
}),
basicauth: schema.object({
enabled: schema.boolean({ defaultValue: true }),
unauthenticated_routes: schema.arrayOf(schema.string(), { defaultValue: [] }),
unauthenticated_routes: schema.arrayOf(schema.string(), { defaultValue: ['/api/status'] }),
forbidden_usernames: schema.arrayOf(schema.string(), { defaultValue: [] }),
header_trumps_session: schema.boolean({ defaultValue: false }),
alternative_login: schema.object({
Expand Down
12 changes: 0 additions & 12 deletions test/jest_integration/basic_auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,4 @@ describe('start OpenSearch Dashboards server', () => {

expect(response.status).toEqual(302);
});

it('enforce authentication on api/status route', async () => {
const response = await osdTestServer.request.get(root, '/api/status');
expect(response.status).toEqual(401);
});

it('can access api/status route with admin credential', async () => {
const response = await osdTestServer.request
.get(root, '/api/status')
.set(AUTHORIZATION_HEADER_NAME, ADMIN_CREDENTIALS);
expect(response.status).toEqual(200);
});
});

0 comments on commit 25263e7

Please sign in to comment.