Skip to content

Commit

Permalink
#EXUI-2656: passport js rollout needs serviceOverride flag
Browse files Browse the repository at this point in the history
  • Loading branch information
MunishSharmaHMCTS committed Dec 19, 2024
1 parent 0bbdbd0 commit 813373b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/rpx-xui-node-lib",
"version": "2.29.7",
"version": "2.29.7-exui-2656-rc1",
"description": "Common nodejs library components for XUI",
"main": "dist/index",
"types": "dist/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/auth/models/authOptions.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface AuthOptions {
allowRolesRegex?: string
useCSRF?: boolean
routeCredential?: RouteCredential
serviceOverride?: boolean
}

export interface RouteCredential {
Expand Down
2 changes: 2 additions & 0 deletions src/auth/models/strategy.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export abstract class Strategy extends events.EventEmitter {
allowRolesRegex: '.',
useCSRF: true,
routeCredential: undefined,
serviceOverride: false,
}

protected constructor(strategyName: string, router: Router, logger: XuiLogger = getLogger('auth:strategy')) {
Expand Down Expand Up @@ -69,6 +70,7 @@ export abstract class Strategy extends events.EventEmitter {
customHeaders: Joi.any(),
allowRolesRegex: Joi.string(),
useCSRF: Joi.bool(),
serviceOverride: Joi.bool(),
routeCredential: Joi.any(),
})
const { error } = schema.validate(options)
Expand Down
5 changes: 4 additions & 1 deletion src/auth/oidc/models/openid.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ export class OpenID extends AuthStrategy {
const issuer = await this.discoverIssuer()

const metadata = issuer.metadata
metadata.issuer = this.options.issuerURL
if (!this.options.serviceOverride) {
this.logger.log('setting options issuerURL', this.options.issuerURL)
metadata.issuer = this.options.issuerURL
}

this.logger.log('discover metadata', metadata)

Expand Down

0 comments on commit 813373b

Please sign in to comment.