File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,15 +46,12 @@ export function fixSpec({
4646 instance = `${ apiName } -pr-${ pr_id } `
4747 spec . info . title = `[PR-${ pr_id } ] ${ spec . info . title } `
4848 spec [ "x-nhsd-apim" ] . monitoring = false
49- delete spec [ "x-nhsd-apim" ] . target . security . secret
50- } else {
51- if ( blueGreen ) {
52- stack = calculateVersionedStackName ( stackName , version )
53- }
54- spec [ "x-nhsd-apim" ] . target . security . secret = mtlsSecretName
49+ } else if ( blueGreen ) {
50+ stack = calculateVersionedStackName ( stackName , version )
5551 }
5652 spec . info . version = version
5753 spec [ "x-nhsd-apim" ] . target . url = `https://${ stack } .${ awsEnvironment } .eps.national.nhs.uk`
54+ spec [ "x-nhsd-apim" ] . target . security . secret = mtlsSecretName
5855 if ( apigeeEnvironment === "prod" ) {
5956 spec . servers = [ { url : `https://api.service.nhs.uk/${ instance } ` } ]
6057 replaceSchemeRefs ( spec , "proxygen.prod.api.platform.nhs.uk" )
Original file line number Diff line number Diff line change @@ -71,7 +71,6 @@ describe("fixSpec", () => {
7171 expect ( instance ) . toBe ( "eps-pr-456" )
7272 expect ( spec . info . title ) . toBe ( "[PR-456] EPS API" )
7373 expect ( spec [ "x-nhsd-apim" ] . monitoring ) . toBe ( false )
74- expect ( spec [ "x-nhsd-apim" ] . target . security . secret ) . toBeUndefined ( )
7574 expect ( spec [ "x-nhsd-apim" ] [ "target-attributes" ] ) . toBeUndefined ( )
7675 expect ( spec . servers [ 0 ] . url )
7776 . toBe ( "https://sandbox.api.service.nhs.uk/eps-pr-456" )
You can’t perform that action at this time.
0 commit comments