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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 1.9.2

### New features

- Certificate templates now support multi-page SVGs using <g data-page="X">...</g>, allowing implementors to configure and render multi-page certificates.
- Birth certificate PDF export now omits header, footer, and QR code; example SVG updated for security-paper templates.

## 1.9.1

### Breaking changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Source: https://www.ssh-audit.com/hardening_guides.html#ubuntu_24_04_lts
# Restrict key exchange, cipher, and MAC algorithms, as per sshaudit.com hardening guide.
KexAlgorithms [email protected],gss-curve25519-sha256-,curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256,gss-group16-sha512-,diffie-hellman-group16-sha512
KexAlgorithms [email protected],curve25519-sha256,[email protected],diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512
Ciphers [email protected],[email protected],aes256-ctr,aes192-ctr,[email protected],aes128-ctr
MACs [email protected],[email protected],[email protected]
RequiredRSASize 3072
HostKeyAlgorithms [email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256
CASignatureAlgorithms [email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256
GSSAPIKexAlgorithms gss-curve25519-sha256-,gss-group16-sha512-
#GSSAPIKexAlgorithms gss-curve25519-sha256-,gss-group16-sha512-
HostbasedAcceptedAlgorithms [email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256
PubkeyAcceptedAlgorithms [email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256
PubkeyAcceptedAlgorithms [email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencrvs/countryconfig",
"version": "1.9.1",
"version": "1.9.2",
"description": "OpenCRVS country configuration for reference data",
"os": [
"darwin",
Expand Down Expand Up @@ -69,7 +69,7 @@
"@hapi/boom": "^9.1.1",
"@hapi/hapi": "^20.0.1",
"@hapi/inert": "^6.0.3",
"@opencrvs/toolkit": "1.9.0-rc.79b0f42",
"@opencrvs/toolkit": "1.9.2",
"@types/chalk": "^2.2.0",
"@types/csv2json": "^1.4.0",
"@types/fhir": "^0.0.30",
Expand Down
154 changes: 50 additions & 104 deletions src/api/certificates/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,24 @@ export interface ICertificateConfigData {
| undefined
}

const notoSansFont: Record<string, FontFamilyTypes> = {
'Noto Sans': {
normal: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bold: '/api/countryconfig/fonts/NotoSans-Bold.ttf',
italics: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bolditalics: '/api/countryconfig/fonts/NotoSans-Regular.ttf'
}
}

const libreBaskervilleFont: Record<string, FontFamilyTypes> = {
'Libre Baskerville': {
normal: '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf',
bold: '/api/countryconfig/fonts/LibreBaskerville-Bold.ttf',
italics: '/api/countryconfig/fonts/LibreBaskerville-Italic.ttf',
bolditalics: '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf'
}
}

export async function certificateHandler(request: Request, h: ResponseToolkit) {
if (request.params.id) {
const filePath = `${__dirname}/source/${request.params.id}`
Expand All @@ -71,14 +89,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
delayed: 15
},
svgUrl: '/api/countryconfig/certificates/birth-certificate.svg',
fonts: {
'Libre Baskerville': {
normal: '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf',
bold: '/api/countryconfig/fonts/LibreBaskerville-Bold.ttf',
italics: '/api/countryconfig/fonts/LibreBaskerville-Italic.ttf',
bolditalics: '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf'
}
}
fonts: libreBaskervilleFont
},
{
id: 'birth-certificate-certified-copy',
Expand All @@ -96,14 +107,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
},
svgUrl:
'/api/countryconfig/certificates/birth-certificate-certified-copy.svg',
fonts: {
'Noto Sans': {
normal: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bold: '/api/countryconfig/fonts/NotoSans-Bold.ttf',
italics: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bolditalics: '/api/countryconfig/fonts/NotoSans-Regular.ttf'
}
},
fonts: notoSansFont,
conditionals: [
{
type: 'SHOW',
Expand All @@ -127,14 +131,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
delayed: 18
},
svgUrl: '/api/countryconfig/certificates/birth-registration-receipt.svg',
fonts: {
'Noto Sans': {
normal: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bold: '/api/countryconfig/fonts/NotoSans-Bold.ttf',
italics: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bolditalics: '/api/countryconfig/fonts/NotoSans-Regular.ttf'
}
}
fonts: notoSansFont
},
{
id: 'death-certificate',
Expand All @@ -151,14 +148,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
delayed: 12
},
svgUrl: '/api/countryconfig/certificates/death-certificate.svg',
fonts: {
'Noto Sans': {
normal: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bold: '/api/countryconfig/fonts/NotoSans-Bold.ttf',
italics: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bolditalics: '/api/countryconfig/fonts/NotoSans-Regular.ttf'
}
}
fonts: notoSansFont
},
{
id: 'death-certificate-certified-copy',
Expand All @@ -176,14 +166,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
},
svgUrl:
'/api/countryconfig/certificates/death-certificate-certified-copy.svg',
fonts: {
'Noto Sans': {
normal: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bold: '/api/countryconfig/fonts/NotoSans-Bold.ttf',
italics: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bolditalics: '/api/countryconfig/fonts/NotoSans-Regular.ttf'
}
},
fonts: notoSansFont,
conditionals: [
{
type: 'SHOW',
Expand All @@ -207,14 +190,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
delayed: 13.5
},
svgUrl: '/api/countryconfig/certificates/marriage-certificate.svg',
fonts: {
'Noto Sans': {
normal: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bold: '/api/countryconfig/fonts/NotoSans-Bold.ttf',
italics: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bolditalics: '/api/countryconfig/fonts/NotoSans-Regular.ttf'
}
}
fonts: notoSansFont
},
{
id: 'marriage-certificate-certified-copy',
Expand All @@ -232,14 +208,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
},
svgUrl:
'/api/countryconfig/certificates/marriage-certificate-certified-copy.svg',
fonts: {
'Noto Sans': {
normal: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bold: '/api/countryconfig/fonts/NotoSans-Bold.ttf',
italics: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bolditalics: '/api/countryconfig/fonts/NotoSans-Regular.ttf'
}
}
fonts: notoSansFont
},
{
id: 'v2.birth-certificate',
Expand All @@ -257,14 +226,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
delayed: 18
},
svgUrl: '/api/countryconfig/certificates/v2.birth-certificate.svg',
fonts: {
'Libre Baskerville': {
normal: '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf',
bold: '/api/countryconfig/fonts/LibreBaskerville-Bold.ttf',
italics: '/api/countryconfig/fonts/LibreBaskerville-Italic.ttf',
bolditalics: '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf'
}
},
fonts: notoSansFont,
conditionals: [
{
type: 'SHOW',
Expand All @@ -289,14 +251,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
},
svgUrl:
'/api/countryconfig/certificates/v2.birth-certificate-certified-copy.svg',
fonts: {
'Libre Baskerville': {
normal: '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf',
bold: '/api/countryconfig/fonts/LibreBaskerville-Bold.ttf',
italics: '/api/countryconfig/fonts/LibreBaskerville-Italic.ttf',
bolditalics: '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf'
}
},
fonts: libreBaskervilleFont,
conditionals: [
{
type: 'SHOW',
Expand Down Expand Up @@ -325,14 +280,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
},
svgUrl:
'/api/countryconfig/certificates/v2.tennis-club-membership-certificate.svg',
fonts: {
'Noto Sans': {
normal: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bold: '/api/countryconfig/fonts/NotoSans-Bold.ttf',
italics: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bolditalics: '/api/countryconfig/fonts/NotoSans-Regular.ttf'
}
},
fonts: notoSansFont,
conditionals: [
{
type: 'SHOW',
Expand All @@ -358,14 +306,26 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
},
svgUrl:
'/api/countryconfig/certificates/v2.tennis-club-membership-certified-certificate.svg',
fonts: {
'Noto Sans': {
normal: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bold: '/api/countryconfig/fonts/NotoSans-Bold.ttf',
italics: '/api/countryconfig/fonts/NotoSans-Regular.ttf',
bolditalics: '/api/countryconfig/fonts/NotoSans-Regular.ttf'
}
}
fonts: notoSansFont
},
{
id: 'v2.tennis-club-membership-certificate-multipage',
event: Event.TENNIS_CLUB_MEMBERSHIP,
isV2Template: true,
label: {
id: 'certificates.tennis-club-membership.certificate.multipage',
defaultMessage: 'Tennis Club Membership Certificate Multipage',
description: 'The label for a tennis club membership certificate'
},
isDefault: false,
fee: {
onTime: 7,
late: 10.6,
delayed: 18
},
svgUrl:
'/api/countryconfig/certificates/v2.tennis-club-membership-certificate-multipage.svg',
fonts: libreBaskervilleFont
},
{
id: 'v2.death-certificate',
Expand All @@ -383,14 +343,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
delayed: 18
},
svgUrl: '/api/countryconfig/certificates/v2.death-certificate.svg',
fonts: {
'Libre Baskerville': {
normal: '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf',
bold: '/api/countryconfig/fonts/LibreBaskerville-Bold.ttf',
italics: '/api/countryconfig/fonts/LibreBaskerville-Italic.ttf',
bolditalics: '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf'
}
}
fonts: libreBaskervilleFont
},
{
id: 'v2.death-certified-certificate',
Expand All @@ -409,14 +362,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
},
svgUrl:
'/api/countryconfig/certificates/v2.death-certificate-certified-copy.svg',
fonts: {
'Libre Baskerville': {
normal: '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf',
bold: '/api/countryconfig/fonts/LibreBaskerville-Bold.ttf',
italics: '/api/countryconfig/fonts/LibreBaskerville-Italic.ttf',
bolditalics: '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf'
}
}
fonts: libreBaskervilleFont
}
]
return certificateConfigs
Expand Down
Loading
Loading