From f88a756d1eb08d8ae78f055a0e2d7fd37af76766 Mon Sep 17 00:00:00 2001 From: Benjamin Bengfort Date: Thu, 30 Jan 2025 14:41:23 -0600 Subject: [PATCH] add sunrise configuration --- charts/envoy/Chart.yaml | 4 +- charts/envoy/examples/alice.yaml | 15 +++ charts/envoy/templates/_environment.tpl | 30 ++++++ charts/envoy/values.schema.json | 126 ++++++++++++++++++++++++ charts/envoy/values.yaml | 36 +++++++ 5 files changed, 209 insertions(+), 2 deletions(-) diff --git a/charts/envoy/Chart.yaml b/charts/envoy/Chart.yaml index 25972e0..a3f8255 100644 --- a/charts/envoy/Chart.yaml +++ b/charts/envoy/Chart.yaml @@ -15,13 +15,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.22.0 +version: 0.23.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v0.27.1" +appVersion: "v0.28.0" dependencies: - name: "regioninfo" diff --git a/charts/envoy/examples/alice.yaml b/charts/envoy/examples/alice.yaml index 348c7b0..704ede0 100644 --- a/charts/envoy/examples/alice.yaml +++ b/charts/envoy/examples/alice.yaml @@ -65,6 +65,21 @@ trisa: endpoint: "https://trp.alice.vaspbot.net/" useMTLS: "false" + sunrise: + enabled: "true" + requireOTP: "false" + + email: + sender: + name: "Alice VASP Compliance" + email: "compliance@alice.vaspbot.net" + + supportEmail: "support@alice.vaspbot.net" + complianceEmail: "compliance@alice.vaspbot.net" + + sendgrid: + apiKey: "notarealsendgridapikey" + # Because TRISA is a globally distributed system, region deployment information is # useful information on the node. This information can be provided via config map or # manually specified in the values.yaml -- behavior is not defined for when both are diff --git a/charts/envoy/templates/_environment.tpl b/charts/envoy/templates/_environment.tpl index 28f4335..09afd8a 100644 --- a/charts/envoy/templates/_environment.tpl +++ b/charts/envoy/templates/_environment.tpl @@ -226,6 +226,36 @@ env: value: {{ .Values.trisa.trp.identity.vaspName | quote }} - name: TRISA_TRP_IDENTITY_LEI value: {{ .Values.trisa.trp.identity.lei | quote }} + - name: TRISA_SUNRISE_ENABLED + value: {{ .Values.trisa.sunrise.enabled | quote }} + - name: TRISA_SUNRISE_REQUIRE_OTP + value: {{ .Values.trisa.sunrise.requireOTP | quote }} + - name: TRISA_EMAIL_SENDER + value: {{ .Values.trisa.email.sender.email | quote }} + - name: TRISA_EMAIL_SENDER_NAME + value: {{ .Values.trisa.email.sender.name | quote }} + - name: TRISA_EMAIL_SUPPORT_EMAIL + value: {{ .Values.trisa.email.supportEmail | quote }} + - name: TRISA_EMAIL_COMPLIANCE_EMAIL + value: {{ .Values.trisa.email.complianceEmail | quote }} + {{- if .Values.trisa.email.smtp.host }} + - name: TRISA_EMAIL_SMTP_HOST + value: {{ .Values.trisa.email.smtp.host | quote }} + - name: TRISA_EMAIL_SMTP_PORT + value: {{ .Values.trisa.email.smtp.port | quote }} + - name: TRISA_EMAIL_SMTP_USERNAME + value: {{ .Values.trisa.email.smtp.username | quote }} + - name: TRISA_EMAIL_SMTP_PASSWORD + value: {{ .Values.trisa.email.smtp.password | quote }} + - name: TRISA_EMAIL_SMTP_USE_CRAM_MD5 + value: {{ .Values.trisa.email.smtp.useCRAMMD5 | quote }} + - name: TRISA_EMAIL_SMTP_POOL_SIZE + value: {{ .Values.trisa.email.smtp.poolSize | quote }} + {{- end }} + {{- if .Values.trisa.email.sendgrid.apiKey }} + - name: TRISA_EMAIL_SENDGRID_API_KEY + value: {{ .Values.trisa.email.sendgrid.apiKey | quote }} + {{- end}} {{- if .Values.regioninfo.enabled }} {{- $configMap := default "region-info" .Values.regioninfo.configMap }} - name: REGION_INFO_ID diff --git a/charts/envoy/values.schema.json b/charts/envoy/values.schema.json index 139e8df..bf1f3a2 100644 --- a/charts/envoy/values.schema.json +++ b/charts/envoy/values.schema.json @@ -392,6 +392,132 @@ } } } + }, + "sunrise": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "string", + "default": "false", + "examples": [ + "true", + "false" + ] + }, + "requireOTP": { + "type": "string", + "default": "false", + "examples": [ + "true", + "false" + ] + } + } + }, + "email:": { + "type": "object", + "requried": [], + "properties": { + "sender": { + "type": "object", + "required": ["email"], + "properties": { + "name": { + "type": "string", + "default": "", + "examples": [ + "Compliance Team at VASP" + ] + }, + "email": { + "type": "string", + "default": "", + "examples": [ + "compliance@example.com" + ] + } + } + }, + "supportEmail": { + "type": "string", + "default": "", + "examples": [ + "support@example.com", + "VASP Support " + ] + }, + "complianceEmail": { + "type": "string", + "default": "", + "examples": [ + "compliance@example.com", + "VASP Compliance " + ] + }, + "smtp": { + "type": "object", + "required": ["host"], + "properties": { + "host": { + "type": "string", + "default": "", + "examples": [ + "smtp.example.com" + ] + }, + "port": { + "type": "integer", + "default": 587, + "examples": [ + 587 + ] + }, + "username": { + "type": "string", + "default": "", + "examples": [ + "smtpuser" + ] + }, + "password": { + "type": "string", + "default": "", + "examples": [ + "smtppassword" + ] + }, + "useCRAMMD5": { + "type": "string", + "default": "false", + "examples": [ + "true", + "false" + ] + }, + "poolSize": { + "type": "integer", + "default": 2, + "examples": [ + 2 + ] + } + } + }, + "sendgrid": { + "type": "object", + "required": ["apiKey"], + "properties": { + "apiKey": { + "type": "string", + "default": "", + "examples": [ + "SG.1234567890" + ] + } + } + } + } } } }, diff --git a/charts/envoy/values.yaml b/charts/envoy/values.yaml index bebc65d..05f36fa 100644 --- a/charts/envoy/values.yaml +++ b/charts/envoy/values.yaml @@ -139,6 +139,42 @@ trisa: # LEI of the VASP organization lei: "" + sunrise: + # For sunrise to work it needs to be enabled and there needs to be a valid email + # configuration set so that sunrise emails can be sent. + enabled: "false" + + # OTP requires a secondary verification using a one-time password sent to the email + # address of the contact the sunrise message was sent to. Disable to only use the + # verification token method. + requireOTP: "false" + + # The email configuration allows envoy to send emails via SendGrid or SMTP. + # A valid email configuration is required for sunrise to work. + email: + # The email address that messages are sent from e.g. "Name " + sender: + name: "" + email: "" + + # A support email that is included in the email message and error pages (optional). + supportEmail: "" + + # A compliance email that is included in the email message and VASP info (optional). + complianceEmail: "" + + # Specify either SMTP or SendGrid - not both! + smtp: + host: "" + port: 587 + username: "" + password: "" + useCRAMMD5: "false" + poolSize: 2 + + sendgrid: + apiKey: "" + # Because TRISA is a globally distributed system, region deployment information is # useful information on the node. This information can be provided via config map or # manually specified in the values.yaml -- behavior is not defined for when both are