Skip to content

Commit

Permalink
Fixes linter errors
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 ca8b4ef commit f63bbf2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
1 change: 0 additions & 1 deletion common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export const ANONYMOUS_AUTH_LOGIN = '/auth/anonymous';
export const AUTH_REQUEST_TYPE_HEADER = 'auth_request_type';
export const SAML_AUTH_REQUEST_TYPE = 'saml';


export const OPENID_AUTH_LOGOUT = '/auth/openid/logout';
export const SAML_AUTH_LOGOUT = '/auth/saml/logout';
export const ANONYMOUS_AUTH_LOGOUT = '/auth/anonymous/logout';
Expand Down
2 changes: 1 addition & 1 deletion server/auth/types/basic/basic_auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class BasicAuthentication extends AuthenticationType {
request: OpenSearchDashboardsRequest
): any {
if (this.config.auth.anonymous_auth_enabled && cookie.isAnonymousAuth) {
return { };
return {};
}
const headers: any = {};
Object.assign(headers, { authorization: cookie.credentials?.authHeaderValue });
Expand Down
2 changes: 1 addition & 1 deletion server/auth/types/basic/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export class BasicAuthRoutes {
}
context.security_plugin.logger.info('The Redirect Path is ' + redirectUrl);
try {
user = await this.securityClient.authenticateWithHeaders(request, { });
user = await this.securityClient.authenticateWithHeaders(request, {});
} catch (error) {
context.security_plugin.logger.error(
`Failed authentication: ${error}. Redirecting to Login Page`
Expand Down
7 changes: 6 additions & 1 deletion server/auth/types/saml/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ import { SecurityPluginConfigType } from '../../..';
import { SecurityClient } from '../../../backend/opensearch_security_client';
import { CoreSetup } from '../../../../../../src/core/server';
import { validateNextUrl } from '../../../utils/next_url';
import { AuthType, SAML_AUTH_LOGIN, SAML_AUTH_LOGOUT, SAML_AUTH_REQUEST_TYPE } from '../../../../common';
import {
AuthType,
SAML_AUTH_LOGIN,
SAML_AUTH_LOGOUT,
SAML_AUTH_REQUEST_TYPE,
} from '../../../../common';

import {
clearSplitCookies,
Expand Down
3 changes: 1 addition & 2 deletions server/backend/opensearch_security_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { User } from '../auth/user';
import { TenancyConfigSettings } from '../../public/apps/configuration/panels/tenancy-config/types';
import { AUTH_REQUEST_TYPE_HEADER, SAML_AUTH_REQUEST_TYPE } from '../../common';


export class SecurityClient {
constructor(private readonly esClient: ILegacyClusterClient) {}

Expand Down Expand Up @@ -55,7 +54,7 @@ export class SecurityClient {
headerValue: string,
authRequestType: string | undefined,
whitelistedHeadersAndValues: any = {},
additionalAuthHeaders: any = {},
additionalAuthHeaders: any = {}
): Promise<User> {
try {
const credentials: any = {
Expand Down
6 changes: 2 additions & 4 deletions test/jest_integration/basic_auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ describe('start OpenSearch Dashboards server', () => {
});

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

Expand All @@ -160,8 +159,7 @@ describe('start OpenSearch Dashboards server', () => {
});

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

Expand Down

0 comments on commit f63bbf2

Please sign in to comment.