Skip to content

Commit

Permalink
Merge pull request #48 from niscy-eudiw/vci_offer
Browse files Browse the repository at this point in the history
OpenID4VCI: Allow partial issuing when some documents fail to issue
  • Loading branch information
phisakel authored May 21, 2024
2 parents 661464e + b120288 commit a5de5cd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Sources/eudi-lib-ios-wallet-kit/Services/OpenId4VciService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,15 @@ public class OpenId4VCIService: NSObject, ASWebAuthenticationPresentationContext
let issuer = try Issuer(authorizationServerMetadata: offer.authorizationServerMetadata, issuerMetadata: offer.credentialIssuerMetadata, config: config)
let authorized = try await authorizeRequestWithAuthCodeUseCase(issuer: issuer, offer: offer)
let data = try await credentialInfo.asyncCompactMap {
let str = try await issueOfferedCredentialWithProof(authorized, offer: offer, issuer: issuer, scope: $0.scope, claimSet: claimSet)
if let d = Data(base64URLEncoded: str) { return d } else { throw OpenId4VCIError.dataNotValid }
do {
logger.info("Starting issuing with scope \($0.scope)")
let str = try await issueOfferedCredentialWithProof(authorized, offer: offer, issuer: issuer, scope: $0.scope, claimSet: claimSet)
return Data(base64URLEncoded: str)
} catch {
logger.error("Failed to issue document with scope \($0.scope)")
logger.info("Exception: \(error)")
return nil
}
}
Self.metadataCache.removeValue(forKey: offerUri)
return data
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v0.3.9
OpenID4VCI: Allow partial issuing when some documents fail to issue

## v0.3.8
OpenID4VCI: Fixed issuing with https://dev.issuer.eudiw.dev

## v0.3.7
### Added functions:
/// Resolve OpenID4VCI offer URL document types. Resolved offer metadata are cached
Expand Down

0 comments on commit a5de5cd

Please sign in to comment.