Skip to content

Commit

Permalink
feat(paths): adjust path naming
Browse files Browse the repository at this point in the history
Refs: #226
  • Loading branch information
Phil91 committed Aug 14, 2024
1 parent 3ded6d4 commit 3f925f6
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 36 deletions.
8 changes: 4 additions & 4 deletions charts/ssi-credential-issuer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ dependencies:
| processesworker.wallet.clientId | string | `"wallet-client-id"` | Provide wallet client-id from CX IAM centralidp. |
| processesworker.wallet.clientSecret | string | `""` | Client-secret for wallet client-id. Secret-key 'wallet-client-secret'. |
| processesworker.wallet.application | string | `"catena-x-portal"` | the application set in the wallet |
| processesworker.wallet.credentialCreationPath | string | `"api/v2.0.0/credentials"` | path to create a credential |
| processesworker.wallet.signingCreationPath | string | `"/api/v2.0.0/credentials/{0}"` | path to sign a specific credential {0} will be replaced by the credential id |
| processesworker.wallet.getCreationPath | string | `"/api/v2.0.0/credentials/{0}"` | path to get a specific credential {0} will be replaced by the credential id |
| processesworker.wallet.revokeCreationPath | string | `"/api/v2.0.0/credentials/{0}"` | path to revoke a specific credential {0} will be replaced by the credential id |
| processesworker.wallet.createCredentialPath | string | `"api/v2.0.0/credentials"` | path to create a credential |
| processesworker.wallet.signCredentialPath | string | `"/api/v2.0.0/credentials/{0}"` | path to sign a specific credential; {0} will be replaced by the credential id |
| processesworker.wallet.getCredentialPath | string | `"/api/v2.0.0/credentials/{0}"` | path to get a specific credential; {0} will be replaced by the credential id |
| processesworker.wallet.revokeCredentialPath | string | `"/api/v2.0.0/credentials/{0}"` | path to revoke a specific credential; {0} will be replaced by the credential id |
| credentialExpiry.name | string | `"expiry"` | |
| credentialExpiry.image.name | string | `"docker.io/tractusx/ssi-credential-expiry-app"` | |
| credentialExpiry.image.tag | string | `""` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ spec:
key: "credential-encryption-key0"
- name: "WALLET__WALLETAPPLICATION"
value: "{{ .Values.processesworker.wallet.application }}"
- name: "WALLET__CREDENTIALCREATIONPATH"
value: "{{ .Values.processesworker.wallet.credentialCreationPath }}"
- name: "WALLET__SIGNINGCREDENTIALPATH"
value: "{{ .Values.processesworker.wallet.signingCreationPath }}"
- name: "WALLET__CREATECREDENTIALPATH"
value: "{{ .Values.processesworker.wallet.createCredentialPath }}"
- name: "WALLET__SIGNCREDENTIALPATH"
value: "{{ .Values.processesworker.wallet.signCredentialPath }}"
- name: "WALLET__GETCREDENTIALPATH"
value: "{{ .Values.processesworker.wallet.getCreationPath }}"
value: "{{ .Values.processesworker.wallet.getCredentialPath }}"
- name: "WALLET__REVOKECREDENTIALPATH"
value: "{{ .Values.processesworker.wallet.revokeCreationPath }}"
value: "{{ .Values.processesworker.wallet.revokeCredentialPath }}"
- name: "SERILOG__MINIMUMLEVEL__Default"
value: "{{ .Values.processesworker.logging.default }}"
- name: "PROCESSES__IDENTITYID"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ spec:
key: "credential-encryption-key0"
- name: "WALLET__WALLETAPPLICATION"
value: "{{ .Values.processesworker.wallet.application }}"
- name: "WALLET__CREDENTIALCREATIONPATH"
value: "{{ .Values.processesworker.wallet.credentialCreationPath }}"
- name: "WALLET__SIGNINGCREDENTIALPATH"
value: "{{ .Values.processesworker.wallet.signingCreationPath }}"
- name: "WALLET__CREATECREDENTIALPATH"
value: "{{ .Values.processesworker.wallet.createCredentialPath }}"
- name: "WALLET__SIGNCREDENTIALPATH"
value: "{{ .Values.processesworker.wallet.signCredentialPath }}"
- name: "WALLET__GETCREDENTIALPATH"
value: "{{ .Values.processesworker.wallet.getCreationPath }}"
value: "{{ .Values.processesworker.wallet.getCredentialPath }}"
- name: "WALLET__REVOKECREDENTIALPATH"
value: "{{ .Values.processesworker.wallet.revokeCreationPath }}"
value: "{{ .Values.processesworker.wallet.revokeCredentialPath }}"
ports:
- name: http
containerPort: {{ .Values.portContainer }}
Expand Down
14 changes: 7 additions & 7 deletions charts/ssi-credential-issuer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ processesworker:
# -- the application set in the wallet
application: "catena-x-portal"
# -- path to create a credential
credentialCreationPath: "api/v2.0.0/credentials"
# -- path to sign a specific credential {0} will be replaced by the credential id
signingCreationPath: "/api/v2.0.0/credentials/{0}"
# -- path to get a specific credential {0} will be replaced by the credential id
getCreationPath: "/api/v2.0.0/credentials/{0}"
# -- path to revoke a specific credential {0} will be replaced by the credential id
revokeCreationPath: "/api/v2.0.0/credentials/{0}"
createCredentialPath: "api/v2.0.0/credentials"
# -- path to sign a specific credential; {0} will be replaced by the credential id
signCredentialPath: "/api/v2.0.0/credentials/{0}"
# -- path to get a specific credential; {0} will be replaced by the credential id
getCredentialPath: "/api/v2.0.0/credentials/{0}"
# -- path to revoke a specific credential; {0} will be replaced by the credential id
revokeCredentialPath: "/api/v2.0.0/credentials/{0}"

