forked from EWC-consortium/eudi-wallet-oid4vc-ios
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
847 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by oem on 10/10/24. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct CredentialOfferV2: Codable { | ||
var credentialIssuer: String? | ||
var credentialConfigurationIds: [AnyObject]? | ||
var grants: GrantsResponse? | ||
var error: ErrorResponse? | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case credentialIssuer = "credential_issuer" | ||
case credentialConfigurationIds = "credential_configuration_ids" | ||
case grants, error | ||
} | ||
|
||
|
||
public func encode(to encoder: Encoder) throws { | ||
|
||
} | ||
|
||
public init(from decoder: Decoder) throws { | ||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
self.credentialIssuer = try container.decodeIfPresent(String.self, forKey: .credentialIssuer) | ||
if let stringArray = try? container.decode([String].self, forKey: .credentialConfigurationIds) { | ||
credentialConfigurationIds = stringArray as? [AnyObject] | ||
} else if let credentialArray = try? container.decode([CredentialDataResponse].self, forKey: .credentialConfigurationIds) { | ||
credentialConfigurationIds = credentialArray as? [AnyObject] | ||
} else { | ||
credentialConfigurationIds = nil | ||
} | ||
self.grants = try container.decodeIfPresent(GrantsResponse.self, forKey: .grants) | ||
self.error = try container.decodeIfPresent(ErrorResponse.self, forKey: .error) | ||
} | ||
|
||
} | ||
|
||
public struct TransactionCode: Codable { | ||
public let length: Int? | ||
public let inputMode: String? | ||
public let description: String? | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case length | ||
case inputMode = "input_mode" | ||
case description | ||
} | ||
|
||
init(length: Int? = 0, inputMode: String = "", description: String = "") { | ||
self.length = length | ||
self.inputMode = inputMode | ||
self.description = description | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Sources/eudiWalletOidcIos/Model/CredentialResponseV1.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by oem on 10/10/24. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct CredentialResponseV1: Codable { | ||
public var format, credential, acceptanceToken: String? | ||
public var isDeferred, isPinRequired: Bool? | ||
public var issuerConfig: IssuerWellKnownConfiguration? | ||
public var authorizationConfig: AuthorisationServerWellKnownConfiguration? | ||
public var credentialOffer: CredentialOffer? | ||
public var error: EUDIError? | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case acceptanceToken = "acceptance_token" | ||
case format = "format" | ||
case credential = "credential" | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
Sources/eudiWalletOidcIos/Model/CredentialResponseV2.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by oem on 10/10/24. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct CredentialResponseV2: Codable { | ||
public var format, credential, acceptanceToken: String? | ||
public var isDeferred, isPinRequired: Bool? | ||
public var issuerConfig: IssuerWellKnownConfiguration? | ||
public var authorizationConfig: AuthorisationServerWellKnownConfiguration? | ||
public var credentialOffer: CredentialOffer? | ||
public var error: EUDIError? | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case acceptanceToken = "transaction_id" | ||
case format = "format" | ||
case credential = "credential" | ||
} | ||
} |
Oops, something went wrong.