Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/auth server api change #71

Merged
merged 4 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage: base image
FROM node:20.11-bullseye-slim as base
FROM node:20.11-bookworm-slim as base

ARG BUILD_NUMBER
ARG GIT_REF
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"security_audit": "npx audit-ci --config audit-ci.json",
"int-test": "cypress run --config video=false",
"int-test-ui": "cypress open --e2e --browser chrome",
"clean": "rm -rf dist build node_modules stylesheets"
"clean": "rm -rf dist build node_modules stylesheets",
"rebuild": "npm run clean && npm i && npm run build"
},
"engines": {
"node": "^20",
Expand Down
3 changes: 1 addition & 2 deletions server/mappers/baseClientApi/addBaseClient.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { BaseClient } from '../../interfaces/baseClientApi/baseClient'
import { AddBaseClientRequest } from '../../interfaces/baseClientApi/baseClientRequestBody'
import { daysRemaining } from '../../utils/utils'
import { GrantTypes } from '../../data/enums/grantTypes'

export default (baseClient: BaseClient): AddBaseClientRequest => {
return {
Expand All @@ -13,7 +12,7 @@ export default (baseClient: BaseClient): AddBaseClientRequest => {
databaseUserName: baseClient.clientCredentials.databaseUserName,
validDays: baseClient.config.expiryDate ? daysRemaining(baseClient.config.expiryDate) : null,
accessTokenValidityMinutes: baseClient.accessTokenValidity ? baseClient.accessTokenValidity / 60 : null,
grantType: baseClient.grantType === GrantTypes.ClientCredentials ? 'CLIENT_CREDENTIALS' : 'AUTHORIZATION_CODE',
grantType: baseClient.grantType,
mfa: baseClient.authorisationCode.mfa,
mfaRememberMe: baseClient.authorisationCode.mfaRememberMe,
jwtFields: baseClient.authorisationCode.jwtFields,
Expand Down
4 changes: 1 addition & 3 deletions server/mappers/baseClientApi/getBaseClient.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { GetBaseClientResponse } from '../../interfaces/baseClientApi/baseClientResponse'
import { BaseClient, DeploymentDetails } from '../../interfaces/baseClientApi/baseClient'
import { GrantTypes } from '../../data/enums/grantTypes'
import { ClientType } from '../../data/enums/clientTypes'
import { HostingType } from '../../data/enums/hostingTypes'
import { snake } from '../../utils/utils'
Expand All @@ -10,8 +9,7 @@ export default (response: GetBaseClientResponse): BaseClient => {
baseClientId: response.clientId,
accessTokenValidity: response.accessTokenValidityMinutes ? response.accessTokenValidityMinutes * 60 : 0,
scopes: response.scopes ? response.scopes : [],
grantType:
response.grantType === 'CLIENT_CREDENTIALS' ? GrantTypes.ClientCredentials : GrantTypes.AuthorizationCode,
grantType: snake(response.grantType),
audit: response.jiraNumber ? response.jiraNumber : '',
count: 1,
clientCredentials: {
Expand Down
3 changes: 1 addition & 2 deletions server/mappers/baseClientApi/updateBaseClient.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { BaseClient } from '../../interfaces/baseClientApi/baseClient'
import { UpdateBaseClientRequest } from '../../interfaces/baseClientApi/baseClientRequestBody'
import { daysRemaining } from '../../utils/utils'
import { GrantTypes } from '../../data/enums/grantTypes'

export default (baseClient: BaseClient): UpdateBaseClientRequest => {
return {
Expand All @@ -12,7 +11,7 @@ export default (baseClient: BaseClient): UpdateBaseClientRequest => {
databaseUserName: baseClient.clientCredentials.databaseUserName,
validDays: baseClient.config.expiryDate ? daysRemaining(baseClient.config.expiryDate) : null,
accessTokenValidityMinutes: baseClient.accessTokenValidity ? baseClient.accessTokenValidity / 60 : null,
grantType: baseClient.grantType === GrantTypes.ClientCredentials ? 'CLIENT_CREDENTIALS' : 'AUTHORIZATION_CODE',
grantType: baseClient.grantType,
mfa: baseClient.authorisationCode.mfa,
mfaRememberMe: baseClient.authorisationCode.mfaRememberMe,
jwtFields: baseClient.authorisationCode.jwtFields,
Expand Down