Skip to content

Commit

Permalink
feat(notification): adjust mail and notification path
Browse files Browse the repository at this point in the history
Refs: #15
  • Loading branch information
Phil91 committed Apr 24, 2024
1 parent 5639bd5 commit 70f8e5e
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,38 @@ spec:
secretKeyRef:
name: "{{ template "issuer.secretName" . }}"
key: "credential-encryption-key0"
- name: "WALLET__BASEADDRESS"
value: "{{ .Values.walletAddress }}"
- name: "WALLET__CLIENTID"
value: "{{ .Values.processesworker.wallet.clientId }}"
- name: "WALLET__CLIENTSECRET"
valueFrom:
secretKeyRef:
name: "{{ template "issuer.secretName" . }}"
key: "wallet-client-secret"
- name: "WALLET__GRANTTYPE"
value: "{{ .Values.processesworker.wallet.grantType }}"
- name: "WALLET__TOKENADDRESS"
value: "{{ .Values.walletTokenAddress }}"
- name: "WALLET__PASSWORD"
value: "empty"
- name: "WALLET__SCOPE"
value: "{{ .Values.processesworker.wallet.scope }}"
- name: "WALLET__USERNAME"
value: "empty"
- name: "WALLET__ENCRYPTIONCONFIG__ENCRYPTIONCONFIGINDEX"
value: "{{ .Values.processesworker.wallet.encryptionConfigIndex }}"
- name: "WALLET__ENCRYPTIONCONFIGS__0__INDEX"
value: "{{ .Values.processesworker.wallet.encryptionConfigs.index0.index}}"
- name: "WALLET__ENCRYPTIONCONFIGS__0__CIPHERMODE"
value: "{{ .Values.processesworker.wallet.encryptionConfigs.index0.cipherMode}}"
- name: "WALLET__ENCRYPTIONCONFIGS__0__PADDINGMODE"
value: "{{ .Values.processesworker.wallet.encryptionConfigs.index0.paddingMode}}"
- name: "WALLET__ENCRYPTIONCONFIGS__0__ENCRYPTIONKEY"
valueFrom:
secretKeyRef:
name: "{{ template "issuer.secretName" . }}"
key: "process-wallet-encryption-key0"
ports:
- name: http
containerPort: {{ .Values.portContainer }}
Expand Down
4 changes: 2 additions & 2 deletions src/externalservices/Portal.Service/Services/PortalService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public async Task AddNotification(string content, Guid requester, NotificationTy
{
var client = await _tokenService.GetAuthorizedClient<PortalService>(_settings, cancellationToken).ConfigureAwait(false);
var data = new NotificationRequest(requester, content, notificationTypeId);
await client.PostAsJsonAsync("api/notifications/management", data, Options, cancellationToken)
await client.PostAsJsonAsync("api/notifications/ssi-credentials", data, Options, cancellationToken)
.CatchingIntoServiceExceptionFor("notification", HttpAsyncResponseMessageExtension.RecoverOptions.REQUEST_EXCEPTION)
.ConfigureAwait(false);
}
Expand All @@ -53,7 +53,7 @@ public async Task TriggerMail(string template, Guid requester, IEnumerable<MailP
{
var client = await _tokenService.GetAuthorizedClient<PortalService>(_settings, cancellationToken).ConfigureAwait(false);
var data = new MailData(requester, template, mailParameters);
await client.PostAsJsonAsync("api/administration/mail", data, Options, cancellationToken)
await client.PostAsJsonAsync("api/administration/mail/ssi-credentials", data, Options, cancellationToken)
.CatchingIntoServiceExceptionFor("mail", HttpAsyncResponseMessageExtension.RecoverOptions.REQUEST_EXCEPTION)
.ConfigureAwait(false);
}
Expand Down
9 changes: 1 addition & 8 deletions src/issuer/SsiCredentialIssuer.Service/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,6 @@
"StatusListUrl": "",
"MaxPageSize": 15,
"EncryptionConfigIndex": 0,
"EncryptionConfigs": [
{
"Index": 0,
"EncryptionKey": "",
"CipherMode": "",
"PaddingMode": ""
}
]
"EncryptionConfigs": []
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ public async Task ExecuteAsync_WithPendingAndExpiryBeforeNow_DeclinesRequest()
A.CallTo(() => _issuerRepositories.SaveAsync()).MustHaveHappenedOnceExactly();
A.CallTo(() => _processStepRepository.CreateProcess(ProcessTypeId.DECLINE_CREDENTIAL)).MustHaveHappenedOnceExactly();
A.CallTo(() => _processStepRepository.CreateProcessStep(ProcessStepTypeId.REVOKE_CREDENTIAL, ProcessStepStatusId.TODO, A<Guid>._)).MustHaveHappenedOnceExactly();
ssiDetail.CompanySsiDetailStatusId.Should().Be(CompanySsiDetailStatusId.INACTIVE);
}

[Theory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,24 @@
"PaddingMode": "PKCS7"
}
]
},
"Wallet": {
"Username": "empty",
"Password": "empty",
"ClientId": "sa-cl-test",
"GrantType": "client_credentials",
"ClientSecret": "test",
"Scope": "openid",
"TokenAddress": "https://example.org/auth/realms/xy/protocol/openid-connect/token",
"BaseAddress": "https://localhost:5001",
"EncryptionConfigIndex": 0,
"EncryptionConfigs": [
{
"Index": 0,
"EncryptionKey": "9b1503084ab5638260079cb61b8ed2d1fde462b5a7608556516a1659aeb3f541",
"CipherMode": "CBC",
"PaddingMode": "PKCS7"
}
]
}
}

0 comments on commit 70f8e5e

Please sign in to comment.