@@ -371,6 +371,7 @@ func organizationsToDictionary(
371371 serviceCredentialAgentIssuersArr. append ( serviceCredentialAgentIssuerMap)
372372 }
373373 organizationMap [ " serviceCredentialAgentIssuers " ] = serviceCredentialAgentIssuersArr
374+ organizationMap [ " did " ] = organization. did
374375 organizationMap [ " payload " ] = organization. payload
375376 organizationsArr. append ( organizationMap)
376377 }
@@ -393,16 +394,20 @@ func dictionaryToPushDelegate(_ pushDelegateMap: [String: Any]?) -> VCLPushDeleg
393394func dictionaryToCredentialManifestDescriptor(
394395 _ credentialManifestDescriptorDictionary: [ String : Any ]
395396) -> VCLCredentialManifestDescriptor ? {
396- if ( credentialManifestDescriptorDictionary [ " deepLink " ] != nil ) {
397- return dictionaryToCredentialManifestDescriptorByDeepLink ( credentialManifestDescriptorDictionary)
398- } else if ( credentialManifestDescriptorDictionary [ " service " ] != nil ) {
399- if ( credentialManifestDescriptorDictionary [ " credentialIds " ] != nil ) {
400- return dictionaryToCredentialManifestDescriptorRefresh ( credentialManifestDescriptorDictionary)
401- } else {
402- return dictionaryToCredentialManifestDescriptorByService ( credentialManifestDescriptorDictionary)
397+ let hasDeepLink = credentialManifestDescriptorDictionary [ " deepLink " ] != nil
398+ let hasService = credentialManifestDescriptorDictionary [ " service " ] != nil
399+ let hasCredentialIds = credentialManifestDescriptorDictionary [ " credentialIds " ] != nil
400+
401+ switch ( hasDeepLink, hasService, hasCredentialIds) {
402+ case ( true , _, _) :
403+ return dictionaryToCredentialManifestDescriptorByDeepLink ( credentialManifestDescriptorDictionary)
404+ case ( false , true , true ) :
405+ return dictionaryToCredentialManifestDescriptorRefresh ( credentialManifestDescriptorDictionary)
406+ case ( false , true , false ) :
407+ return dictionaryToCredentialManifestDescriptorByService ( credentialManifestDescriptorDictionary)
408+ default :
409+ return nil
403410 }
404- }
405- return nil
406411}
407412
408413func dictionaryToCredentialManifestDescriptorByDeepLink(
@@ -440,6 +445,7 @@ func dictionaryToCredentialManifestDescriptorByService(
440445 credentialManifestDescriptorByServiceDictionary [ " pushDelegate " ] as? [ String : Any ]
441446 ) ,
442447 didJwk: dictionaryToDidJwk ( credentialManifestDescriptorByServiceDictionary [ " didJwk " ] as? [ String : Any ] ) ,
448+ did: credentialManifestDescriptorByServiceDictionary [ " did " ] as? String ?? " " ,
443449 remoteCryptoServicesToken: dictionaryToToken (
444450 credentialManifestDescriptorByServiceDictionary [ " remoteCryptoServicesToken " ] as? [ String : Any ]
445451 )
@@ -455,6 +461,7 @@ func dictionaryToCredentialManifestDescriptorRefresh(
455461 ) ,
456462 credentialIds: credentialManifestDescriptorRefreshDictionary [ " credentialIds " ] as? [ String ] ?? [ ] ,
457463 didJwk: dictionaryToDidJwk ( credentialManifestDescriptorRefreshDictionary [ " didJwk " ] as? [ String : Any ] ) ,
464+ did: credentialManifestDescriptorRefreshDictionary [ " did " ] as? String ?? " " ,
458465 remoteCryptoServicesToken: dictionaryToToken (
459466 credentialManifestDescriptorRefreshDictionary [ " remoteCryptoServicesToken " ] as? [ String : Any ]
460467 )
0 commit comments