affinidi-tdk/affinidi-tdk-php
Composer 安装命令:
composer require affinidi-tdk/affinidi-tdk-php
包简介
Affinidi Trust Developement Kit
关键字:
README 文档
README
The Affinidi Trust Development Kit (Affinidi TDK) is a modern interface that allows you to easily manage and integrate Affinidi Elements and Frameworks into your application. It minimises dependencies and enables developers seamless entry into the Affinidi Trust Network (ATN).
How do I use Affinidi TDK?
The Affinidi TDK for PHP is published on packagist.org and provides the following libraries:
- Clients, which offer methods to access Affinidi Elements services like Credential Issuance, Credential Verification, and Login Configurations, among others.
- AuthProvider, a library that provides a method to authenticate Personal Access Tokens (PATs) and generates access token to call clients and access the Affinidi Elements services.
- Commons, a list of libraries that provides common methods like generation of claim and share links for Credential Issuance and Affinidi Iota Framework.
Each module has its own README that you can check to better understand how to integrate it into your application.
Requirements
- PHP version 7.4 or higher.
- Composer package manager.
Installation
Setting up a New Project
If you're starting a new project, first create a new directory and initialise it.
mkdir my-affinidi-project
cd my-affinidi-project
composer init
Install the Affinidi TDK via Composer.
composer require affinidi-tdk/affinidi-tdk-php
Quick Start
Here's a basic example of using the TDK to list wallets:
<?php require_once 'vendor/autoload.php'; use AuthProvider\AuthProvider; use AffinidiTdk\Clients\WalletsClient; // Configuration parameters $params = [ 'privateKey' => "", // Your private key 'keyId' => '', // Your key ID 'passphrase' => '', // Your passphrase 'projectId' => '', // Your project ID 'tokenId' => '' // Your token ID // Optional parameters: // 'apiGatewayUrl' => 'https://apse1.api.affinidi.io', // 'tokenEndpoint' => 'https://apse1.auth.developer.affinidi.io/auth/oauth2/token', ]; $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()); }
Testing
To run the test suite, use one of the following commands:
# Run all tests composer run-script test # Run tests with debug information composer run-script test:debug # Run a single test composer run-script test -- --filter testSignAndRevokeCredential # ❗️ NOTE: For internal usage. To run tests against DEV environment AFFINIDI_TDK_ENVIRONMENT=dev composer run-script test
The debug mode provides additional information that can be helpful when troubleshooting failing tests.
Documentation
Head over to our Documentation site to know how to get started with Affinidi TDK.
Use this document to learn more about how to work with Affinidi TDK, including generating the Authorisation Token and calling the methods.
To learn how to integrate Affinidi TDK and use the different modules into your application, you can explore the following:
Support & feedback
If you face any issues or have suggestions, please don't hesitate to contact us using this link.
Reporting technical issues
If you have a technical issue with the Affinidi TDK's codebase, you can also create an issue directly in GitHub.
-
Ensure the bug was not already reported by searching on GitHub under Issues.
-
If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.
Contributing
Want to contribute?
Head over to our CONTRIBUTING guidelines.
FAQ
What can I develop?
You are only limited by your imagination! Affinidi TDK is a toolbox with which you can build software applications for personal or commercial use.
Is there anything I should not develop?
We only provide the tools - how you use them is largely up to you. We have no control over what you develop with our tools - but please use our tools responsibly!
We hope that you will not develop anything that contravenes any applicable laws or regulations. Your projects should also not infringe on Affinidi's or any third party's intellectual property (for instance, misusing other parties' data, code, logos, etc).
What responsibilities do I have to my end-users?
Please ensure that you have in place your terms and conditions, privacy policies, and other safeguards to ensure that the projects you build are secure for your end users.
If you are processing personal data, please protect the privacy and other legal rights of your end-users and store their personal or sensitive information securely.
Some of our components would also require you to incorporate our end-user notices into your terms and conditions.
Is Affinidi TDK free for use?
Affinidi TDK itself is free, so come onboard and experiment with our tools and see what you can build! We may bill for certain components in the future, but we will inform you beforehand.
Is there any limit or cap to my usage of the Affinidi TDK?
We may from time to time impose limits on your use of the Affinidi TDK, such as limiting the number of API requests that you may make in a given duration. This is to ensure the smooth operation of the Affinidi TDK so that you and all our other users can have a pleasant experience as we continue to scale and improve the Affinidi TDK.
Do I need to provide you with anything?
From time to time, we may request certain information from you to ensure that you are complying with the Terms and Conditions.
Can I share my developer's account with others?
When you create a developer's account with us, we will issue you your private login credentials. Please do not share this with anyone else, as you would be responsible for activities that happen under your account. If you have interested friends, ask them to sign up – let's build together!
Telemetry
Affinidi collects usage data to improve our products and services. For information on what data we collect and how we use your data, please refer to our Privacy Notice.
Disclaimer: Please note that this FAQ is provided for informational purposes only and is not to be considered a legal document. For the legal terms and conditions governing your use of the Affinidi Services, please refer to our Terms and Conditions.
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
affinidi-tdk/affinidi-tdk-php 适用场景与选型建议
affinidi-tdk/affinidi-tdk-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 457 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 12 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「trust」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 affinidi-tdk/affinidi-tdk-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 affinidi-tdk/affinidi-tdk-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 affinidi-tdk/affinidi-tdk-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Role-Based Permissions for Laravel 5.3+
Laravel framework Service Provider to automatic loading IP ranges of Cloudflare trust proxies.
PHP 8.0+ fully-featured authentication & authorization system
concrete5 package to manage the trusted proxy IP addresses
concrete5 package for proxy_ip_manager to support resolving CloudFront records
Suspicion-scoring trust & moderation engine for Laravel. Pluggable detectors accrue suspicion points; thresholds flag, restrict, queue for review, or ban.
统计信息
- 总下载量: 457
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2024-12-13