Skip to content

Commit

Permalink
Merge branch 'EWC-consortium:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
josmilan authored Sep 17, 2024
2 parents 0d18ed5 + 2fea6eb commit 62e8f30
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 36 deletions.
46 changes: 14 additions & 32 deletions Sources/eudiWalletOidcIos/Model/IssuerWellKnownConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,41 @@
//
// Created by Mumthasir mohammed on 08/03/24.
//

import Foundation

// MARK: - IssuerWellKnownConfiguration
public struct Display{
public struct Display: Codable{
public let name: String?
public let location: String?
public let locale: String?
public let description: String?
public var cover, logo: DisplayCover?
public var bgImage, logo, cover: DisplayCover?
public var backgroundColor, textColor: String?

init(from: DisplayResponse) {
name = from.name
location = from.location
locale = from.locale
description = from.description
cover = from.cover == nil ? nil : DisplayCover(from: from.cover!)
bgImage = from.bgImage == nil ? nil : DisplayCover(from: from.bgImage!)
logo = from.logo == nil ? nil : DisplayCover(from: from.logo!)
cover = from.cover == nil ? nil : DisplayCover(from: from.cover!)
backgroundColor = from.backgroundColor
textColor = from.textColor
}

public init(mName: String, mLocation:String, mLocale: String?, mDescription: String, mCover: DisplayCover?, mLogo: DisplayCover?, mBackgroundColor: String?, mTextColor: String?) {
public init(mName: String?, mLocation:String?, mLocale: String?, mDescription: String?, mCover: DisplayCover?, mLogo: DisplayCover?, mBackgroundColor: String?, mTextColor: String?) {
name = mName
location = mLocation
locale = mLocale
description = mDescription
cover = mCover
bgImage = mCover
logo = mLogo
backgroundColor = mBackgroundColor
textColor = mTextColor
}
}

public struct TrustFrameworkInIssuer {
public let name: String?
public let type: String?
Expand All @@ -51,21 +52,6 @@ public struct TrustFrameworkInIssuer {
display = from.display == nil ? nil : Display(from: from.display!)
}
}
//struct CredentialsSupported: Codable {
// let format: String?
// let types: [String]?
// let trustFramework: TrustFrameworkInIssuer?
// let display: DisplayOrArray?
//}
//
//// MARK: - CredentialsSupportedObject
//struct CredentialsSupportedObjectType: Codable {
// var credentialsSupported: CredentialSupportedObject?
//
// enum CodingKeys: String, CodingKey {
// case credentialsSupported = "credentials_supported"
// }
//}

// MARK: - CredentialObj
public struct CredentialSupportedObject {
Expand Down Expand Up @@ -95,7 +81,6 @@ public struct CredentialSupportedObject {
}
}
}

}

public struct DisplayElement {
Expand All @@ -118,10 +103,6 @@ public struct IssuerCredentialDefinition {
}
}

//enum Format: String, Codable {
// case jwtVc = "jwt_vc"
//}

// MARK: - DataSharing
public struct DataSharing {
public var format, scope: String?
Expand Down Expand Up @@ -160,22 +141,24 @@ public struct CredentialsSupportedObjectDisplay {
}

// MARK: - Cover
public struct DisplayCover{
public var url: String?
public struct DisplayCover: Codable {
public var uri: String?
public var altText: String?
public var url: String?

init(from: DisplayCoverResponse) {
url = from.url
uri = from.uri
altText = from.altText
url = from.url
}

public init(mUrl: String?, mAltText: String?) {
url = mUrl
uri = mUrl
altText = mAltText
url = mUrl
}
}


public struct IssuerWellKnownConfiguration {
public let credentialIssuer: String?
public let authorizationServer: String?
Expand Down Expand Up @@ -234,4 +217,3 @@ public struct IssuerWellKnownConfiguration {
credentialsSupported = nil
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,25 @@
import Foundation

// MARK: - IssuerWellKnownConfiguration
struct DisplayResponse: Codable {
public struct DisplayResponse: Codable {
let name: String?
let location: String?
let locale: String?
let description: String?
var cover, logo: DisplayCoverResponse?
var cover, logo, bgImage: DisplayCoverResponse?
var backgroundColor, textColor: String?

enum CodingKeys: String, CodingKey {
case name = "name"
case location = "location"
case locale = "locale"
case description = "display"
case cover = "cover"
case logo = "logo"
case bgImage = "background_image"
case backgroundColor = "background_color"
case textColor = "text_color"
}
}
struct TrustFrameworkInIssuerResponse: Codable {
let name: String?
Expand Down Expand Up @@ -143,10 +155,12 @@ struct IssuerCredentialDefinitionResponse: Codable {
// MARK: - Cover
struct DisplayCoverResponse: Codable {
var url: String?
var uri: String?
var altText: String?

enum CodingKeys: String, CodingKey {
case url
case uri
case altText = "alt_text"
}
}
Expand Down Expand Up @@ -200,5 +214,3 @@ public struct IssuerWellKnownConfigurationResponse: Codable {
}
}
}


0 comments on commit 62e8f30

Please sign in to comment.