Skip to content

Commit 0549a52

Browse files
committed
Lint
Signed-off-by: Derek Ho <dxho@amazon.com>
1 parent 529ded1 commit 0549a52

File tree

7 files changed

+26
-13
lines changed

7 files changed

+26
-13
lines changed

server/auth/types/authentication_type.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export abstract class AuthenticationType implements IAuthenticationType {
279279
): SecuritySessionCookie;
280280
public abstract getKeepAliveExpiry(
281281
cookie: SecuritySessionCookie,
282-
request: OpenSearchDashboardsRequest,
282+
request: OpenSearchDashboardsRequest
283283
): number;
284284
public abstract isValidCookie(
285285
cookie: SecuritySessionCookie,

server/auth/types/basic/basic_auth.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ export class BasicAuthentication extends AuthenticationType {
101101
);
102102
}
103103

104-
getKeepAliveExpiry(cookie: SecuritySessionCookie,
105-
request: OpenSearchDashboardsRequest): number {
104+
getKeepAliveExpiry(cookie: SecuritySessionCookie, request: OpenSearchDashboardsRequest): number {
106105
return Date.now() + this.config.session.ttl;
107106
}
108107

server/auth/types/jwt/jwt_auth.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,11 @@ export class JwtAuthentication extends AuthenticationType {
180180
);
181181
}
182182

183-
getKeepAliveExpiry(cookie: SecuritySessionCookie,
184-
request: OpenSearchDashboardsRequest): number {
185-
return getExpirationDate(this.buildAuthHeaderFromCookie(cookie,request)[this.authHeaderName], Date.now() + this.config.session.ttl);
183+
getKeepAliveExpiry(cookie: SecuritySessionCookie, request: OpenSearchDashboardsRequest): number {
184+
return getExpirationDate(
185+
this.buildAuthHeaderFromCookie(cookie, request)[this.authHeaderName],
186+
Date.now() + this.config.session.ttl
187+
);
186188
}
187189

188190
handleUnauthedRequest(

server/auth/types/multiple/multi_auth.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,16 @@ export class MultipleAuthentication extends AuthenticationType {
130130
return {};
131131
}
132132

133-
getKeepAliveExpiry(cookie: SecuritySessionCookie, request: OpenSearchDashboardsRequest<unknown, unknown, unknown, any>): number {
133+
getKeepAliveExpiry(
134+
cookie: SecuritySessionCookie,
135+
request: OpenSearchDashboardsRequest<unknown, unknown, unknown, any>
136+
): number {
134137
const reqAuthType = cookie?.authType?.toLowerCase();
135138
if (reqAuthType && this.authHandlers.has(reqAuthType)) {
136139
return this.authHandlers.get(reqAuthType)!.getKeepAliveExpiry(cookie, request);
137140
} else {
138141
// default to TTL setting
139-
return Date.now() + this.config.session.ttl
142+
return Date.now() + this.config.session.ttl;
140143
}
141144
}
142145

server/auth/types/openid/openid_auth.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,11 @@ export class OpenIdAuthentication extends AuthenticationType {
252252
}
253253

254254
// OIDC expiry time is set by the IDP and refreshed via refreshTokens
255-
getKeepAliveExpiry(cookie: SecuritySessionCookie, request: OpenSearchDashboardsRequest<unknown, unknown, unknown, any>): number {
256-
return cookie.expiryTime!
255+
getKeepAliveExpiry(
256+
cookie: SecuritySessionCookie,
257+
request: OpenSearchDashboardsRequest<unknown, unknown, unknown, any>
258+
): number {
259+
return cookie.expiryTime!;
257260
}
258261

259262
// TODO: Add token expiration check here

server/auth/types/proxy/proxy_auth.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ export class ProxyAuthentication extends AuthenticationType {
7373
: false;
7474
}
7575

76-
public getKeepAliveExpiry(cookie: SecuritySessionCookie, request: OpenSearchDashboardsRequest<unknown, unknown, unknown, any>): number {
76+
public getKeepAliveExpiry(
77+
cookie: SecuritySessionCookie,
78+
request: OpenSearchDashboardsRequest<unknown, unknown, unknown, any>
79+
): number {
7780
return Date.now() + this.config.session.ttl;
7881
}
7982

server/auth/types/saml/saml_auth.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,11 @@ export class SamlAuthentication extends AuthenticationType {
131131
}
132132

133133
// SAML expiry time is set by the IDP and returned via the security backend. Keep alive should not modify this value.
134-
public getKeepAliveExpiry(cookie: SecuritySessionCookie, request: OpenSearchDashboardsRequest<unknown, unknown, unknown, any>): number {
135-
return cookie.expiryTime!
134+
public getKeepAliveExpiry(
135+
cookie: SecuritySessionCookie,
136+
request: OpenSearchDashboardsRequest<unknown, unknown, unknown, any>
137+
): number {
138+
return cookie.expiryTime!;
136139
}
137140

138141
getCookie(request: OpenSearchDashboardsRequest, authInfo: any): SecuritySessionCookie {

0 commit comments

Comments
 (0)