From 3477a562759ec6b64dc47a781df52b30ac3af8a3 Mon Sep 17 00:00:00 2001 From: Filippos Sakellaropoulos Date: Wed, 3 Jul 2024 23:55:41 +0300 Subject: [PATCH 1/2] Provide documentation reference created with Swift-DocC Plugin --- .github/workflows/docs.yml | 38 --- Documentation/Reference/README.md | 40 --- .../classes/BlePresentationService.md | 80 ----- Documentation/Reference/classes/EudiWallet.md | 284 ------------------ .../classes/FaultPresentationService.md | 72 ----- .../Reference/classes/OpenId4VCIService.md | 42 --- .../Reference/classes/OpenId4VpService.md | 76 ----- .../Reference/classes/PresentationSession.md | 156 ---------- .../Reference/classes/StorageManager.md | 238 --------------- Documentation/Reference/enums/DataFormat.md | 28 -- Documentation/Reference/enums/FlowType.md | 53 ---- .../Reference/enums/OpenId4VCIError.md | 70 ----- Documentation/Reference/enums/StorageType.md | 19 -- Documentation/Reference/extensions/Array.md | 13 - .../extensions/BlePresentationService.md | 55 ---- Documentation/Reference/extensions/String.md | 13 - .../protocols/PresentationService.md | 54 ---- .../Reference/structs/DocElementsViewModel.md | 42 --- .../Reference/structs/ElementViewModel.md | 61 ---- .../Reference/structs/WalletError.md | 44 --- .../Reference/typealiases/RequestItems.md | 9 - README.md | 2 +- 22 files changed, 1 insertion(+), 1488 deletions(-) delete mode 100644 .github/workflows/docs.yml delete mode 100644 Documentation/Reference/README.md delete mode 100644 Documentation/Reference/classes/BlePresentationService.md delete mode 100644 Documentation/Reference/classes/EudiWallet.md delete mode 100644 Documentation/Reference/classes/FaultPresentationService.md delete mode 100644 Documentation/Reference/classes/OpenId4VCIService.md delete mode 100644 Documentation/Reference/classes/OpenId4VpService.md delete mode 100644 Documentation/Reference/classes/PresentationSession.md delete mode 100644 Documentation/Reference/classes/StorageManager.md delete mode 100644 Documentation/Reference/enums/DataFormat.md delete mode 100644 Documentation/Reference/enums/FlowType.md delete mode 100644 Documentation/Reference/enums/OpenId4VCIError.md delete mode 100644 Documentation/Reference/enums/StorageType.md delete mode 100644 Documentation/Reference/extensions/Array.md delete mode 100644 Documentation/Reference/extensions/BlePresentationService.md delete mode 100644 Documentation/Reference/extensions/String.md delete mode 100644 Documentation/Reference/protocols/PresentationService.md delete mode 100644 Documentation/Reference/structs/DocElementsViewModel.md delete mode 100644 Documentation/Reference/structs/ElementViewModel.md delete mode 100644 Documentation/Reference/structs/WalletError.md delete mode 100644 Documentation/Reference/typealiases/RequestItems.md diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index fa7644b..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,38 +0,0 @@ -# This workflow will build a Swift project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift - -name: Documentation - -on: - push: - branches: - - main - -jobs: - build: - - runs-on: macos-latest-xlarge - - steps: - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest - - uses: swift-actions/setup-swift@v1 - - name: Get swift version - run: swift --version - - uses: actions/checkout@v3 - - name: Fix Up Private GitHub URLs - # Add personal access token to all private repo URLs - run: find . -type f \( -name 'Package.swift' -o -name 'Package.resolved' \) -exec sed -i '' "s/https:\/\/github.com\/eu-digital-identity-wallet/https:\/\/${{ secrets.USER_NAME }}:${{ secrets.USER_GITHUB_TOKEN }}@github.com\/eu-digital-identity-wallet/g" {} \; - - name: Generate Docs - uses: fwcd/swift-docc-action@v1 - with: - target: EudiWalletKit - output: ./docs - transform-for-static-hosting: 'true' - disable-indexing: 'true' - hosting-base-path: eudi-lib-ios-wallet-kit - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - path: ./docs diff --git a/Documentation/Reference/README.md b/Documentation/Reference/README.md deleted file mode 100644 index 7096bc6..0000000 --- a/Documentation/Reference/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Reference Documentation - -## Protocols - -- [PresentationService](protocols/PresentationService.md) - -## Structs - -- [DocElementsViewModel](structs/DocElementsViewModel.md) -- [ElementViewModel](structs/ElementViewModel.md) -- [WalletError](structs/WalletError.md) - -## Classes - -- [BlePresentationService](classes/BlePresentationService.md) -- [EudiWallet](classes/EudiWallet.md) -- [FaultPresentationService](classes/FaultPresentationService.md) -- [OpenId4VCIService](classes/OpenId4VCIService.md) -- [OpenId4VpService](classes/OpenId4VpService.md) -- [PresentationSession](classes/PresentationSession.md) -- [StorageManager](classes/StorageManager.md) - -## Enums - -- [DataFormat](enums/DataFormat.md) -- [FlowType](enums/FlowType.md) -- [OpenId4VCIError](enums/OpenId4VCIError.md) -- [StorageType](enums/StorageType.md) - -## Extensions - -- [Array](extensions/Array.md) -- [BlePresentationService](extensions/BlePresentationService.md) -- [String](extensions/String.md) - -## Typealiases - -- [RequestItems](typealiases/RequestItems.md) - -This file was generated by [SourceDocs](https://github.com/eneko/SourceDocs) on 2024-05-15 12:20:03 +0000 diff --git a/Documentation/Reference/classes/BlePresentationService.md b/Documentation/Reference/classes/BlePresentationService.md deleted file mode 100644 index 70eb70c..0000000 --- a/Documentation/Reference/classes/BlePresentationService.md +++ /dev/null @@ -1,80 +0,0 @@ -**CLASS** - -# `BlePresentationService` - -**Contents** - -- [Properties](#properties) - - `status` - - `flow` -- [Methods](#methods) - - `init(parameters:)` - - `startQrEngagement()` - - `receiveRequest()` - - `sendResponse(userAccepted:itemsToSend:onSuccess:)` - -```swift -public class BlePresentationService : PresentationService -``` - -Implements proximity attestation presentation with QR to BLE data transfer -Implementation is based on the ISO/IEC 18013-5 specification - -## Properties -### `status` - -```swift -public var status: TransferStatus = .initializing -``` - -### `flow` - -```swift -public var flow: FlowType -``` - -## Methods -### `init(parameters:)` - -```swift -public init(parameters: [String: Any]) throws -``` - -### `startQrEngagement()` - -```swift -public func startQrEngagement() async throws -> String? -``` - -Generate device engagement QR code -The holder app should present the returned code to the verifier -- Returns: The image data for the QR code - -### `receiveRequest()` - -```swift -public func receiveRequest() async throws -> [String: Any] -``` - - Receive request via BLE - -- Returns: The requested items. - -### `sendResponse(userAccepted:itemsToSend:onSuccess:)` - -```swift -public func sendResponse(userAccepted: Bool, itemsToSend: RequestItems, onSuccess: ((URL?) -> Void)? ) async throws -``` - -Send response via BLE - -- Parameters: - - userAccepted: True if user accepted to send the response - - itemsToSend: The selected items to send organized in document types and namespaces - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| userAccepted | True if user accepted to send the response | -| itemsToSend | The selected items to send organized in document types and namespaces | \ No newline at end of file diff --git a/Documentation/Reference/classes/EudiWallet.md b/Documentation/Reference/classes/EudiWallet.md deleted file mode 100644 index 39fc44a..0000000 --- a/Documentation/Reference/classes/EudiWallet.md +++ /dev/null @@ -1,284 +0,0 @@ -**CLASS** - -# `EudiWallet` - -**Contents** - -- [Properties](#properties) - - `storage` - - `standard` - - `userAuthenticationRequired` - - `trustedReaderCertificates` - - `deviceAuthMethod` - - `verifierApiUri` - - `openID4VciIssuerUrl` - - `openID4VciClientId` - - `openID4VciRedirectUri` - - `useSecureEnclave` -- [Methods](#methods) - - `init(storageType:serviceName:accessGroup:trustedReaderCertificates:userAuthenticationRequired:verifierApiUri:openID4VciIssuerUrl:openID4VciClientId:openID4VciRedirectUri:)` - - `issueDocument(docType:format:)` - - `beginIssueDocument(id:privateKeyType:)` - - `endIssueDocument(_:)` - - `loadDocuments()` - - `deleteDocuments()` - - `loadSampleData(sampleDataFiles:)` - - `prepareServiceDataParameters(docType:dataFormat:)` - - `beginPresentation(flow:docType:dataFormat:)` - - `beginPresentation(service:)` - - `authorizedAction(action:disabled:dismiss:localizedReason:)` - -```swift -public final class EudiWallet: ObservableObject -``` - -User wallet implementation - -## Properties -### `storage` - -```swift -public private(set) var storage: StorageManager -``` - -Storage manager instance - -### `standard` - -```swift -public static private(set) var standard: EudiWallet = EudiWallet() -``` - -Instance of the wallet initialized with default parameters - -### `userAuthenticationRequired` - -```swift -public var userAuthenticationRequired: Bool -``` - -Whether user authentication via biometrics or passcode is required before sending user data - -### `trustedReaderCertificates` - -```swift -public var trustedReaderCertificates: [Data]? -``` - -Trusted root certificates to validate the reader authentication certificate included in the proximity request - -### `deviceAuthMethod` - -```swift -public var deviceAuthMethod: DeviceAuthMethod = .deviceMac -``` - -Method to perform mdoc authentication (MAC or signature). Defaults to device MAC - -### `verifierApiUri` - -```swift -public var verifierApiUri: String? -``` - -OpenID4VP verifier api URL (used for preregistered clients) - -### `openID4VciIssuerUrl` - -```swift -public var openID4VciIssuerUrl: String? -``` - -OpenID4VCI issuer url - -### `openID4VciClientId` - -```swift -public var openID4VciClientId: String? -``` - -OpenID4VCI client id - -### `openID4VciRedirectUri` - -```swift -public var openID4VciRedirectUri: String = "eudi-openid4ci://authorize/" -``` - -OpenID4VCI redirect URI. Defaults to "eudi-openid4ci://authorize/" - -### `useSecureEnclave` - -```swift -public var useSecureEnclave: Bool -``` - -Use iPhone Secure Enclave to protect keys and perform cryptographic operations. Defaults to true (if available) - -## Methods -### `init(storageType:serviceName:accessGroup:trustedReaderCertificates:userAuthenticationRequired:verifierApiUri:openID4VciIssuerUrl:openID4VciClientId:openID4VciRedirectUri:)` - -```swift -public init(storageType: StorageType = .keyChain, serviceName: String = "eudiw", accessGroup: String? = nil, trustedReaderCertificates: [Data]? = nil, userAuthenticationRequired: Bool = true, verifierApiUri: String? = nil, openID4VciIssuerUrl: String? = nil, openID4VciClientId: String? = nil, openID4VciRedirectUri: String? = nil) -``` - -Initialize a wallet instance. All parameters are optional. - -### `issueDocument(docType:format:)` - -```swift -@discardableResult public func issueDocument(docType: String, format: DataFormat = .cbor) async throws -> WalletStorage.Document -``` - -Issue a document with the given docType using OpenId4Vci protocol - -If ``userAuthenticationRequired`` is true, user authentication is required. The authentication prompt message has localisation key "issue_document" - - Parameters: - - docType: Document type - - format: Optional format type. Defaults to cbor -- Returns: The document issued. It is saved in storage. - -### `beginIssueDocument(id:privateKeyType:saveToStorage:)` - -```swift -public func beginIssueDocument(id: String, privateKeyType: PrivateKeyType = .secureEnclaveP256, saveToStorage: Bool = true) async throws -> IssueRequest -``` - -Begin issuing a document by generating an issue request - -- Parameters: - - id: Document identifier - - issuer: Issuer function - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| id | Document identifier | -| issuer | Issuer function | - -### `endIssueDocument(_:)` - -```swift -public func endIssueDocument(_ issued: WalletStorage.Document) throws -``` - -End issuing by saving the issuing document (and its private key) in storage -- Parameter issued: The issued document - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| issued | The issued document | - -### `loadDocuments()` - -```swift -@discardableResult public func loadDocuments() async throws -> [WalletStorage.Document]? -``` - -Load documents from storage - -Calls ``storage`` loadDocuments -- Returns: An array of ``WalletStorage.Document`` objects - -### `deleteDocuments()` - -```swift -public func deleteDocuments() async throws -``` - -Delete all documents from storage - -Calls ``storage`` loadDocuments -- Returns: An array of ``WalletStorage.Document`` objects - -### `loadSampleData(sampleDataFiles:)` - -```swift -public func loadSampleData(sampleDataFiles: [String]? = nil) async throws -``` - -Load sample data from json files - -The mdoc data are stored in wallet storage as documents -- Parameter sampleDataFiles: Names of sample files provided in the app bundle - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| sampleDataFiles | Names of sample files provided in the app bundle | - -### `prepareServiceDataParameters(docType:dataFormat:)` - -```swift -public func prepareServiceDataParameters(docType: String? = nil, dataFormat: DataFormat = .cbor ) throws -> [String : Any] -``` - -Prepare Service Data Parameters -- Parameters: - - docType: docType of documents to present (optional) - - dataFormat: Exchanged data ``Format`` type -- Returns: A data dictionary that can be used to initialize a presentation service - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| docType | docType of documents to present (optional) | -| dataFormat | Exchanged data `Format` type | - -### `beginPresentation(flow:docType:dataFormat:)` - -```swift -public func beginPresentation(flow: FlowType, docType: String? = nil, dataFormat: DataFormat = .cbor) -> PresentationSession -``` - -Begin attestation presentation to a verifier -- Parameters: - - flow: Presentation ``FlowType`` instance - - docType: DocType of documents to present (optional) - - dataFormat: Exchanged data ``Format`` type -- Returns: A presentation session instance, - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| flow | Presentation `FlowType` instance | -| docType | DocType of documents to present (optional) | -| dataFormat | Exchanged data `Format` type | - -### `beginPresentation(service:)` - -```swift -public func beginPresentation(service: any PresentationService) -> PresentationSession -``` - -Begin attestation presentation to a verifier -- Parameters: - - service: A ``PresentationService`` instance - - docType: DocType of documents to present (optional) - - dataFormat: Exchanged data ``Format`` type -- Returns: A presentation session instance, - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| service | A `PresentationService` instance | -| docType | DocType of documents to present (optional) | -| dataFormat | Exchanged data `Format` type | - -### `authorizedAction(action:disabled:dismiss:localizedReason:)` - -```swift -public static func authorizedAction(action: () async throws -> T, disabled: Bool, dismiss: () -> Void, localizedReason: String) async throws -> T? -``` - -Perform an action after user authorization via TouchID/FaceID/Passcode -- Parameters: - - dismiss: Action to perform if the user cancels authorization - - action: Action to perform after user authorization diff --git a/Documentation/Reference/classes/FaultPresentationService.md b/Documentation/Reference/classes/FaultPresentationService.md deleted file mode 100644 index c73470f..0000000 --- a/Documentation/Reference/classes/FaultPresentationService.md +++ /dev/null @@ -1,72 +0,0 @@ -**CLASS** - -# `FaultPresentationService` - -**Contents** - -- [Properties](#properties) - - `status` - - `flow` -- [Methods](#methods) - - `init(msg:)` - - `init(error:)` - - `startQrEngagement()` - - `receiveRequest()` - - `sendResponse(userAccepted:itemsToSend:onSuccess:)` - -```swift -public class FaultPresentationService: PresentationService -``` - -Fault presentation service. Used to communicate error state to the user - -## Properties -### `status` - -```swift -public var status: TransferStatus = .error -``` - -### `flow` - -```swift -public var flow: FlowType = .other -``` - -## Methods -### `init(msg:)` - -```swift -public init(msg: String) -``` - -### `init(error:)` - -```swift -public init(error: Error) -``` - -### `startQrEngagement()` - -```swift -public func startQrEngagement() async throws -> String? -``` - -### `receiveRequest()` - -```swift -public func receiveRequest() async throws -> [String : Any] -``` - -### `sendResponse(userAccepted:itemsToSend:onSuccess:)` - -```swift -public func sendResponse(userAccepted: Bool, itemsToSend: RequestItems, onSuccess: ((URL?) -> Void)?) async throws -``` - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| userAccepted | True if user accepted to send the response | -| itemsToSend | The selected items to send organized in document types and namespaces (see `RequestItems`) | \ No newline at end of file diff --git a/Documentation/Reference/classes/OpenId4VCIService.md b/Documentation/Reference/classes/OpenId4VCIService.md deleted file mode 100644 index 7d79f4d..0000000 --- a/Documentation/Reference/classes/OpenId4VCIService.md +++ /dev/null @@ -1,42 +0,0 @@ -**CLASS** - -# `OpenId4VCIService` - -**Contents** - -- [Methods](#methods) - - `issueDocument(docType:format:useSecureEnclave:)` - - `presentationAnchor(for:)` - -```swift -public class OpenId4VCIService: NSObject, ASWebAuthenticationPresentationContextProviding -``` - -## Methods -### `issueDocument(docType:format:useSecureEnclave:)` - -```swift -public func issueDocument(docType: String, format: DataFormat, useSecureEnclave: Bool = true) async throws -> Data -``` - -Issue a document with the given `docType` using OpenId4Vci protocol -- Parameters: - - docType: the docType of the document to be issued - - format: format of the exchanged data - - useSecureEnclave: use secure enclave to protect the private key -- Returns: The data of the document - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| docType | the docType of the document to be issued | -| format | format of the exchanged data | -| useSecureEnclave | use secure enclave to protect the private key | - -### `presentationAnchor(for:)` - -```swift -public func presentationAnchor(for session: ASWebAuthenticationSession) --> ASPresentationAnchor -``` diff --git a/Documentation/Reference/classes/OpenId4VpService.md b/Documentation/Reference/classes/OpenId4VpService.md deleted file mode 100644 index d20b141..0000000 --- a/Documentation/Reference/classes/OpenId4VpService.md +++ /dev/null @@ -1,76 +0,0 @@ -**CLASS** - -# `OpenId4VpService` - -**Contents** - -- [Properties](#properties) - - `status` - - `flow` -- [Methods](#methods) - - `init(parameters:qrCode:openId4VpVerifierApiUri:)` - - `startQrEngagement()` - - `receiveRequest()` - - `sendResponse(userAccepted:itemsToSend:onSuccess:)` - -```swift -public class OpenId4VpService: PresentationService -``` - -Implements remote attestation presentation to online verifier -Implementation is based on the OpenID4VP – Draft 18 specification - -## Properties -### `status` - -```swift -public var status: TransferStatus = .initialized -``` - -### `flow` - -```swift -public var flow: FlowType -``` - -## Methods -### `init(parameters:qrCode:openId4VpVerifierApiUri:)` - -```swift -public init(parameters: [String: Any], qrCode: Data, openId4VpVerifierApiUri: String?) throws -``` - -### `startQrEngagement()` - -```swift -public func startQrEngagement() async throws -> String? -``` - -### `receiveRequest()` - -```swift -public func receiveRequest() async throws -> [String: Any] -``` - - Receive request from an openid4vp URL - -- Returns: The requested items. - -### `sendResponse(userAccepted:itemsToSend:onSuccess:)` - -```swift -public func sendResponse(userAccepted: Bool, itemsToSend: RequestItems, onSuccess: ((URL?) -> Void)?) async throws -``` - -Send response via openid4vp - -- Parameters: - - userAccepted: True if user accepted to send the response - - itemsToSend: The selected items to send organized in document types and namespaces - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| userAccepted | True if user accepted to send the response | -| itemsToSend | The selected items to send organized in document types and namespaces | \ No newline at end of file diff --git a/Documentation/Reference/classes/PresentationSession.md b/Documentation/Reference/classes/PresentationSession.md deleted file mode 100644 index f250871..0000000 --- a/Documentation/Reference/classes/PresentationSession.md +++ /dev/null @@ -1,156 +0,0 @@ -**CLASS** - -# `PresentationSession` - -**Contents** - -- [Properties](#properties) - - `presentationService` - - `readerCertIssuer` - - `readerCertValidationMessage` - - `readerCertIssuerValid` - - `uiError` - - `disclosedDocuments` - - `status` - - `deviceEngagement` -- [Methods](#methods) - - `init(presentationService:userAuthenticationRequired:)` - - `makeError(str:)` - - `makeError(code:str:)` - - `startQrEngagement()` - - `receiveRequest()` - - `sendResponse(userAccepted:itemsToSend:onCancel:onSuccess:)` - -```swift -public class PresentationSession: ObservableObject -``` - -Presentation session - -This class wraps the ``PresentationService`` instance, providing bindable fields to a SwifUI view - -## Properties -### `presentationService` - -```swift -public var presentationService: any PresentationService -``` - -### `readerCertIssuer` - -```swift -@Published public var readerCertIssuer: String? -``` - -Reader certificate issuer (only for BLE flow wih verifier using reader authentication) - -### `readerCertValidationMessage` - -```swift -@Published public var readerCertValidationMessage: String? -``` - -Reader certificate validation message (only for BLE transfer wih verifier using reader authentication) - -### `readerCertIssuerValid` - -```swift -@Published public var readerCertIssuerValid: Bool? -``` - -Reader certificate issuer is valid (only for BLE transfer wih verifier using reader authentication) - -### `uiError` - -```swift -@Published public var uiError: WalletError? -``` - -Error message when the ``status`` is in the error state. - -### `disclosedDocuments` - -```swift -@Published public var disclosedDocuments: [DocElementsViewModel] = [] -``` - -Request items selected by the user to be sent to verifier. - -### `status` - -```swift -@Published public var status: TransferStatus = .initializing -``` - -Status of the data transfer. - -### `deviceEngagement` - -```swift -@Published public var deviceEngagement: String? -``` - -Device engagement data (QR data for the BLE flow) - -## Methods -### `init(presentationService:userAuthenticationRequired:)` - -```swift -public init(presentationService: any PresentationService, userAuthenticationRequired: Bool) -``` - -### `makeError(str:)` - -```swift -public static func makeError(str: String) -> NSError -``` - -### `makeError(code:str:)` - -```swift -public static func makeError(code: ErrorCode, str: String? = nil) -> NSError -``` - -### `startQrEngagement()` - -```swift -public func startQrEngagement() async -``` - -Start QR engagement to be presented to verifier - -On success ``deviceEngagement`` published variable will be set with the result and ``status`` will be ``.qrEngagementReady`` -On error ``uiError`` will be filled and ``status`` will be ``.error`` - -### `receiveRequest()` - -```swift -public func receiveRequest() async -> [String: Any]? -``` - -Receive request from verifer - -The request is futher decoded internally. See also ``decodeRequest(_:)`` -On success ``disclosedDocuments`` published variable will be set and ``status`` will be ``.requestReceived`` -On error ``uiError`` will be filled and ``status`` will be ``.error`` -- Returns: A request dictionary keyed by ``MdocDataTransfer.UserRequestKeys`` - -### `sendResponse(userAccepted:itemsToSend:onCancel:onSuccess:)` - -```swift -public func sendResponse(userAccepted: Bool, itemsToSend: RequestItems, onCancel: (() -> Void)? = nil, onSuccess: ((URL?) -> Void)? = nil) async -``` - -Send response to verifier -- Parameters: - - userAccepted: Whether user confirmed to send the response - - itemsToSend: Data to send organized into a hierarcy of doc.types and namespaces - - onCancel: Action to perform if the user cancels the biometric authentication - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| userAccepted | Whether user confirmed to send the response | -| itemsToSend | Data to send organized into a hierarcy of doc.types and namespaces | -| onCancel | Action to perform if the user cancels the biometric authentication | \ No newline at end of file diff --git a/Documentation/Reference/classes/StorageManager.md b/Documentation/Reference/classes/StorageManager.md deleted file mode 100644 index f0d6fce..0000000 --- a/Documentation/Reference/classes/StorageManager.md +++ /dev/null @@ -1,238 +0,0 @@ -**CLASS** - -# `StorageManager` - -**Contents** - -- [Properties](#properties) - - `knownDocTypes` - - `docTypes` - - `mdocModels` - - `documentIds` - - `hasData` - - `hasWellKnownData` - - `docCount` - - `mdlModel` - - `pidModel` - - `otherModels` - - `uiError` -- [Methods](#methods) - - `init(storageService:)` - - `loadDocuments()` - - `getDocumentModel(index:)` - - `getDocumentModel(docType:)` - - `deleteDocument(docType:)` - - `deleteDocument(index:)` - - `deleteDocuments()` - -```swift -public class StorageManager: ObservableObject -``` - -Storage manager. Provides services and view models - -## Properties -### `knownDocTypes` - -```swift -public static let knownDocTypes = [EuPidModel.euPidDocType, IsoMdlModel.isoDocType] -``` - -### `docTypes` - -```swift -public var docTypes: [String?] = [] -``` - -Array of doc.types of documents loaded in the wallet - -### `mdocModels` - -```swift -@Published public var mdocModels: [MdocDecodable?] = [] -``` - -Array of document models loaded in the wallet - -### `documentIds` - -```swift -public var documentIds: [String?] = [] -``` - -Array of document identifiers loaded in the wallet - -### `hasData` - -```swift -@Published public var hasData: Bool = false -``` - -Whether wallet currently has loaded data - -### `hasWellKnownData` - -```swift -@Published public var hasWellKnownData: Bool = false -``` - -Whether wallet currently has loaded a document with doc.type included in the ``knownDocTypes`` array - -### `docCount` - -```swift -@Published public var docCount: Int = 0 -``` - -Count of documents loaded in the wallet - -### `mdlModel` - -```swift -@Published public var mdlModel: IsoMdlModel? -``` - -The driver license model loaded in the wallet - -### `pidModel` - -```swift -@Published public var pidModel: EuPidModel? -``` - -The PID model loaded in the wallet - -### `otherModels` - -```swift -@Published public var otherModels: [GenericMdocModel] = [] -``` - -Other document models loaded in the wallet - -### `uiError` - -```swift -@Published public var uiError: WalletError? -``` - -Error object with localized message - -## Methods -### `init(storageService:)` - -```swift -public init(storageService: any DataStorageService) -``` - -### `loadDocuments()` - -```swift -@discardableResult public func loadDocuments() async throws -> [WalletStorage.Document]? -``` - -Load documents from storage - -Internally sets the ``docTypes``, ``mdocModels``, ``documentIds``, ``mdocModels``, ``mdlModel``, ``pidModel`` variables -- Returns: An array of ``WalletStorage.Document`` objects - -### `getDocumentModel(index:)` - -```swift -public func getDocumentModel(index: Int) -> MdocDecodable? -``` - -Get document model by index -- Parameter index: Index in array of loaded models -- Returns: The ``MdocDecodable`` model - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| index | Index in array of loaded models | - -### `getDocumentModel(id:)` - -```swift -public func getDocumentModel(id: String) -> MdocDecodable? -``` - -Get document model by id -- Parameter id: The id of the document model to return -- Returns: The ``MdocDecodable`` model - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| id | The id of the document model to return | - -### `getDocumentModels(docType:)` - -```swift -public func getDocumentModels(docType: String) -> [MdocDecodable] -``` - -Get document model by docType -- Parameter docType: The docType of the document model to return -- Returns: The ``MdocDecodable`` model - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| docType | The docType of the document model to return | - -### `deleteDocuments(docType:)` - -```swift -public func deleteDocuments(docType: String) async throws -``` - -Delete documents by docType -- Parameter docType: Document type - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| docType | Document type | - -### `deleteDocument(id:)` - -```swift -public func deleteDocument(id: String) async throws -``` - -Delete document by id -- Parameter id: Document id - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| id | Document id | - -### `deleteDocument(index:)` - -```swift -public func deleteDocument(index: Int) async throws -``` - -Delete document by Index -- Parameter index: Index in array of loaded models - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| index | Index in array of loaded models | - -### `deleteDocuments()` - -```swift -public func deleteDocuments() async throws -``` - -Delete documenmts diff --git a/Documentation/Reference/enums/DataFormat.md b/Documentation/Reference/enums/DataFormat.md deleted file mode 100644 index ca75577..0000000 --- a/Documentation/Reference/enums/DataFormat.md +++ /dev/null @@ -1,28 +0,0 @@ -**ENUM** - -# `DataFormat` - -**Contents** - -- [Cases](#cases) - - `cbor` - - `sdjwt` - -```swift -public enum DataFormat: String -``` - -Data format of the exchanged data - -## Cases -### `cbor` - -```swift -case cbor = "cbor" -``` - -### `sdjwt` - -```swift -case sdjwt = "sdjwt" -``` diff --git a/Documentation/Reference/enums/FlowType.md b/Documentation/Reference/enums/FlowType.md deleted file mode 100644 index e83e450..0000000 --- a/Documentation/Reference/enums/FlowType.md +++ /dev/null @@ -1,53 +0,0 @@ -**ENUM** - -# `FlowType` - -**Contents** - -- [Cases](#cases) - - `ble` - - `openid4vp(qrCode:)` - - `other` -- [Properties](#properties) - - `isProximity` - - `qrCode` - -```swift -public enum FlowType: Codable, Hashable -``` - -Data exchange flow type - -## Cases -### `ble` - -```swift -case ble -``` - -### `openid4vp(qrCode:)` - -```swift -case openid4vp(qrCode: Data) -``` - -### `other` - -```swift -case other -``` - -## Properties -### `isProximity` - -```swift -public var isProximity: Bool -``` - -True if proximity flow type (currently ``ble``) - -### `qrCode` - -```swift -public var qrCode: Data? -``` diff --git a/Documentation/Reference/enums/OpenId4VCIError.md b/Documentation/Reference/enums/OpenId4VCIError.md deleted file mode 100644 index 5a76bf2..0000000 --- a/Documentation/Reference/enums/OpenId4VCIError.md +++ /dev/null @@ -1,70 +0,0 @@ -**ENUM** - -# `OpenId4VCIError` - -**Contents** - -- [Cases](#cases) - - `authRequestFailed(_:)` - - `authorizeResponseNoUrl` - - `authorizeResponseNoCode` - - `tokenRequestFailed(_:)` - - `tokenResponseNoData` - - `tokenResponseInvalidData(_:)` - - `dataNotValid` -- [Properties](#properties) - - `localizedDescription` - -```swift -public enum OpenId4VCIError: LocalizedError -``` - -## Cases -### `authRequestFailed(_:)` - -```swift -case authRequestFailed(Error) -``` - -### `authorizeResponseNoUrl` - -```swift -case authorizeResponseNoUrl -``` - -### `authorizeResponseNoCode` - -```swift -case authorizeResponseNoCode -``` - -### `tokenRequestFailed(_:)` - -```swift -case tokenRequestFailed(Error) -``` - -### `tokenResponseNoData` - -```swift -case tokenResponseNoData -``` - -### `tokenResponseInvalidData(_:)` - -```swift -case tokenResponseInvalidData(String) -``` - -### `dataNotValid` - -```swift -case dataNotValid -``` - -## Properties -### `localizedDescription` - -```swift -public var localizedDescription: String -``` diff --git a/Documentation/Reference/enums/StorageType.md b/Documentation/Reference/enums/StorageType.md deleted file mode 100644 index ba81170..0000000 --- a/Documentation/Reference/enums/StorageType.md +++ /dev/null @@ -1,19 +0,0 @@ -**ENUM** - -# `StorageType` - -**Contents** - -- [Cases](#cases) - - `keyChain` - -```swift -public enum StorageType -``` - -## Cases -### `keyChain` - -```swift -case keyChain -``` diff --git a/Documentation/Reference/extensions/Array.md b/Documentation/Reference/extensions/Array.md deleted file mode 100644 index eb30dfb..0000000 --- a/Documentation/Reference/extensions/Array.md +++ /dev/null @@ -1,13 +0,0 @@ -**EXTENSION** - -# `Array` -```swift -extension Array where Element == DocElementsViewModel -``` - -## Properties -### `items` - -```swift -public var items: RequestItems -``` diff --git a/Documentation/Reference/extensions/BlePresentationService.md b/Documentation/Reference/extensions/BlePresentationService.md deleted file mode 100644 index c62b1d9..0000000 --- a/Documentation/Reference/extensions/BlePresentationService.md +++ /dev/null @@ -1,55 +0,0 @@ -**EXTENSION** - -# `BlePresentationService` -```swift -extension BlePresentationService: MdocOfflineDelegate -``` - -## Methods -### `didChangeStatus(_:)` - -```swift -public func didChangeStatus(_ newStatus: MdocDataTransfer18013.TransferStatus) -``` - -BLE transfer changed status -- Parameter newStatus: New status - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| newStatus | New status | - -### `didFinishedWithError(_:)` - -```swift -public func didFinishedWithError(_ error: Error) -``` - -Transfer finished with error -- Parameter error: The error description - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| error | The error description | - -### `didReceiveRequest(_:handleSelected:)` - -```swift -public func didReceiveRequest(_ request: [String : Any], handleSelected: @escaping (Bool, MdocDataTransfer18013.RequestItems?) -> Void) -``` - -Received request handler -- Parameters: - - request: Request items keyed by §UserRequestKeys§ - - handleSelected: Callback function to call after user selection of items to send - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| request | Request items keyed by §UserRequestKeys§ | -| handleSelected | Callback function to call after user selection of items to send | \ No newline at end of file diff --git a/Documentation/Reference/extensions/String.md b/Documentation/Reference/extensions/String.md deleted file mode 100644 index 56cc827..0000000 --- a/Documentation/Reference/extensions/String.md +++ /dev/null @@ -1,13 +0,0 @@ -**EXTENSION** - -# `String` -```swift -extension String -``` - -## Methods -### `translated()` - -```swift -public func translated() -> String -``` diff --git a/Documentation/Reference/protocols/PresentationService.md b/Documentation/Reference/protocols/PresentationService.md deleted file mode 100644 index fb15704..0000000 --- a/Documentation/Reference/protocols/PresentationService.md +++ /dev/null @@ -1,54 +0,0 @@ -**PROTOCOL** - -# `PresentationService` - -```swift -public protocol PresentationService -``` - -Presentation service abstract protocol - -## Properties -### `flow` - -```swift -var flow: FlowType -``` - -instance of a presentation ``FlowType`` - -## Methods -### `startQrEngagement()` - -```swift -func startQrEngagement() async throws -> String? -``` - -Generate a QR code to be shown to verifier (optional) - -### `receiveRequest()` - -```swift -func receiveRequest() async throws -> [String: Any] -``` - -- Returns: The requested items. -Receive request. - -### `sendResponse(userAccepted:itemsToSend:onSuccess:)` - -```swift -func sendResponse(userAccepted: Bool, itemsToSend: RequestItems, onSuccess: ((URL?) -> Void)?) async throws -``` - -Send response to verifier -- Parameters: - - userAccepted: True if user accepted to send the response - - itemsToSend: The selected items to send organized in document types and namespaces (see ``RequestItems``) - -#### Parameters - -| Name | Description | -| ---- | ----------- | -| userAccepted | True if user accepted to send the response | -| itemsToSend | The selected items to send organized in document types and namespaces (see `RequestItems`) | \ No newline at end of file diff --git a/Documentation/Reference/structs/DocElementsViewModel.md b/Documentation/Reference/structs/DocElementsViewModel.md deleted file mode 100644 index 918520f..0000000 --- a/Documentation/Reference/structs/DocElementsViewModel.md +++ /dev/null @@ -1,42 +0,0 @@ -**STRUCT** - -# `DocElementsViewModel` - -**Contents** - -- [Properties](#properties) - - `id` - - `docType` - - `isEnabled` - - `elements` - -```swift -public struct DocElementsViewModel: Identifiable -``` - -View model used in SwiftUI for presentation request elements - -## Properties -### `id` - -```swift -public var id: String -``` - -### `docType` - -```swift -public let docType: String -``` - -### `isEnabled` - -```swift -public var isEnabled: Bool -``` - -### `elements` - -```swift -public var elements: [ElementViewModel] -``` diff --git a/Documentation/Reference/structs/ElementViewModel.md b/Documentation/Reference/structs/ElementViewModel.md deleted file mode 100644 index dd70c6b..0000000 --- a/Documentation/Reference/structs/ElementViewModel.md +++ /dev/null @@ -1,61 +0,0 @@ -**STRUCT** - -# `ElementViewModel` - -**Contents** - -- [Properties](#properties) - - `id` - - `nameSpace` - - `elementIdentifier` - - `isMandatory` - - `isEnabled` - - `isDisabled` - - `isSelected` - -```swift -public struct ElementViewModel: Identifiable -``` - -## Properties -### `id` - -```swift -public var id: String -``` - -### `nameSpace` - -```swift -public let nameSpace: String -``` - -### `elementIdentifier` - -```swift -public let elementIdentifier: String -``` - -### `isMandatory` - -```swift -public let isMandatory: Bool -``` - -### `isEnabled` - -```swift -public var isEnabled: Bool -``` - -### `isDisabled` - -```swift -public var isDisabled: Bool -``` - -### `isSelected` - -```swift -public var isSelected = true -``` diff --git a/Documentation/Reference/structs/WalletError.md b/Documentation/Reference/structs/WalletError.md deleted file mode 100644 index b4df202..0000000 --- a/Documentation/Reference/structs/WalletError.md +++ /dev/null @@ -1,44 +0,0 @@ -**STRUCT** - -# `WalletError` - -**Contents** - -- [Properties](#properties) - - `errorDescription` -- [Methods](#methods) - - `init(key:code:)` - - `init(description:code:userInfo:)` - - `==(_:_:)` - -```swift -public struct WalletError: LocalizedError -``` - -Wallet error - -## Properties -### `errorDescription` - -```swift -public var errorDescription: String? -``` - -## Methods -### `init(key:code:)` - -```swift -public init(key: String, code: Int = 0) -``` - -### `init(description:code:userInfo:)` - -```swift -public init(description: String, code: Int = 0, userInfo: [String: Any]? = nil) -``` - -### `==(_:_:)` - -```swift -public static func ==(lhs: Self, rhs: Self) -> Bool -``` diff --git a/Documentation/Reference/typealiases/RequestItems.md b/Documentation/Reference/typealiases/RequestItems.md deleted file mode 100644 index 135bfd8..0000000 --- a/Documentation/Reference/typealiases/RequestItems.md +++ /dev/null @@ -1,9 +0,0 @@ -**TYPEALIAS** - -# `RequestItems` - -```swift -public typealias RequestItems = [String: [String: [String]]] -``` - -[Doc Types to [Namespace to Items]] dictionary \ No newline at end of file diff --git a/README.md b/README.md index 55d1436..c0f4fb1 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ catch { ## Reference -Detailed documentation is provided [here](Documentation/Reference/README.md) +Detailed documentation is provided [here](https://eu-digital-identity-wallet.github.io/eudi-lib-ios-wallet-kit/documentation/eudiwalletkit/) ### Dependencies From 7e5ac9ab211b07ef566d2ca55340eaf4a0aaa178 Mon Sep 17 00:00:00 2001 From: Filippos Sakellaropoulos Date: Thu, 4 Jul 2024 12:35:07 +0300 Subject: [PATCH 2/2] Update eudi-lib-ios-siop-openid4vp-swift to version 0.3.2 --- Package.resolved | 4 ++-- Package.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Package.resolved b/Package.resolved index 74f9b4c..cfedf62 100644 --- a/Package.resolved +++ b/Package.resolved @@ -68,8 +68,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-siop-openid4vp-swift.git", "state" : { - "revision" : "2af63b02edded773b2202d987bed49ea6359102f", - "version" : "0.3.0" + "revision" : "8405517bbc2e860b20dcbd5b43bf2027520e8184", + "version" : "0.3.2" } }, { diff --git a/Package.swift b/Package.swift index 64d786c..19c3fe3 100644 --- a/Package.swift +++ b/Package.swift @@ -17,7 +17,7 @@ let package = Package( .package(url: "https://github.com/apple/swift-log.git", from: "1.5.3"), .package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-transfer.git", exact: "0.2.9"), .package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-wallet-storage.git", .upToNextMajor(from: "0.2.0")), - .package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-siop-openid4vp-swift.git", exact: "0.3.0"), + .package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-siop-openid4vp-swift.git", exact: "0.3.2"), .package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-openid4vci-swift.git", exact: "0.3.1"), ], targets: [