Download the PHP package zeroone2005/qcloud-sts-sdk without Composer
On this page you can find all versions of the php package zeroone2005/qcloud-sts-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download zeroone2005/qcloud-sts-sdk
More information about zeroone2005/qcloud-sts-sdk
Files in zeroone2005/qcloud-sts-sdk
Download zeroone2005/qcloud-sts-sdk
More information about zeroone2005/qcloud-sts-sdk
Files in zeroone2005/qcloud-sts-sdk
Please rate this library. Is it a good library?
Informations about the package qcloud-sts-sdk
qcloud-sts-sdk
修改源于https://github.com/tencentyun/qcloud-cos-sts-sdk.git, 感谢原作者
修改信息
- 添加了命名空间 Qcloud
安装包
composer require zeroone2005/qcloud-sts-sdk
接口说明
getTempKeys
获取临时密钥接口
参数说明
| 字段 | 类型 | 描述 |
|---|---|---|
| secretId | string | 云 API 密钥 Id |
| secretKey | string | 云 API 密钥 key |
| durationSeconds | long | 要申请的临时密钥最长有效时间,单位秒,默认 1800,最大可设置 7200 |
| bucket | string | 存储桶名称:bucketName-appid, 如 test-125000000 |
| region | string | 存储桶所属地域,如 ap-guangzhou |
| allowPrefix | string | 资源的前缀,如授予操作所有资源,则为*;如授予操作某个路径a下的所有资源,则为 a/*,如授予只能操作特定的文件a/test.jpg, 则为a/test.jpg |
| allowActions | array | 授予 COS API 权限集合, 如简单上传操作:name/cos:PutObject |
| policy | array | 策略:由 allowActions、bucket、region、allowPrefix字段组成的描述授权的具体信息 |
返回值说明
| 字段 | 类型 | 描述 |
|---|---|---|
| credentials | string | 临时密钥信息 |
| tmpSecretId | string | 临时密钥 Id,可用于计算签名 |
| tmpSecretKey | string | 临时密钥 Key,可用于计算签名 |
| sessionToken | string | 请求时需要用的 token 字符串,最终请求 COS API 时,需要放在 Header 的 x-cos-security-token 字段 |
| startTime | string | 密钥的起止时间,是 UNIX 时间戳 |
| expiredTime | string | 密钥的失效时间,是 UNIX 时间戳 |
使用示例
返回结果
成功的话,可以拿到包含密钥的 JSON 文本:
getPolicy
获取策略(policy)接口。本接口适用于接收 Web、iOS、Android 客户端 SDK 提供的 Scope 参数。推荐您把 Scope 参数放在请求的 Body 里面,通过 POST 方式传到后台。
参数说明
| 字段 | 类型 | 描述 |
|---|---|---|
| bucket | string | 存储桶名称:bucketName-appid, 如 test-125000000 |
| region | string | 存储桶所属地域,如 ap-guangzhou |
| sourcePrefix | string | 资源的前缀,如授予操作所有资源,则为*;如授予操作某个路径a下的所有资源,则为 a/*,如授予只能操作特定的文件a/test.jpg, 则为a/test.jpg |
| action | string | 授予 COS API 权限,如简单上传操作 name/cos:PutObject |
| scope | Scope | 构造policy的信息:由 action、bucket、region、sourcePrefix组成 |
返回值说明
| 字段 | 类型 | 描述 |
|---|---|---|
| policy | array | 申请临时密钥所需的权限策略 |
使用示例
返回结果
All versions of qcloud-sts-sdk with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.3.0
The package zeroone2005/qcloud-sts-sdk contains the following files
Loading the files please wait ...