credentialExpiry:
name: "expiry"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public class WalletSettings : BasicAuthSettings
public string WalletApplication { get; set; } = null!;

[Required]
public string CredentialCreationPath { get; set; } = null!;
public string CreateCredentialPath { get; set; } = null!;

[Required]
public string SigningCredentialPath { get; set; } = null!;
public string SignCredentialPath { get; set; } = null!;

[Required]
public string GetCredentialPath { get; set; } = null!;
Expand Down
8 changes: 4 additions & 4 deletions src/externalservices/Wallet.Service/Services/WalletService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task<Guid> CreateCredential(JsonDocument payload, CancellationToken
{
using var client = await basicAuthTokenService.GetBasicAuthorizedClient<WalletService>(_settings, cancellationToken);
var data = new CreateCredentialRequest(_settings.WalletApplication, new CredentialPayload(payload));
var result = await client.PostAsJsonAsync(_settings.CredentialCreationPath, data, Options, cancellationToken)
var result = await client.PostAsJsonAsync(_settings.CreateCredentialPath, data, Options, cancellationToken)
.CatchingIntoServiceExceptionFor("create-credential", HttpAsyncResponseMessageExtension.RecoverOptions.INFRASTRUCTURE,
async x => (false, await x.Content.ReadAsStringAsync().ConfigureAwait(ConfigureAwaitOptions.None)))
.ConfigureAwait(false);
Expand All @@ -57,7 +57,7 @@ public async Task<string> SignCredential(Guid credentialId, CancellationToken ca
{
using var client = await basicAuthTokenService.GetBasicAuthorizedClient<WalletService>(_settings, cancellationToken);
var data = new SignCredentialRequest(new SignPayload(new SignUpdate("external", "jwt")));
var result = await client.PatchAsJsonAsync(string.Format(_settings.SigningCredentialPath, credentialId), data, Options, cancellationToken)
var result = await client.PatchAsJsonAsync(string.Format(_settings.SignCredentialPath, credentialId), data, Options, cancellationToken)
.CatchingIntoServiceExceptionFor("sign-credential", HttpAsyncResponseMessageExtension.RecoverOptions.INFRASTRUCTURE,
async x => (false, await x.Content.ReadAsStringAsync().ConfigureAwait(ConfigureAwaitOptions.None)))
.ConfigureAwait(false);
Expand All @@ -73,7 +73,7 @@ public async Task<string> SignCredential(Guid credentialId, CancellationToken ca
public async Task<JsonDocument> GetCredential(Guid externalCredentialId, CancellationToken cancellationToken)
{
using var client = await basicAuthTokenService.GetBasicAuthorizedClient<WalletService>(_settings, cancellationToken);
var result = await client.GetAsync(string.Format(_settings.SigningCredentialPath, externalCredentialId), cancellationToken)
var result = await client.GetAsync(string.Format(_settings.GetCredentialPath, externalCredentialId), cancellationToken)
.CatchingIntoServiceExceptionFor("get-credential", HttpAsyncResponseMessageExtension.RecoverOptions.INFRASTRUCTURE,
async x => (false, await x.Content.ReadAsStringAsync().ConfigureAwait(ConfigureAwaitOptions.None)))
.ConfigureAwait(false);
Expand All @@ -96,7 +96,7 @@ public async Task<Guid> CreateCredentialForHolder(string holderWalletUrl, string
};
using var client = await basicAuthTokenService.GetBasicAuthorizedClient<WalletService>(authSettings, cancellationToken);
var data = new DeriveCredentialData(_settings.WalletApplication, new DeriveCredentialPayload(new DeriveCredential(credential)));
var result = await client.PostAsJsonAsync(_settings.CredentialCreationPath, data, Options, cancellationToken)
var result = await client.PostAsJsonAsync(_settings.CreateCredentialPath, data, Options, cancellationToken)
.CatchingIntoServiceExceptionFor("create-holder-credential", HttpAsyncResponseMessageExtension.RecoverOptions.INFRASTRUCTURE,
async x => (false, await x.Content.ReadAsStringAsync().ConfigureAwait(ConfigureAwaitOptions.None)))
.ConfigureAwait(false);
Expand Down
4 changes: 2 additions & 2 deletions src/issuer/SsiCredentialIssuer.Service/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
"EncryptionConfigIndex": 0,
"EncryptionConfigs": [],
"WalletApplication": "",
"CredentialCreationPath": "",
"SigningCredentialPath": "",
"CreateCredentialPath": "",
"SignCredentialPath": "",
"GetCredentialPath": "",
"RevokeCredentialPath": ""
},
Expand Down
2 changes: 1 addition & 1 deletion src/processes/Processes.Worker/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"EncryptionConfigIndex": 0,
"EncryptionConfigs": [],
"WalletApplication": "",
"CredentialCreationPath": "",
"CreateCredentialPath": "",
"SigningCredentialPath": "",
"GetCredentialPath": "",
"RevokeCredentialPath": ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public WalletServiceTests()
TokenAddress = "https://example.org/token",
EncryptionConfigIndex = 0,
WalletApplication = "catena-x-portal",
CredentialCreationPath = "api/v2.0.0/credentials",
SigningCredentialPath = "/api/v2.0.0/credentials/{0}",
CreateCredentialPath = "api/v2.0.0/credentials",
SignCredentialPath = "/api/v2.0.0/credentials/{0}",
GetCredentialPath = "/api/v2.0.0/credentials/{0}",
RevokeCredentialPath = "/api/v2.0.0/credentials/{0}"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
}
],
"WalletApplication": "catena-x-portal",
"CredentialCreationPath": "api/v2.0.0/credentials",
"SigningCredentialPath": "/api/v2.0.0/credentials/{0}",
"CreateCredentialPath": "api/v2.0.0/credentials",
"SignCredentialPath": "/api/v2.0.0/credentials/{0}",
"GetCredentialPath": "/api/v2.0.0/credentials/{0}",
"RevokeCredentialPath": "/api/v2.0.0/credentials/{0}"
}
Expand Down

0 comments on commit 3f925f6

Please sign in to comment.