Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ AccessKeySecret,在使用Aliyun OSS SDK时需要提供您的这两个信息。
### 创建Client

client = Aliyun::OSS::Client.new(
:endpoint => endpoint,
:endpoint => 'endpoint',
:access_key_id => 'access_key_id',
:access_key_secret => 'access_key_secret')

Expand Down Expand Up @@ -98,10 +98,10 @@ aliyun-sdk中包含了STS的SDK,使用时只需要`require 'aliyun/sts'`即可
token = sts.assume_role('role-arn', 'my-app')

client = Aliyun::OSS::Client.new(
:endpoint => 'http://img.my-domain.com',
:endpoint => 'http://oss-cn-hangzhou.aliyuncs.com',
:access_key_id => token.access_key_id,
:access_key_secret => token.access_key_secret,
:sts_token => token.sts_token)
:sts_token => token.security_token)

注意使用STS时必须指定`:sts_token`参数。用户还可以通过`STS::Client`申请
带Policy的token,细节请参考[API文档][sdk-api]。
Expand Down
4 changes: 2 additions & 2 deletions lib/aliyun/oss/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module OSS
# OSS服务的客户端,用于获取bucket列表,创建/删除bucket。Object相关
# 的操作请使用{OSS::Bucket}。
# @example 创建Client
# endpoint = 'oss-cn-hangzhou.oss.aliyuncs.com'
# endpoint = 'oss-cn-hangzhou.aliyuncs.com'
# client = Client.new(
# :endpoint => endpoint,
# :access_key_id => 'access_key_id',
Expand All @@ -21,7 +21,7 @@ class Client
# 构造OSS client,用于操作buckets。
# @param opts [Hash] 构造Client时的参数选项
# @option opts [String] :endpoint [必填]OSS服务的地址,可以是以
# oss.aliyuncs.com的标准域名,也可以是用户绑定的域名
# oss-cn-hangzhou.aliyuncs.com的标准域名,也可以是用户绑定的域名
# @option opts [String] :access_key_id [可选]用户的ACCESS KEY ID,
# 如果不填则会尝试匿名访问
# @option opts [String] :access_key_secret [可选]用户的ACCESS
Expand Down