Download the PHP package alibabacloud/credentials without Composer

On this page you can find all versions of the php package alibabacloud/credentials. 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 credentials

English | 简体中文

Alibaba Cloud Credentials for PHP

PHP CI codecov Latest Stable Version composer.lock Total Downloads License

Alibaba Cloud Credentials for PHP is a tool that helps PHP developers manage their credentials.

Prerequisites

Your system needs to meet Prerequisites, including PHP> = 5.6. We strongly recommend using the cURL extension and compiling cURL 7.16.2+ using the TLS backend.

Installation

If you have Globally Install Composer on your system, install Alibaba Cloud Credentials for PHP as a dependency by running the following directly in the project directory:

Some users may not be able to install due to network problems, you can switch to the Alibaba Cloud Composer Mirror.

See Installation for details on installing through Composer and other means.

Quick Examples

Before you begin, you need to sign up for an Alibaba Cloud account and retrieve your Credentials.

Credential Type

Default credential provider chain

If you do not specify a method to initialize a Credentials client, the default credential provider chain is used. For more information, see the Default credential provider chain section of this topic.

AccessKey

Setup access_key credential through [User Information Management][ak], it have full authority over the account, please keep it safe. Sometimes for security reasons, you cannot hand over a primary account AccessKey with full access to the developer of a project. You may create a sub-account [RAM Sub-account][ram] , grant its [authorization][permissions],and use the AccessKey of RAM Sub-account.

STS

Create a temporary security credential by applying Temporary Security Credentials (TSC) through the Security Token Service (STS).

RamRoleArn

By specifying [RAM Role][RAM Role], the credential will be able to automatically request maintenance of STS Token. If you want to limit the permissions([How to make a policy][policy]) of STS Token, you can assign value for Policy.

EcsRamRole

Both ECS and ECI instances support binding instance RAM roles. When the Credentials tool is used in an instance, the RAM role bound to the instance will be automatically obtained, and the STS Token of the RAM role will be obtained by accessing the metadata service to complete the initialization of the credential client.

The instance metadata server supports two access modes: hardened mode and normal mode. The Credentials tool uses hardened mode (IMDSv2) by default to obtain access credentials. If an exception occurs when using hardened mode, you can set disableIMDSv1 to perform different exception handling logic:

Whether the server supports IMDSv2 depends on your configuration on the server.

OIDCRoleArn

After you attach a RAM role to a worker node in an Container Service for Kubernetes, applications in the pods on the worker node can use the metadata server to obtain an STS token the same way in which applications on ECS instances do. However, if an untrusted application is deployed on the worker node, such as an application that is submitted by your customer and whose code is unavailable to you, you may not want the application to use the metadata server to obtain an STS token of the RAM role attached to the worker node. To ensure the security of cloud resources and enable untrusted applications to securely obtain required STS tokens, you can use the RAM Roles for Service Accounts (RRSA) feature to grant minimum necessary permissions to an application. In this case, the ACK cluster creates a service account OpenID Connect (OIDC) token file, associates the token file with a pod, and then injects relevant environment variables into the pod. Then, the Credentials tool uses the environment variables to call the AssumeRoleWithOIDC operation of STS and obtains an STS token of the RAM role. For more information about the RRSA feature, see Use RRSA to authorize different pods to access different cloud services.

Credentials URI

By specifying the url, the credential will be able to automatically request maintenance of STS Token.

Bearer Token

If credential is required by the Cloud Call Centre (CCC), please apply for Bearer Token maintenance by yourself.

Default credential provider chain

If you want to use different types of credentials in the development and production environments of your application, you generally need to obtain the environment information from the code and write code branches to obtain different credentials for the development and production environments. The default credential provider chain of the Credentials tool allows you to use the same code to obtain credentials for different environments based on configurations independent of the application. If you use $credential = new Credential(); to initialize a Credentials client without specifying an initialization method, the Credentials tool obtains the credential information in the following order:

1. Environmental certificate

Look for environment credentials in environment variable.

2. The RAM role of an OIDC IdP

If no credentials are found in the previous step, the Credentials tool obtains the values of the following environment variables:

ALIBABA_CLOUD_ROLE_ARN: the ARN of the RAM role.

ALIBABA_CLOUD_OIDC_PROVIDER_ARN: the ARN of the OIDC IdP.

ALIBABA_CLOUD_OIDC_TOKEN_FILE: the path of the OIDC token file.

If the preceding three environment variables are specified, the Credentials tool uses the environment variables to call the AssumeRoleWithOIDC operation of STS to obtain an STS token as the default credential.

3. Using the config.json Configuration File of Aliyun CLI Tool

If there is no higher-priority credential information, the Credentials tool will first check the following locations to see if the config.json file exists:

Linux system: ~/.aliyun/config.json Windows system: C:\Users\USER_NAME\.aliyun\config.json If the file exists, the program will use the credential information specified by current in the configuration file to initialize the credentials client. Of course, you can also use the environment variable ALIBABA_CLOUD_PROFILE to specify the credential information, for example by setting the value of ALIBABA_CLOUD_PROFILE to AK.

In the config.json configuration file, the value of each module represents different ways to obtain credential information:

The configuration example information is as follows:

4. Configuration file

If the user's home directory has the default file ~/.alibabacloud/credentials (Windows is C:\Users\USER_NAME\.alibabacloud\credentials), the program will automatically create credentials with the specified type and name. You can also specify the configuration file path by configuring the ALIBABA_CLOUD_CREDENTIALS_FILE environment variable. If the configuration file exists, the application initializes a Credentials client by using the credential information that is specified by default in the configuration file. You can also configure the ALIBABA_CLOUD_PROFILE environment variable to modify the default credential information that is read.

Configuration example:

5. Instance RAM role

If there is no credential information with a higher priority, the Credentials tool will obtain the value of ALIBABA_CLOUD_ECS_METADATA (ECS instance RAM role name) through the environment variable. If the value of this variable exists, the program will use the hardened mode (IMDSv2) to access the metadata service (Meta Data Server) of ECS to obtain the STS Token of the ECS instance RAM role as the default credential information. If an exception occurs when using the hardened mode, the normal mode will be used as a fallback to obtain access credentials. You can also set the environment variable ALIBABA_CLOUD_IMDSV1_DISABLED to perform different exception handling logic:

Whether the server supports IMDSv2 depends on your configuration on the server.

6. Using External Service Credentials URI

If there are no higher-priority credential information, the Credentials tool will obtain the ALIBABA_CLOUD_CREDENTIALS_URI from the environment variables. If it exists, the program will request the URI address to obtain temporary security credentials as the default credential information.

The external service response structure should be as follows:

Documentation

Issue

Submit Issue, Problems that do not meet the guidelines may close immediately.

Release notes

Detailed changes for each version are recorded in the Release Notes.

Contribution

Please read the Contribution Guide before submitting a Pull Request.

Related

License

Apache-2.0

Copyright (c) 2009-present, Alibaba Cloud All rights reserved.


All versions of credentials with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
ext-curl Version *
ext-json Version *
ext-libxml Version *
ext-openssl Version *
ext-mbstring Version *
ext-simplexml Version *
ext-xmlwriter Version *
guzzlehttp/guzzle Version ^6.3|^7.0
adbario/php-dot-notation Version ^2.2
alibabacloud/tea Version ^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 alibabacloud/credentials contains the following files

Loading the files please wait ....