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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
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, 感谢原作者

修改信息

  1. 添加了命名空间 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
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zeroone2005/qcloud-sts-sdk contains the following files

Loading the files please wait ...