Skip to content
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
32 changes: 16 additions & 16 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@aws-sdk/client-sns": "^3.972.0",
"@defra/forms-engine-plugin": "^4.0.42",
"@defra/forms-engine-plugin": "^4.0.43",
"@defra/forms-model": "^3.0.601",
"@defra/hapi-tracing": "^1.30.0",
"@elastic/ecs-pino-format": "^1.5.0",
Expand Down
8 changes: 8 additions & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,14 @@ export const config = convict({
env: 'ORDNANCE_SURVEY_API_KEY'
} as SchemaObj<string | undefined>,

ordnanceSurveyApiSecret: {
doc: 'The ordnance survey api secret used by the maps plugin',
format: String,
nullable: true,
default: undefined,
env: 'ORDNANCE_SURVEY_API_SECRET'
} as SchemaObj<string | undefined>,

useMapsFeature: {
doc: 'Feature flag to control maps',
format: Boolean,
Expand Down
3 changes: 2 additions & 1 deletion src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ export const configureEnginePlugin = async ({
SummaryPageWithConfirmationEmailController,
FeedbackPageController
},
ordnanceSurveyApiKey: config.get('ordnanceSurveyApiKey')
ordnanceSurveyApiKey: config.get('ordnanceSurveyApiKey'),
ordnanceSurveyApiSecret: config.get('ordnanceSurveyApiSecret')
}
}
const routeOptions = {
Expand Down
9 changes: 2 additions & 7 deletions src/server/plugins/blankie.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ describe('Server Blankie Plugin', () => {
defaultSrc: ['self'],
fontSrc: ['self', 'data:'],
frameSrc: ['self', 'data:'],
connectSrc: [
'self',
'https://api.os.uk',
'https://test-uploader.cdp-int.defra.cloud'
],
connectSrc: ['self', 'https://test-uploader.cdp-int.defra.cloud'],
scriptSrc: ['self', 'strict-dynamic', 'unsafe-inline'],
styleSrc: ['self', 'unsafe-inline'],
imgSrc: ['self', 'data:'],
Expand All @@ -35,7 +31,6 @@ describe('Server Blankie Plugin', () => {
frameSrc: ['self', 'data:'],
connectSrc: [
'self',
'https://api.os.uk',
'https://*.google-analytics.com',
'https://*.analytics.google.com',
'https://*.googletagmanager.com',
Expand Down Expand Up @@ -76,6 +71,6 @@ describe('Server Blankie Plugin', () => {

const { options } = configureBlankiePlugin()

expect(options?.connectSrc).toEqual(['self', 'https://api.os.uk'])
expect(options?.connectSrc).toEqual(['self'])
})
})
1 change: 0 additions & 1 deletion src/server/plugins/blankie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const configureBlankiePlugin = (): ServerRegisterPluginObject<
fontSrc: ['self', 'data:'],
connectSrc: [
['self'],
['https://api.os.uk'],
gaTrackingId ? googleAnalyticsOptions.connectSrc : [],
uploaderUrl ? [uploaderUrl] : []
].flat(),
Expand Down
Loading