load(); } $list = []; foreach (\func_get_args() as $filename) { $list[$filename] = (new IniCredential($filename))->load(); } return $list; } /** * Custom Client. * * @param CredentialsInterface $credentials * @param SignatureInterface $signature * * @return Client */ public static function client(CredentialsInterface $credentials, SignatureInterface $signature) { return new Client($credentials, $signature); } /** * Use the AccessKey to complete the authentication. * * @param string $accessKeyId * @param string $accessKeySecret * * @return AccessKeyClient * @throws ClientException */ public static function accessKeyClient($accessKeyId, $accessKeySecret) { return new AccessKeyClient($accessKeyId, $accessKeySecret); } /** * Use the AssumeRole of the RAM account to complete the authentication. * * @param string $accessKeyId * @param string $accessKeySecret * @param string $roleArn * @param string $roleSessionName * @param string|array $policy * * @return RamRoleArnClient * @throws ClientException */ public static function ramRoleArnClient($accessKeyId, $accessKeySecret, $roleArn, $roleSessionName, $policy = '') { return new RamRoleArnClient($accessKeyId, $accessKeySecret, $roleArn, $roleSessionName, $policy); } /** * Use the RAM role of an ECS instance to complete the authentication. * * @param string $roleName * * @return EcsRamRoleClient * @throws ClientException */ public static function ecsRamRoleClient($roleName) { return new EcsRamRoleClient($roleName); } /** * Use the Bearer Token to complete the authentication. * * @param string $bearerToken * * @return BearerTokenClient * @throws ClientException */ public static function bearerTokenClient($bearerToken) { return new BearerTokenClient($bearerToken); } /** * Use the STS Token to complete the authentication. * * @param string $accessKeyId Access key ID * @param string $accessKeySecret Access Key Secret * @param string $securityToken Security Token * * @return StsClient * @throws ClientException */ public static function stsClient($accessKeyId, $accessKeySecret, $securityToken = '') { return new StsClient($accessKeyId, $accessKeySecret, $securityToken); } /** * Use the RSA key pair to complete the authentication (supported only on Japanese site) * * @param string $publicKeyId * @param string $privateKeyFile * * @return RsaKeyPairClient * @throws ClientException */ public static function rsaKeyPairClient($publicKeyId, $privateKeyFile) { return new RsaKeyPairClient($publicKeyId, $privateKeyFile); } }