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

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

30 Jul 2024 01:24PM UTC coverage: 43.367% (+1.6%) from 41.758%
10163242789

Pull #152

github

web-flow
Merge 8d6e6af2d into 0b302f5ab
Pull Request #152: test: add backup and revocation message e2e scenarios

5 of 52 new or added lines in 4 files covered. (9.62%)

2 existing lines in 1 file now uncovered.

5080 of 11714 relevant lines covered (43.37%)

97.56 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: Int
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: Int,
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(Int.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