Skip to content
Draft
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
788bd0d
feat: integration of holder request and requested cred status check i…
thackerronak Jun 20, 2025
0b858ad
feat: new endpoint path added
thackerronak Jun 20, 2025
65cc838
feat: unit test cases added for request cred
thackerronak Jun 20, 2025
aad3436
feat: unit test cases added for check credential status
thackerronak Jun 20, 2025
343bb4f
feat: auto approval flow added
thackerronak Jul 2, 2025
30d9acf
test: dcp issuance flow unit cases added
thackerronak Jul 3, 2025
3772f3a
fix: expiration date check updated
thackerronak Jul 14, 2025
50cdfef
fix: successful check updated
thackerronak Jul 14, 2025
24b5de4
fix: env added
thackerronak Jul 16, 2025
dd776b3
fix: byow flow
thackerronak Jul 17, 2025
43f00f2
fix: callback url issue
thackerronak Jul 18, 2025
d7625ac
feat: added documentation and fixed some warnings
thackerronak Jul 24, 2025
1fb4d51
feat: integration of holder request and requested cred status check i…
thackerronak Jun 20, 2025
363007f
feat: new endpoint path added
thackerronak Jun 20, 2025
ffa8181
feat: unit test cases added for request cred
thackerronak Jun 20, 2025
c326fa8
feat: unit test cases added for check credential status
thackerronak Jun 20, 2025
1233de3
feat: auto approval flow added
thackerronak Jul 2, 2025
899f438
test: dcp issuance flow unit cases added
thackerronak Jul 3, 2025
858ea14
fix: expiration date check updated
thackerronak Jul 14, 2025
e1c3e6a
fix: successful check updated
thackerronak Jul 14, 2025
8cd2e03
fix: env added
thackerronak Jul 16, 2025
61c2bd4
fix: byow flow
thackerronak Jul 17, 2025
2e6b402
fix: callback url issue
thackerronak Jul 18, 2025
358174d
feat: added documentation and fixed some warnings
thackerronak Jul 24, 2025
c95ef37
Merge branch 'feat/CS-3566-dcp-integration' of github.com:Cofinity-X/…
thackerronak Jul 24, 2025
afb74ac
feat: added env configuration
thackerronak Jul 24, 2025
7ba7365
fix: helm docs
nitin-vavdiya Jul 24, 2025
41926b6
fix: variable name
nitin-vavdiya Jul 24, 2025
47b9806
fix: error message container added
thackerronak Jul 30, 2025
8156d92
fix: removed unused imports
thackerronak Jul 30, 2025
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
6 changes: 6 additions & 0 deletions docs/api/issuer-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,12 @@ components:
- RETRIGGER_SAVE_CREDENTIAL_DOCUMENT
- RETRIGGER_CREATE_CREDENTIAL_FOR_HOLDER
- RETRIGGER_TRIGGER_CALLBACK
- REQUEST_CREDENTIAL_FOR_HOLDER
- RETRIGGER_REQUEST_CREDENTIAL_FOR_HOLDER
- REQUEST_CREDENTIAL_STATUS_CHECK
- RETRIGGER_REQUEST_CREDENTIAL_STATUS_CHECK
- REQUEST_CREDENTIAL_AUTO_APPROVE
- RETRIGGER_REQUEST_CREDENTIAL_AUTO_APPROVE
- REVOKE_CREDENTIAL
- TRIGGER_NOTIFICATION
- TRIGGER_MAIL
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2025 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand All @@ -18,6 +18,7 @@
********************************************************************************/

using Microsoft.EntityFrameworkCore;
using Org.Eclipse.TractusX.Portal.Backend.Framework.Models;
using Org.Eclipse.TractusX.SsiCredentialIssuer.DBAccess.Models;
using Org.Eclipse.TractusX.SsiCredentialIssuer.Entities;
using Org.Eclipse.TractusX.SsiCredentialIssuer.Entities.Entities;
Expand All @@ -28,13 +29,14 @@ namespace Org.Eclipse.TractusX.SsiCredentialIssuer.DBAccess.Repositories;

public class CredentialRepository(IssuerDbContext dbContext) : ICredentialRepository
{
public Task<(bool IsIssuerCompany, HolderWalletData HolderWalletData, string? Credential, EncryptionTransformationData EncryptionInformation, string? CallbackUrl)> GetCredentialData(Guid credentialId) =>
public Task<(bool IsIssuerCompany, HolderWalletData HolderWalletData, string? Credential, JsonDocument? CredentialJson, EncryptionTransformationData EncryptionInformation, string? CallbackUrl)> GetCredentialData(Guid credentialId) =>
dbContext.CompanySsiDetails
.Where(x => x.Id == credentialId)
.Select(x => new ValueTuple<bool, HolderWalletData, string?, EncryptionTransformationData, string?>(
.Select(x => new ValueTuple<bool, HolderWalletData, string?, JsonDocument?, EncryptionTransformationData, string?>(
x.Bpnl == x.IssuerBpn,
new HolderWalletData(x.CompanySsiProcessData!.HolderWalletUrl, x.CompanySsiProcessData.ClientId),
x.Credential,
x.CompanySsiProcessData!.Schema,
new EncryptionTransformationData(x.CompanySsiProcessData!.ClientSecret, x.CompanySsiProcessData.InitializationVector, x.CompanySsiProcessData.EncryptionMode),
x.CompanySsiProcessData!.CallbackUrl))
.SingleOrDefaultAsync();
Expand Down Expand Up @@ -113,4 +115,10 @@ public void AttachAndModifyCredential(Guid credentialId, Action<CompanySsiDetail
x.DocumentContent,
x.MediaTypeId))
.SingleOrDefaultAsync();

public Task<(Guid? ExternalCredentialId, JsonDocument? CredentialJson, string? CallbackUrl)> GetCredentialDetailById(Guid credentialId) =>
dbContext.CompanySsiProcessData
.Where(x => x.CompanySsiDetailId == credentialId)
.Select(x => new ValueTuple<Guid?, JsonDocument?, string?>(x.CompanySsiDetail!.ExternalCredentialId, x.Schema, x.CallbackUrl))
.SingleOrDefaultAsync();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2025 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand All @@ -26,7 +26,7 @@ namespace Org.Eclipse.TractusX.SsiCredentialIssuer.DBAccess.Repositories;

public interface ICredentialRepository
{
Task<(bool IsIssuerCompany, HolderWalletData HolderWalletData, string? Credential, EncryptionTransformationData EncryptionInformation, string? CallbackUrl)> GetCredentialData(Guid credentialId);
Task<(bool IsIssuerCompany, HolderWalletData HolderWalletData, string? Credential, JsonDocument? CredentialJson, EncryptionTransformationData EncryptionInformation, string? CallbackUrl)> GetCredentialData(Guid credentialId);
Task<(bool Exists, Guid CredentialId)> GetDataForProcessId(Guid processId);
Task<(VerifiedCredentialTypeKindId CredentialTypeKindId, JsonDocument Schema)> GetCredentialStorageInformationById(Guid credentialId);
Task<(Guid? ExternalCredentialId, VerifiedCredentialTypeKindId KindId, bool HasEncryptionInformation, string? CallbackUrl)> GetExternalCredentialAndKindId(Guid credentialId);
Expand All @@ -36,4 +36,5 @@ public interface ICredentialRepository
Task<(VerifiedCredentialExternalTypeId ExternalTypeId, string RequesterId)> GetCredentialNotificationData(Guid credentialId);
Task<(bool Exists, bool IsSameCompany, IEnumerable<(DocumentStatusId StatusId, byte[] Content)> Documents)> GetSignedCredentialForCredentialId(Guid credentialId, string bpnl);
Task<(bool Exists, bool IsSameCompany, string FileName, DocumentStatusId StatusId, byte[] Content, MediaTypeId MediaTypeId)> GetDocumentById(Guid documentId, string bpnl);
Task<(Guid? ExternalCredentialId, JsonDocument? CredentialJson, string? CallbackUrl)> GetCredentialDetailById(Guid credentialId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/********************************************************************************
* Copyright (c) 2025 Cofinity-X GmbH
* Copyright (c) 2025 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

using Org.Eclipse.TractusX.SsiCredentialIssuer.Entities.Auditing;
using Org.Eclipse.TractusX.SsiCredentialIssuer.Entities.Auditing.Enums;
using Org.Eclipse.TractusX.SsiCredentialIssuer.Entities.Enums;
using System.ComponentModel.DataAnnotations;

namespace Org.Eclipse.TractusX.SsiCredentialIssuer.Entities.AuditEntities;

public class AuditCompanySsiDetail20240618 : IAuditEntityV2
{
/// <inheritdoc />
[Key]
public Guid AuditV2Id { get; set; }

public Guid Id { get; set; }
public string Bpnl { get; set; } = null!;
public string IssuerBpn { get; set; } = null!;
public VerifiedCredentialTypeId VerifiedCredentialTypeId { get; set; }
public CompanySsiDetailStatusId CompanySsiDetailStatusId { get; set; }
public DateTimeOffset DateCreated { get; private set; }
public string CreatorUserId { get; set; } = null!;
public DateTimeOffset? ExpiryDate { get; set; }
public Guid? VerifiedCredentialExternalTypeDetailVersionId { get; set; }

public ExpiryCheckTypeId? ExpiryCheckTypeId { get; set; }
public Guid? ProcessId { get; set; }
public Guid? ExternalCredentialId { get; set; }
public string? Credential { get; set; }
public DateTimeOffset? DateLastChanged { get; set; }
public string? LastEditorId { get; set; }
public Guid? CredentialRequestId { get; set; }
public string? CredentialRequestStatus { get; set; }

/// <inheritdoc />
public string? AuditV2LastEditorId { get; set; }

/// <inheritdoc />
public AuditOperationId AuditV2OperationId { get; set; }

/// <inheritdoc />
public DateTimeOffset AuditV2DateLastChanged { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2025 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand All @@ -25,7 +25,7 @@

namespace Org.Eclipse.TractusX.SsiCredentialIssuer.Entities.Entities;

[AuditEntityV2(typeof(AuditCompanySsiDetail20240419))]
[AuditEntityV2(typeof(AuditCompanySsiDetail20240618))]
public class CompanySsiDetail : IAuditableV2, IBaseEntity
{
private CompanySsiDetail()
Expand Down Expand Up @@ -62,6 +62,8 @@ public CompanySsiDetail(Guid id, string bpnl, VerifiedCredentialTypeId verifiedC
public Guid? ProcessId { get; set; }
public Guid? ExternalCredentialId { get; set; }
public string? Credential { get; set; }
public Guid? CredentialRequestId { get; set; }
public string? CredentialRequestStatus { get; set; }

[LastChangedV2]
public DateTimeOffset? DateLastChanged { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2025 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand All @@ -25,10 +25,16 @@ public enum ProcessStepTypeId
CREATE_SIGNED_CREDENTIAL = 1,
SAVE_CREDENTIAL_DOCUMENT = 3,
CREATE_CREDENTIAL_FOR_HOLDER = 4,
REQUEST_CREDENTIAL_FOR_HOLDER = 10,
REQUEST_CREDENTIAL_STATUS_CHECK = 12,
REQUEST_CREDENTIAL_AUTO_APPROVE = 14,
TRIGGER_CALLBACK = 5,
RETRIGGER_CREATE_SIGNED_CREDENTIAL = 6,
RETRIGGER_SAVE_CREDENTIAL_DOCUMENT = 7,
RETRIGGER_CREATE_CREDENTIAL_FOR_HOLDER = 8,
RETRIGGER_REQUEST_CREDENTIAL_FOR_HOLDER = 11,
RETRIGGER_REQUEST_CREDENTIAL_STATUS_CHECK = 13,
RETRIGGER_REQUEST_CREDENTIAL_AUTO_APPROVE = 15,
RETRIGGER_TRIGGER_CALLBACK = 9,

// DECLINE PROCESS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2025 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand Down Expand Up @@ -29,6 +29,9 @@ public static ProcessStepTypeId GetRetriggerStep(this ProcessStepTypeId processS
ProcessStepTypeId.CREATE_SIGNED_CREDENTIAL => ProcessStepTypeId.RETRIGGER_CREATE_SIGNED_CREDENTIAL,
ProcessStepTypeId.SAVE_CREDENTIAL_DOCUMENT => ProcessStepTypeId.RETRIGGER_SAVE_CREDENTIAL_DOCUMENT,
ProcessStepTypeId.CREATE_CREDENTIAL_FOR_HOLDER => ProcessStepTypeId.RETRIGGER_CREATE_CREDENTIAL_FOR_HOLDER,
ProcessStepTypeId.REQUEST_CREDENTIAL_FOR_HOLDER => ProcessStepTypeId.RETRIGGER_REQUEST_CREDENTIAL_FOR_HOLDER,
ProcessStepTypeId.REQUEST_CREDENTIAL_AUTO_APPROVE => ProcessStepTypeId.RETRIGGER_REQUEST_CREDENTIAL_AUTO_APPROVE,
ProcessStepTypeId.REQUEST_CREDENTIAL_STATUS_CHECK => ProcessStepTypeId.RETRIGGER_REQUEST_CREDENTIAL_STATUS_CHECK,
ProcessStepTypeId.TRIGGER_CALLBACK => ProcessStepTypeId.RETRIGGER_TRIGGER_CALLBACK,
ProcessStepTypeId.REVOKE_CREDENTIAL => ProcessStepTypeId.RETRIGGER_REVOKE_CREDENTIAL,
ProcessStepTypeId.TRIGGER_NOTIFICATION => ProcessStepTypeId.RETRIGGER_TRIGGER_NOTIFICATION,
Expand All @@ -42,6 +45,9 @@ public static (ProcessTypeId processTypeId, ProcessStepTypeId processStepTypeId)
ProcessStepTypeId.RETRIGGER_CREATE_SIGNED_CREDENTIAL => (ProcessTypeId.CREATE_CREDENTIAL, ProcessStepTypeId.CREATE_SIGNED_CREDENTIAL),
ProcessStepTypeId.RETRIGGER_SAVE_CREDENTIAL_DOCUMENT => (ProcessTypeId.CREATE_CREDENTIAL, ProcessStepTypeId.SAVE_CREDENTIAL_DOCUMENT),
ProcessStepTypeId.RETRIGGER_CREATE_CREDENTIAL_FOR_HOLDER => (ProcessTypeId.CREATE_CREDENTIAL, ProcessStepTypeId.CREATE_CREDENTIAL_FOR_HOLDER),
ProcessStepTypeId.RETRIGGER_REQUEST_CREDENTIAL_FOR_HOLDER => (ProcessTypeId.CREATE_CREDENTIAL, ProcessStepTypeId.REQUEST_CREDENTIAL_FOR_HOLDER),
ProcessStepTypeId.RETRIGGER_REQUEST_CREDENTIAL_AUTO_APPROVE => (ProcessTypeId.CREATE_CREDENTIAL, ProcessStepTypeId.REQUEST_CREDENTIAL_AUTO_APPROVE),
ProcessStepTypeId.RETRIGGER_REQUEST_CREDENTIAL_STATUS_CHECK => (ProcessTypeId.CREATE_CREDENTIAL, ProcessStepTypeId.REQUEST_CREDENTIAL_STATUS_CHECK),
ProcessStepTypeId.RETRIGGER_TRIGGER_CALLBACK => (ProcessTypeId.CREATE_CREDENTIAL, ProcessStepTypeId.TRIGGER_CALLBACK),
ProcessStepTypeId.RETRIGGER_REVOKE_CREDENTIAL => (ProcessTypeId.DECLINE_CREDENTIAL, ProcessStepTypeId.REVOKE_CREDENTIAL),
ProcessStepTypeId.RETRIGGER_TRIGGER_NOTIFICATION => (ProcessTypeId.DECLINE_CREDENTIAL, ProcessStepTypeId.TRIGGER_NOTIFICATION),
Expand Down
5 changes: 3 additions & 2 deletions src/database/SsiCredentialIssuer.Entities/IssuerDbContext.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2025 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand Down Expand Up @@ -35,6 +35,7 @@ public class IssuerDbContext(DbContextOptions<IssuerDbContext> options, IAuditHa
public virtual DbSet<AuditDocument20240305> AuditDocument20240305 { get; set; } = default!;
public virtual DbSet<AuditCompanySsiDetail20240419> AuditCompanySsiDetail20240419 { get; set; } = default!;
public virtual DbSet<AuditDocument20240419> AuditDocument20240419 { get; set; } = default!;
public virtual DbSet<AuditCompanySsiDetail20240618> AuditCompanySsiDetail20240618 { get; set; } = default!;
public virtual DbSet<CompanySsiDetail> CompanySsiDetails { get; set; } = default!;
public virtual DbSet<CompanySsiDetailAssignedDocument> CompanySsiDetailAssignedDocuments { get; set; } = default!;
public virtual DbSet<CompanySsiDetailStatus> CompanySsiDetailStatuses { get; set; } = default!;
Expand Down Expand Up @@ -105,7 +106,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
j.HasKey(e => new { e.DocumentId, e.CompanySsiDetailId });
});

entity.HasAuditV2Triggers<CompanySsiDetail, AuditCompanySsiDetail20240419>();
entity.HasAuditV2Triggers<CompanySsiDetail, AuditCompanySsiDetail20240618>();
});

modelBuilder.Entity<CompanySsiDetailStatus>()
Expand Down
Loading
Loading