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

Committing changes for v10 pipeline migration #239

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@Library('defra-library@v-9') _
@Library('defra-library@v-10') _

buildNodeJs()
12 changes: 8 additions & 4 deletions app/config/database.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { DefaultAzureCredential } = require('@azure/identity')
const { DefaultAzureCredential, getBearerTokenProvider } = require('@azure/identity')

const isProd = () => {
return process.env.NODE_ENV === 'production'
Expand All @@ -7,9 +7,13 @@ const isProd = () => {
const hooks = {
beforeConnect: async (cfg) => {
if (isProd()) {
const credential = new DefaultAzureCredential()
const accessToken = await credential.getToken('https://ossrdbms-aad.database.windows.net', { requestOptions: { timeout: 1000 } })
cfg.password = accessToken.token
const dbAuthEndpoint = 'https://ossrdbms-aad.database.windows.net/.default'
const credential = new DefaultAzureCredential({ managedIdentityClientId: process.env.AZURE_CLIENT_ID })
const tokenProvider = getBearerTokenProvider(
credential,
dbAuthEndpoint
)
cfg.password = tokenProvider
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions app/config/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const schema = Joi.object({
username: Joi.string(),
password: Joi.string(),
useCredentialChain: Joi.bool().default(false),
appInsights: Joi.object()
appInsights: Joi.object(),
managedIdentityClientId: Joi.string().optional()
},
processingSubscription: {
address: Joi.string().required(),
Expand Down Expand Up @@ -64,7 +65,8 @@ const config = {
username: process.env.MESSAGE_QUEUE_USER,
password: process.env.MESSAGE_QUEUE_PASSWORD,
useCredentialChain: process.env.NODE_ENV === 'production',
appInsights: process.env.NODE_ENV === 'production' ? require('applicationinsights') : undefined
appInsights: process.env.NODE_ENV === 'production' ? require('applicationinsights') : undefined,
managedIdentityClientId: process.env.AZURE_CLIENT_ID
},
processingSubscription: {
address: process.env.PROCESSING_SUBSCRIPTION_ADDRESS,
Expand Down
12 changes: 12 additions & 0 deletions appconfig/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
container.processingTopicAddress: queue:ffc-pay-processing
container.acknowledgementTopicAddress: queue:ffc-pay-acknowledgement
container.returnTopicAddress: queue:ffc-pay-return
container.paymentSubmitTopicAddress: queue:ffc-pay-submit
container.debtTopicAddress: queue:ffc-pay-debt-data
container.qcTopicAddress: queue:ffc-pay-debt-data-response
container.manualCheckTopicAddress: queue:ffc-pay-manual-check-data
container.qcManualCheckTopicAddress: queue:ffc-pay-quality-check
container.xbTopicAddress: queue:ffc-pay-xb
container.xbResponseTopicAddress: queue:ffc-pay-xb-response
container.eventTopicAddress: queue:ffc-pay-event
container.eventsTopicAddress: queue:ffc-pay-events
Empty file added appconfig/dev.yaml
Empty file.
Empty file.
Empty file added appconfig/prd.yaml
Empty file.
Empty file added appconfig/pre.yaml
Empty file.
Empty file added appconfig/snd2.yaml
Empty file.
Empty file added appconfig/test.yaml
Empty file.
2 changes: 1 addition & 1 deletion helm/ffc-pay-processing/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ name: ffc-pay-processing
version: 1.0.0
dependencies:
- name: ffc-helm-library
version: 4.0.0
version: 4.7.2
repository: https://raw.githubusercontent.com/defra/ffc-helm-repository/master/
5 changes: 0 additions & 5 deletions helm/ffc-pay-processing/templates/azure-identity-binding.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions helm/ffc-pay-processing/templates/azure-identity.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions helm/ffc-pay-processing/templates/service-account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{- include "ffc-helm-library.service-account" (list . "ffc-pay-processing.service-account") -}}
{{- define "ffc-pay-processing.service-account" -}}
{{- end -}}
2 changes: 1 addition & 1 deletion helm/ffc-pay-processing/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ livenessProbe:
failureThreshold: 5
timeoutSeconds: 30

aadPodIdentity: true
workloadIdentity: true

azureIdentity:
clientID: not-a-real-clientID
Expand Down
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ module.exports = {
'<rootDir>/node_modules/',
'<rootDir>/test-output/',
'<rootDir>/test/',
'<rootDir>/jest.config.js'
'<rootDir>/jest.config.js',
'<rootDir>/app/config'
],
modulePathIgnorePatterns: [
'node_modules'
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffc-pay-processing",
"version": "2.55.40",
"version": "2.55.41",
"description": "Payment Hub processing service",
"homepage": "https://github.com/DEFRA/ffc-pay-processing",
"main": "app/index.js",
Expand All @@ -26,7 +26,8 @@
"Steve Dickinson steve.dickinson@defra.gov.uk",
"Kirsten Williamson kirsten.williamson@kainos.com",
"Sam Plackett samuel.plackett@eviden.com",
"Leigh Godson leigh.godson@eviden.com"
"Leigh Godson leigh.godson@eviden.com",
"Oliver Lewington oliver.lewington@eviden.com"
],
"license": "OGL-UK-3.0",
"dependencies": {
Expand Down
48 changes: 37 additions & 11 deletions provision.azure.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,39 @@
resources:
identity: pay-processing
postgreSql:
name: ffc-pay-processing
topics:
- name: processing
- name: acknowledgement
- name: return
- name: debt
- name: qc
- name: paymentSubmit
- name: qcManualCheck
- name: manualCheck
- name: event
- name: xb
- name: xbResponse
- name: ffc-pay-processing
role: receiver
subscriptions:
- name: ffc-pay-processing
- name: ffc-pay-acknowledgement
role: receiver
subscriptions:
- name: ffc-pay-processing
- name: ffc-pay-return
role: receiver
subscriptions:
- name: ffc-pay-processing
- name: ffc-pay-debt-data-response
role: receiver
subscriptions:
- name: ffc-pay-processing
- name: ffc-pay-quality-check
role: receiver
subscriptions:
- name: ffc-pay-processing
- name: ffc-pay-xb-response
role: receiver
subscriptions:
- name: ffc-pay-processing
- name: ffc-pay-submit
role: sender
- name: ffc-pay-debt-data
role: sender
- name: ffc-pay-manual-check-data
role: sender
- name: ffc-pay-event
role: sender
- name: ffc-pay-events
role: sender
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sonar.javascript.exclusions=**/jest.config.js,**/__mocks__/**,**/node_modules/**,**/test/**,**/test-output/**
sonar.javascript.exclusions=**/jest.config.js,**/__mocks__/**,**/node_modules/**,**/test/**,**/test-output/**,**/app/config/**
sonar.javascript.lcov.reportPaths=test-output/lcov.info
sonar.exclusions=/test/**,**/*.test.js,*snyk_report.html,*snyk_report.css