Skip to content

Commit

Permalink
Update to accept/send accessTokenValidity to api in seconds, not minu…
Browse files Browse the repository at this point in the history
…tes (#79)
  • Loading branch information
thomasridd authored Feb 26, 2024
1 parent daf41ef commit bff25d6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion server/data/localMockData/baseClientsResponseMock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const getBaseClientResponseMock: (grantType: GrantTypes) => GetBaseClient
ips: [],
jiraNumber: 'jiraNumber',
validDays: 1,
accessTokenValidityMinutes: 60,
accessTokenValiditySeconds: 3600,
deployment: {
clientType: 'service',
team: 'deployment team',
Expand Down
4 changes: 2 additions & 2 deletions server/interfaces/baseClientApi/baseClientRequestBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface AddBaseClientRequest {
jiraNumber?: string
databaseUserName?: string
validDays?: number
accessTokenValidityMinutes?: number
accessTokenValiditySeconds?: number
grantType?: string
mfa?: string
mfaRememberMe?: boolean
Expand All @@ -21,7 +21,7 @@ export interface UpdateBaseClientRequest {
jiraNumber?: string
databaseUserName?: string
validDays?: number
accessTokenValidityMinutes?: number
accessTokenValiditySeconds?: number
grantType?: string
mfa?: string
mfaRememberMe?: boolean
Expand Down
2 changes: 1 addition & 1 deletion server/interfaces/baseClientApi/baseClientResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface GetBaseClientResponse {
jiraNumber?: string
databaseUserName?: string
validDays?: number
accessTokenValidityMinutes?: number
accessTokenValiditySeconds?: number
grantType?: string
mfa?: string
mfaRememberMe?: boolean
Expand Down
2 changes: 1 addition & 1 deletion server/mappers/baseClientApi/addBaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default (baseClient: BaseClient): AddBaseClientRequest => {
jiraNumber: baseClient.audit,
databaseUserName: baseClient.clientCredentials.databaseUserName,
validDays: baseClient.config.expiryDate ? daysRemaining(baseClient.config.expiryDate) : null,
accessTokenValidityMinutes: baseClient.accessTokenValidity ? baseClient.accessTokenValidity / 60 : null,
accessTokenValiditySeconds: baseClient.accessTokenValidity ? baseClient.accessTokenValidity : null,
grantType: baseClient.grantType,
mfa: baseClient.authorisationCode.mfa,
mfaRememberMe: baseClient.authorisationCode.mfaRememberMe,
Expand Down
2 changes: 1 addition & 1 deletion server/mappers/baseClientApi/getBaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { snake } from '../../utils/utils'
export default (response: GetBaseClientResponse): BaseClient => {
return {
baseClientId: response.clientId,
accessTokenValidity: response.accessTokenValidityMinutes ? response.accessTokenValidityMinutes * 60 : 0,
accessTokenValidity: response.accessTokenValiditySeconds ? response.accessTokenValiditySeconds : 0,
scopes: response.scopes ? response.scopes : [],
grantType: snake(response.grantType),
audit: response.jiraNumber ? response.jiraNumber : '',
Expand Down
2 changes: 1 addition & 1 deletion server/mappers/baseClientApi/updateBaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default (baseClient: BaseClient): UpdateBaseClientRequest => {
jiraNumber: baseClient.audit,
databaseUserName: baseClient.clientCredentials.databaseUserName,
validDays: baseClient.config.expiryDate ? daysRemaining(baseClient.config.expiryDate) : null,
accessTokenValidityMinutes: baseClient.accessTokenValidity ? baseClient.accessTokenValidity / 60 : null,
accessTokenValiditySeconds: baseClient.accessTokenValidity ? baseClient.accessTokenValidity : null,
grantType: baseClient.grantType,
mfa: baseClient.authorisationCode.mfa,
mfaRememberMe: baseClient.authorisationCode.mfaRememberMe,
Expand Down

0 comments on commit bff25d6

Please sign in to comment.