iamxid/iamx-wallet-pro
Composer 安装命令:
composer require iamxid/iamx-wallet-pro
包简介
This package allows users to use the IAMX wallet to authenticate into a laravel project and sign, verify, encrypt and decrypt data using the IAMX identity wallet.
README 文档
README
IAMX wallet pro is a Laravel package to login to a laravel application using the IAMX identity wallet and sign, verify, encrypt and decrypt data using the IAMX identity wallet.
Installation
Install the current version of the iamxid/iamx-wallet-pro package via composer:
composer require iamxid/iamx-wallet-pro:dev-main
Configuration
Publish the migration file:
php artisan vendor:publish --provider="IAMXID\IamxWalletPro\IamxWalletProServiceProvider" --tag="migrations"
Run the migration:
php artisan migrate
Add the scope to the .env file. Example:
IAMX_IDENTITY_SCOPE={"did":"","person":{},"vUID":{},"address":{},"email":{},"mobilephone":{}}
Add the redirect URL to the .env file. Example:
IAMX_IDENTITY_CONNECT_REDIRECT_URL="/page_to_load_after_login"
Usage
Add the attribute "iamx_vuid" to the $fillable array in /app/Models/User.php
protected $fillable = [ 'name', 'email', 'password', 'iamx_vuid' ];
Add the HasDID trait to the user model in /app/Models/User.php
use IAMXID\IamxWalletPro\Traits\HasDID; class User extends Model { use HasDID; ... }
Place the component <x-iamxwalletpro-identity-connector /> in your blade template to insert the wallet connect
snippet.
Place the component <x-iamxwalletpro-identity-sign /> in your blade template to insert the sign data snippet.
Place the component <x-iamxwalletpro-identity-verify /> in your blade template to insert the verify data snippet.
Place the component <x-iamxwalletpro-identity-encrypt /> in your blade template to insert the encrypt data
snippet.
Place the component <x-iamxwalletpro-identity-decrypt /> in your blade template to insert the decrypt data
snippet.
Style the connect button and the container in your css file using the classes btn-identity-connect
and container-identity-connect.
Style the sign data button, the container and the input fields in your css file using the
classes btn-identity-signData, container-identity-signData and input-label-signData.
Style the verify data button, the container and the input fields in your css file using the
classes btn-identity-verifyData, container-identity-verifyData and input-label-verifyData.
Style the encrypt data button, the container and the input fields in your css file using the
classes btn-identity-encryptData, container-identity-encryptData and input-label-encryptData.
Style the decrypt data button, the container and the input fields in your css file using the
classes btn-identity-decryptData, container-identity-decryptData and input-label-decryptData.
@tailwind base;
@tailwind components;
.container-identity-connect {
@apply m-5
}
.container-identity-signData {
@apply m-5 p-2 border-2 border-black
}
.container-identity-verifyData {
@apply m-5 p-2 border-2 border-black
}
.container-identity-encryptData {
@apply m-5 p-2 border-2 border-black
}
.container-identity-decryptData {
@apply m-5 p-2 border-2 border-black
}
.btn-identity-connect {
@apply bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded
}
.btn-identity-signData {
@apply bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded mt-1
}
.btn-identity-verifyData {
@apply bg-emerald-500 hover:bg-emerald-700 text-white font-bold py-2 px-4 rounded mt-1
}
.btn-identity-encryptData {
@apply bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded mt-1
}
.btn-identity-decryptData {
@apply bg-orange-500 hover:bg-orange-700 text-white font-bold py-2 px-4 rounded mt-1
}
.input-verifyData {
@apply bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500
}
.input-label-verifyData {
@apply block mb-2 text-sm font-medium text-gray-900 dark:text-white
}
.input-signData {
@apply bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500
}
.input-label-signData {
@apply block mb-2 text-sm font-medium text-gray-900 dark:text-white
}
.input-encryptData {
@apply bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500
}
.input-label-encryptData {
@apply block mb-2 text-sm font-medium text-gray-900 dark:text-white
}
.input-decryptData {
@apply bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500
}
.input-label-decryptData {
@apply block mb-2 text-sm font-medium text-gray-900 dark:text-white
}
@tailwind utilities;
Examples
Use the functions in the HasDID trait in your application to access the IAMX wallet attributes:
Fetch single attributes:
$user = User::find(1); $street = $user->getDIDAttribute('address', 'street', $user->id); $housenr = $user->getDIDAttribute('address', 'housenr', $user->id); $zip = $user->getDIDAttribute('address', 'zip', $user->id);
Fetch all attributes of a category:
$user = User::find(1); $allCategoryValues = $user->getDIDCategoryValues('address', $user->id);
Fetch all available attributes:
$user = User::find(1); $allValues = $user->getAllDIDValues($user->id);
Bugs and Suggestions
Copyright and License
iamxid/iamx-wallet-pro 适用场景与选型建议
iamxid/iamx-wallet-pro 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 07 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 iamxid/iamx-wallet-pro 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 iamxid/iamx-wallet-pro 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-09