Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <dxho@amazon.com>
  • Loading branch information
derek-ho committed Feb 15, 2024
1 parent cf2b4ae commit 52fd304
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion server/auth/types/authentication_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export abstract class AuthenticationType implements IAuthenticationType {
}

// extend session expiration time
if (this.supportsKeepAlive(request) && this.config.session.keepalive) {
if (await this.supportsKeepAlive(request) && this.config.session.keepalive) {

Check failure on line 162 in server/auth/types/authentication_type.ts

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-latest)

Replace `await·this.supportsKeepAlive(request` with `(await·this.supportsKeepAlive(request)`

Check failure on line 162 in server/auth/types/authentication_type.ts

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-latest)

Replace `await·this.supportsKeepAlive(request` with `(await·this.supportsKeepAlive(request)`

Check failure on line 162 in server/auth/types/authentication_type.ts

View workflow job for this annotation

GitHub Actions / Run unit tests (macos-latest)

Replace `await·this.supportsKeepAlive(request` with `(await·this.supportsKeepAlive(request)`
cookie!.expiryTime = Math.max(Date.now() + this.config.session.ttl, cookie.expiryTime || 0);
this.sessionStorageFactory.asScoped(request).set(cookie!);
}
Expand Down Expand Up @@ -287,5 +287,10 @@ export abstract class AuthenticationType implements IAuthenticationType {
response: LifecycleResponseFactory,
toolkit: AuthToolkit
): IOpenSearchDashboardsResponse | AuthResult;
public abstract requestIncludesAuthInfo(request: OpenSearchDashboardsRequest): boolean;
public abstract buildAuthHeaderFromCookie(
cookie: SecuritySessionCookie,
request: OpenSearchDashboardsRequest
): any

Check failure on line 294 in server/auth/types/authentication_type.ts

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-latest)

Insert `;`

Check failure on line 294 in server/auth/types/authentication_type.ts

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-latest)

Insert `;`

Check failure on line 294 in server/auth/types/authentication_type.ts

View workflow job for this annotation

GitHub Actions / Run unit tests (macos-latest)

Insert `;`
public abstract init(): Promise<void>;
}
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 @@ -137,7 +137,7 @@ export class BasicAuthentication extends AuthenticationType {
}
}

buildAuthHeaderFromCookie(cookie: SecuritySessionCookie): any {
buildAuthHeaderFromCookie(cookie: SecuritySessionCookie, request: OpenSearchDashboardsRequest): any {

Check failure on line 140 in server/auth/types/basic/basic_auth.ts

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-latest)

Replace `cookie:·SecuritySessionCookie,·request:·OpenSearchDashboardsRequest` with `⏎····cookie:·SecuritySessionCookie,⏎····request:·OpenSearchDashboardsRequest⏎··`

Check failure on line 140 in server/auth/types/basic/basic_auth.ts

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-latest)

Replace `cookie:·SecuritySessionCookie,·request:·OpenSearchDashboardsRequest` with `␍⏎····cookie:·SecuritySessionCookie,␍⏎····request:·OpenSearchDashboardsRequest␍⏎··`

Check failure on line 140 in server/auth/types/basic/basic_auth.ts

View workflow job for this annotation

GitHub Actions / Run unit tests (macos-latest)

Replace `cookie:·SecuritySessionCookie,·request:·OpenSearchDashboardsRequest` with `⏎····cookie:·SecuritySessionCookie,⏎····request:·OpenSearchDashboardsRequest⏎··`
if (this.config.auth.anonymous_auth_enabled && cookie.isAnonymousAuth) {
return {};
}
Expand Down
2 changes: 1 addition & 1 deletion server/auth/types/proxy/proxy_auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class ProxyAuthentication extends AuthenticationType {
}
}

buildAuthHeaderFromCookie(cookie: SecuritySessionCookie): any {
buildAuthHeaderFromCookie(cookie: SecuritySessionCookie, request: OpenSearchDashboardsRequest): any {

Check failure on line 142 in server/auth/types/proxy/proxy_auth.ts

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-latest)

Replace `cookie:·SecuritySessionCookie,·request:·OpenSearchDashboardsRequest` with `⏎····cookie:·SecuritySessionCookie,⏎····request:·OpenSearchDashboardsRequest⏎··`

Check failure on line 142 in server/auth/types/proxy/proxy_auth.ts

View workflow job for this annotation

GitHub Actions / Run unit tests (windows-latest)

Replace `cookie:·SecuritySessionCookie,·request:·OpenSearchDashboardsRequest` with `␍⏎····cookie:·SecuritySessionCookie,␍⏎····request:·OpenSearchDashboardsRequest␍⏎··`

Check failure on line 142 in server/auth/types/proxy/proxy_auth.ts

View workflow job for this annotation

GitHub Actions / Run unit tests (macos-latest)

Replace `cookie:·SecuritySessionCookie,·request:·OpenSearchDashboardsRequest` with `⏎····cookie:·SecuritySessionCookie,⏎····request:·OpenSearchDashboardsRequest⏎··`
const authHeaders: any = {};
if (get(cookie.credentials, this.userHeaderName)) {
authHeaders[this.userHeaderName] = cookie.credentials[this.userHeaderName];
Expand Down

0 comments on commit 52fd304

Please sign in to comment.