• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hyperledger / identus-edge-agent-sdk-swift / 10475918581

20 Aug 2024 05:00PM UTC coverage: 43.414% (-0.2%) from 43.578%
10475918581

push

github

amagyar-iohk
test: add backup e2e scenario

Signed-off-by: Allain Magyar <allain.magyar@iohk.io>

test: refactor + revocation

Signed-off-by: Allain Magyar <allain.magyar@iohk.io>

test: adds pending validation for edge agent side

Signed-off-by: Allain Magyar <allain.magyar@iohk.io>

fix: jwt verification

Signed-off-by: Allain Magyar <allain.magyar@iohk.io>

test: more tests

Signed-off-by: Allain Magyar <allain.magyar@iohk.io>

test: zkp negative scenario

Signed-off-by: Allain Magyar <allain.magyar@iohk.io>

undo spaces removal

Signed-off-by: Allain Magyar <allain.magyar@iohk.io>

changes int to date

Signed-off-by: Allain Magyar <allain.magyar@iohk.io>

2 of 49 new or added lines in 4 files covered. (4.08%)

5092 of 11729 relevant lines covered (43.41%)

99.27 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/EdgeAgentSDK/Pollux/Sources/Models/JWT/JWTRevocationStatus.swift
1
import Foundation
2

3
struct JWTRevocationStatus: Codable {
4
    enum CredentialStatusListType: String, Codable {
5
        case statusList2021Entry = "StatusList2021Entry"
6
    }
7
    
8
    enum CredentialStatusPurpose: String, Codable {
9
        case revocation = "Revocation"
10
        case suspension = "Suspension"
11
    }
12
    
13
    let id: String
14
    let type: String
15
    let statusPurpose: CredentialStatusPurpose
16
    let statusListIndex: Int
17
    let statusListCredential: String
18
}
19

20
struct JWTRevocationStatusListCredential: Codable {
21
    enum CodingKeys: String, CodingKey {
22
        case context = "@context"
23
        case type
24
        case issuer
25
        case id
26
        case issuanceDate
27
        case credentialSubject
28
        case proof
29
    }
30
    
31
    struct StatusListCredentialSubject: Codable {
32
        let type: String
33
        let statusPurpose: String
34
        let encodedList: String
35
    }
36
    
37
    let context: Set<String>
38
    let type: Set<String>
39
    let id: String
40
    let issuer: String
41
    let issuanceDate: Date
42
    let credentialSubject: StatusListCredentialSubject
43
    
NEW
44
    func encode(to encoder: any Encoder) throws {
×
NEW
45
        var container = encoder.container(keyedBy: CodingKeys.self)
×
NEW
46
        
×
NEW
47
        try container.encode(self.context, forKey: .context)
×
NEW
48
        try container.encode(self.type, forKey: .type)
×
NEW
49
        try container.encode(self.id, forKey: .id)
×
NEW
50
        try container.encode(self.issuer, forKey: .issuer)
×
NEW
51
        try container.encode(self.issuanceDate, forKey: .issuanceDate)
×
NEW
52
        try container.encode(self.credentialSubject, forKey: .credentialSubject)
×
NEW
53
    }
×
54
    
55
    init(
56
        context: Set<String>,
57
        type: Set<String>,
58
        id: String,
59
        issuer: String,
60
        issuanceDate: Date,
61
        credentialSubject: StatusListCredentialSubject
NEW
62
    ) {
×
NEW
63
        self.context = context
×
NEW
64
        self.type = type
×
NEW
65
        self.id = id
×
NEW
66
        self.issuer = issuer
×
NEW
67
        self.issuanceDate = issuanceDate
×
NEW
68
        self.credentialSubject = credentialSubject
×
NEW
69
    }
×
70
    
NEW
71
    init(from decoder: any Decoder) throws {
×
NEW
72
        let container = try decoder.container(keyedBy: CodingKeys.self)
×
NEW
73
        let context = (try? container.decode(Set<String>.self, forKey: .context)) ?? Set<String>()
×
NEW
74
        let type: Set<String>
×
NEW
75
        if let value = try? container.decode(String.self, forKey: .type) {
×
NEW
76
            type = Set([value])
×
NEW
77
        } else {
×
NEW
78
            type = (try? container.decode(Set<String>.self, forKey: .type)) ?? Set<String>()
×
NEW
79
        }
×
NEW
80
        let id = try container.decode(String.self, forKey: .id)
×
NEW
81
        let issuer =  try container.decode(String.self, forKey: .issuer)
×
NEW
82
        let issuanceDate = try container.decode(Date.self, forKey: .issuanceDate)
×
NEW
83
        let credentialSubject = try container.decode(StatusListCredentialSubject.self, forKey: .credentialSubject)
×
NEW
84
        
×
NEW
85
        self.init(
×
NEW
86
            context: context,
×
NEW
87
            type: type,
×
NEW
88
            id: id,
×
NEW
89
            issuer: issuer,
×
NEW
90
            issuanceDate: issuanceDate,
×
NEW
91
            credentialSubject: credentialSubject
×
NEW
92
        )
×
NEW
93
    }
×
94
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc