PHPackages                             shaozeming/aliyun-sts - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. shaozeming/aliyun-sts

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

shaozeming/aliyun-sts
=====================

基于阿里云openapi系列接口中STS最新版本的SDK进行封装的composer package

v1.0.1(7y ago)2021.1k3[1 issues](https://github.com/ShaoZeMing/Aliyun-Sts/issues)1MITPHP

Since Mar 9Pushed 7y ago4 watchersCompare

[ Source](https://github.com/ShaoZeMing/Aliyun-Sts)[ Packagist](https://packagist.org/packages/shaozeming/aliyun-sts)[ RSS](/packages/shaozeming-aliyun-sts/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (3)Used By (1)

Aliyun Sts for PHP
==================

[](#aliyun-sts-for-php)

---

[![](https://camo.githubusercontent.com/f9947f3b404a95ad136a7d83aad79fbc05be78aa894b03b58a71a4959b16def7/68747470733a2f2f7472617669732d63692e6f72672f5368616f5a654d696e672f416c6979756e2d5374732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ShaoZeMing/Aliyun-Sts)[![](https://camo.githubusercontent.com/0e2ed184d66ee30cb548d6c74b258cdce93e24c435f16b4095d654f9269e4f59/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f5368616f5a654d696e672f616c6979756e2d7374732e737667)](https://packagist.org/packages/shaozeming/aliyun-sts)[![](https://camo.githubusercontent.com/29525fcf83be44f9b31c70a4f4b878bf0886646dbed8972eb594890928300ed1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f5368616f5a654d696e672f616c6979756e2d7374732e737667)](https://packagist.org/packages/stichoza/shaozeming/aliyun-sts)

> 这个项目的功能就是获取sts token, 功能虽然很单一，但和其他项目都是低耦合，如果你想使用oss,vod，...请访问他的兄弟项目

同胞兄弟
----

[](#同胞兄弟)

- [ShaoZeMing/aliyun-vod](https://github.com/ShaoZeMing/Aliyun-Vod) 阿里云点播
- [ShaoZeMing/aliyun-sts](https://github.com/ShaoZeMing/Aliyun-Sts) 阿里云STS
- [ShaoZeMing/aliyun-core](https://github.com/ShaoZeMing/Aliyun-Core) 阿里云接口Core核心包
- [ShaoZeMing/aliyun-oss](https://github.com/ShaoZeMing/Aliyun-Oss) 阿里云OSS
- 待续...

Installing
----------

[](#installing)

```
$ composer require shaozeming/aliyun-sts -v
```

### configuration

[](#configuration)

拷贝项目下`src/config.php`到你项目中，进行配置其中sts。

配置示例代码：

```
return [

    /*STS配置*/
    'sts' => [
        'AccessKeyID' => '****密码不给看****',
        'AccessKeySecret' => '****密码不给看****',
        'regionId' => 'cn-beijing',
        'endpoint' => 'sts.cn-beijing.aliyuncs.com',
        'roleArn' => 'acs:ram::1******38:role/aliyun*******rkfdale',  // 角色资源描述符，在RAM的控制台的资源详情页上可以获取
        'timeout' => '3600',  // 令牌过期时间
        'client_name' => 'client_name',  // setRoleSessionName可以不改
        // 在扮演角色(AssumeRole)时，可以附加一个授权策略，进一步限制角色的权限；
        // 详情请参考《RAM使用指南》
        // 这代表所有权限
        'policy' => [
            'Statement' => [
                [
                    'Action' => ["oss:*"],
                    'Effect' => 'Allow',
                    'Resource' => ["acs:oss:*:*:*"],
                ]
            ]
        ]
    ]
];
```

Example
-------

[](#example)

```
use ShaoZeMing\AliSTS\Services\STSService;

        try {
            $config = include 'you_path/config.php';
            $sts = new STSService($config);
            $result =  $sts->getToken(); // 获取播放权限参数
            print_r($result);
            return $result;
        } catch (\Exception $e) {
            $err = "Error : 错误：" . $e->getMessage();
            echo $err . PHP_EOL;
        }

```

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2674d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/27b8938a70163fe95a1bea9ead4bfa7386b3fef2e00dd6c55bc1b3a20351fc72?d=identicon)[ShaoZeMing](/maintainers/ShaoZeMing)

---

Top Contributors

[![ShaoZeMing](https://avatars.githubusercontent.com/u/19376576?v=4)](https://github.com/ShaoZeMing "ShaoZeMing (5 commits)")

---

Tags

aliyun-ossaliyun-stscomposerlaravelphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shaozeming-aliyun-sts/health.svg)

```
[![Health](https://phpackages.com/badges/shaozeming-aliyun-sts/health.svg)](https://phpackages.com/packages/shaozeming-aliyun-sts)
```

###  Alternatives

[markwalet/laravel-changelog

A Laravel package that prevents merge conflicts on your changelog file.

1855.4k](/packages/markwalet-laravel-changelog)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
