From f2cdeec90555987b3c46ea21b8fca2f16fd757a7 Mon Sep 17 00:00:00 2001 From: Marat Shakirov Date: Thu, 12 Dec 2024 12:28:20 +0100 Subject: [PATCH] fix: readme & composer lock --- .all-contributorsrc | 2 +- README.md | 57 ++++++++++++++++++++++++++++++++++++-- composer.lock | 12 ++++---- src/AuthProvider/README.md | 2 +- 4 files changed, 62 insertions(+), 11 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index dff5b50..d8f21bb 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,5 +1,5 @@ { - "projectName": "affinidi-tdk", + "projectName": "affinidi-tdk-php", "projectOwner": "affinidi", "repoType": "github", "repoHost": "https://github.com", diff --git a/README.md b/README.md index 8a6a034..26577b7 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ The Affinidi Trust Development Kit (Affinidi TDK) is a modern interface that all The Affinidi TDK provides three type of modules: -- [Clients](clients), which offer methods to access Affinidi Elements services like Credential Issuance, Credential Verification, and Login Configurations, among others. -- [Packages](packages), which are commonly used utilities/helpers that are self-contained and composable. -- [Libraries](libs), which are high-level abstractions that combine logic and data to perform necessary business logic functionalities. +- [Clients](src/Clients), which offer methods to access Affinidi Elements services like Credential Issuance, Credential Verification, and Login Configurations, among others. +- [Packages](src/), which are commonly used utilities/helpers that are self-contained and composable. +- [Libraries](src/Libs/), which are high-level abstractions that combine logic and data to perform necessary business logic functionalities. Each module has its own README that you can check to better understand how to integrate it into your application. @@ -27,6 +27,57 @@ To learn how to integrate Affinidi TDK and use the different modules into your a - [Affinidi TDK Libraries](https://docs.affinidi.com/dev-tools/affinidi-tdk/libraries/) - [Affinidi TDK Packages](https://docs.affinidi.com/dev-tools/affinidi-tdk/packages/) +## Install + +```bash +composer install affinidi-tdk/affinidi-tdk-php +``` + +## Usage + +```php + "", + // 'apiGatewayUrl' => 'https://apse1.api.affinidi.io', + // 'tokenEndpoint' => 'https://apse1.auth.developer.affinidi.io/auth/oauth2/token', + 'keyId' => '', + 'passphrase' => '', + 'projectId' => '', + 'tokenId' => '' +]; + +$authProvider = new AuthProvider($params); + +try { + $tokenCallback = [$authProvider, 'fetchProjectScopedToken']; + + $configCwe = WalletsClient\Configuration::getDefaultConfiguration()->setApiKey('authorization', '', $tokenCallback); + + $apiInstanceCwe = new WalletsClient\Api\WalletApi( + new GuzzleHttp\Client(), + $configCwe + ); + + $apiInstanceCwe->listWallets(); + + $resultCwe = $apiInstanceCwe->listWallets(); + + $resultCweJson = json_decode($resultCwe, true); + + print_r(count($resultCweJson['wallets'])); + +} catch (Exception $e) { + print_r($e->getMessage()); +} +``` + ## Support & feedback If you face any issues or have suggestions, please don't hesitate to contact us using [this link](https://share.hsforms.com/1i-4HKZRXSsmENzXtPdIG4g8oa2v). diff --git a/composer.lock b/composer.lock index 3898b16..3b54248 100644 --- a/composer.lock +++ b/composer.lock @@ -3785,16 +3785,16 @@ }, { "name": "symfony/console", - "version": "v7.2.0", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "23c8aae6d764e2bae02d2a99f7532a7f6ed619cf" + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/23c8aae6d764e2bae02d2a99f7532a7f6ed619cf", - "reference": "23c8aae6d764e2bae02d2a99f7532a7f6ed619cf", + "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "shasum": "" }, "require": { @@ -3858,7 +3858,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.2.0" + "source": "https://github.com/symfony/console/tree/v7.2.1" }, "funding": [ { @@ -3874,7 +3874,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:24:19+00:00" + "time": "2024-12-11T03:49:26+00:00" }, { "name": "symfony/event-dispatcher", diff --git a/src/AuthProvider/README.md b/src/AuthProvider/README.md index 4e178b7..a3c3a7c 100644 --- a/src/AuthProvider/README.md +++ b/src/AuthProvider/README.md @@ -3,7 +3,7 @@ ## Install ```bash -composer install affinidi-tdk/affinidi-tdk-php affinidi-tdk/wallets-client +composer install affinidi-tdk/affinidi-tdk-php ``` ## Usage