reallyli/laravel-aliyun-sts
Composer 安装命令:
composer require reallyli/laravel-aliyun-sts
包简介
Aliyun STS for Laravel.
README 文档
README
🎃 Aliyun STS for Laravel.
Installing
$ composer require reallyli/laravel-aliyun-sts -v
After updated composer, if you are using laravel version < 5.5, you need to register service provider:
// config/app.php 'providers' => [ //... Reallyli\AliyunSts\ServiceProvider::class, ],
And publish the config file:
$ php artisan vendor:publish --provider=Reallyli\\AliyunSts\\ServiceProvider
if you want to use facade mode, you can register a facade name what you want to use, for example AliyunSts:
// config/app.php 'aliases' => [ 'AliyunSts' => Reallyli\AliyunSts\AliyunSts::class, // This is default in laravel 5.5 ],
configuration
// config/sts.php return [ /** * @link https://help.aliyun.com/document_detail/100624.html * AccessKeyId、AccessKeySecret:子账号AK信息 */ 'accessKeyId' => env('ALIYUN_STS_ACCESS_KEY_ID'), 'accessKeySecret' => env('ALIYUN_STS_ACCESS_KEY_SECRET'), /** * @link https://help.aliyun.com/document_detail/66053.html * regionId和endpoint */ 'regionId' => env('ALIYUN_STS_REGION_ID'), 'endpoint' => env('ALIYUN_STS_ENDPOINT'), /** * @link https://help.aliyun.com/document_detail/100624.html * 创建角色(需要扮演的角色ID) */ 'roleArn' => env('ALIYUN_STS_ROLE_ARN'), /** * @link https://help.aliyun.com/document_detail/100624.html * 设置临时凭证的有效期,单位是s,最小为900,最大为3600 */ 'expiration' => env('ALIYUN_STS_EXIRATION'), // 令牌过期时间 /** * @link https://help.aliyun.com/document_detail/100624.html * RoleSessionName即临时身份的会话名称,用于区分不同的临时身份 */ 'clientName' => env('ALIYUN_STS_CLIENT_NAME'), /** * @link https://help.aliyun.com/document_detail/100624.html * 创建权限策略(在扮演角色的时候额外添加的权限限制) */ 'policy' => [ 'Statement' => [ [ 'Action' => "*", 'Effect' => 'Allow', 'Resource' => [ "acs:oss:*:*:default", ], ], ], "Version" => "1", ], ];
Usage
AliyunSts::getCredentials();
Links
Contact
reallyli/laravel-aliyun-sts 适用场景与选型建议
reallyli/laravel-aliyun-sts 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.46k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 11 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 reallyli/laravel-aliyun-sts 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 reallyli/laravel-aliyun-sts 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.46k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-11-05