Skip to content
Browse files

替换域名为oss.aliyun.com

  • Loading branch information...
1 parent b7fe18d commit 73c0077b751fd45e8529425bbef56c184d8e5478 mangege committed Oct 1, 2012
View
1 .gitignore
@@ -1,3 +1,4 @@
.rake_tasks
site/public/index.html
pkg/
+kitty.rb
View
4 Rakefile
@@ -93,12 +93,12 @@ namespace :dist do
desc 'Install with gems'
task :install => :repackage do
- sh "sudo gem i pkg/#{spec.name}-#{spec.version}.gem"
+ sh "gem i pkg/#{spec.name}-#{spec.version}.gem"
end
desc 'Uninstall gem'
task :uninstall do
- sh "sudo gem uninstall #{spec.name} -x"
+ sh "gem uninstall #{spec.name} -x"
end
desc 'Reinstall gem'
View
6 lib/aws/s3/acl.rb
@@ -23,7 +23,7 @@ module S3
# Since the image we created is publicly readable, we can access it directly from a browser by going to the corresponding bucket name
# and specifying the object's key without a special authenticated url:
#
- # http://s3.amazonaws.com/marcel/kiss.jpg
+ # http://oss.aliyun.com/marcel/kiss.jpg
#
# ==== Building custum access policies
#
@@ -85,7 +85,7 @@ module S3
#
# If we were to access this object's acl url from a browser:
#
- # http://s3.amazonaws.com/marcel/kiss.jpg?acl
+ # http://oss.aliyun.com/marcel/kiss.jpg?acl
#
# we would be shown its access control policy.
#
@@ -187,7 +187,7 @@ def initialize(owner, grants)
end
def build
- xml.tag!('AccessControlPolicy', 'xmlns' => 'http://s3.amazonaws.com/doc/2006-03-01/') do
+ xml.tag!('AccessControlPolicy', 'xmlns' => 'http://oss.aliyun.com/doc/2006-03-01/') do
xml.Owner do
xml.ID owner.id
xml.DisplayName owner.display_name
View
6 lib/aws/s3/authentication.rb
@@ -9,7 +9,7 @@ module S3
# Header based authentication is achieved by setting a special <tt>Authorization</tt> header whose value
# is formatted like so:
#
- # "AWS #{access_key_id}:#{encoded_canonical}"
+ # "OSS #{access_key_id}:#{encoded_canonical}"
#
# The <tt>access_key_id</tt> is the public key that is assigned by Amazon for a given account which you use when
# establishing your initial connection. The <tt>encoded_canonical</tt> is computed according to rules layed out
@@ -92,7 +92,7 @@ def date
class Header < Signature #:nodoc:
def initialize(*args)
super
- self << "AWS #{access_key_id}:#{encoded_canonical}"
+ self << "OSS #{access_key_id}:#{encoded_canonical}"
end
end
@@ -155,7 +155,7 @@ def initialize(request, options = {})
@headers = {}
@options = options
# "For non-authenticated or anonymous requests. A NotImplemented error result code will be returned if
- # an authenticated (signed) request specifies a Host: header other than 's3.amazonaws.com'"
+ # an authenticated (signed) request specifies a Host: header other than 'oss.aliyun.com'"
# (from http://docs.amazonwebservices.com/AmazonS3/2006-03-01/VirtualHosting.html)
request['Host'] = DEFAULT_HOST
build
View
6 lib/aws/s3/base.rb
@@ -42,7 +42,7 @@ module AWS #:nodoc:
#
# See more connection details at AWS::S3::Connection::Management::ClassMethods.
module S3
- constant :DEFAULT_HOST, 's3.amazonaws.com'
+ constant :DEFAULT_HOST, 'oss.aliyun.com'
# AWS::S3::Base is the abstract super class of all classes who make requests against S3, such as the built in
# Service, Bucket and S3Object classes. It provides methods for making requests, inferring or setting response classes,
@@ -96,9 +96,9 @@ def #{verb}(path, headers = {}, body = nil, &block)
# infer the current bucket by looking for it as the subdomain of the current connection's address. If no subdomain
# is found, CurrentBucketNotSpecified will be raised.
#
- # MusicBucket.establish_connection! :server => 'jukeboxzero.s3.amazonaws.com'
+ # MusicBucket.establish_connection! :server => 'jukeboxzero.oss.aliyun.com'
# MusicBucket.connection.server
- # => 'jukeboxzero.s3.amazonaws.com'
+ # => 'jukeboxzero.oss.aliyun.com'
# MusicBucket.current_bucket
# => 'jukeboxzero'
#
View
2 lib/aws/s3/bittorrent.rb
@@ -19,7 +19,7 @@ module S3
#
# Anonymous requests to
#
- # http://s3.amazonaws.com/marcel/kiss.jpg?torrent
+ # http://oss.aliyun.com/marcel/kiss.jpg?torrent
#
# will serve up the torrent file for that object.
module BitTorrent
View
2 lib/aws/s3/connection.rb
@@ -181,7 +181,7 @@ module ClassMethods
# == Optional arguments
#
# * <tt>:server</tt> - The server to make requests to. You can use this to specify your bucket in the subdomain,
- # or your own domain's cname if you are using virtual hosted buckets. Defaults to <tt>s3.amazonaws.com</tt>.
+ # or your own domain's cname if you are using virtual hosted buckets. Defaults to <tt>oss.aliyun.com</tt>.
# * <tt>:port</tt> - The port to the requests should be made on. Defaults to 80 or 443 if the <tt>:use_ssl</tt>
# argument is set.
# * <tt>:use_ssl</tt> - Whether requests should be made over SSL. If set to true, the <tt>:port</tt> argument
View
2 lib/aws/s3/logging.rb
@@ -73,7 +73,7 @@ def initialize(logging_status)
end
def build
- xml.tag!('BucketLoggingStatus', 'xmlns' => 'http://s3.amazonaws.com/doc/2006-03-01/') do
+ xml.tag!('BucketLoggingStatus', 'xmlns' => 'http://oss.aliyun.com/doc/2006-03-01/') do
if logging_status.target_bucket && logging_status.target_prefix
xml.LoggingEnabled do
xml.TargetBucket logging_status.target_bucket
View
2 lib/aws/s3/object.rb
@@ -287,7 +287,7 @@ def store(key, data, bucket = nil, options = {})
# S3Object.url_for('beluga_baby.jpg',
# 'marcel',
# :authenticated => false)
- # # => http://s3.amazonaws.com/marcel/beluga_baby.jpg
+ # # => http://oss.aliyun.com/marcel/beluga_baby.jpg
def url_for(name, bucket = nil, options = {})
connection.url_for(path!(bucket, name, options), options) # Do not normalize options
end
View
4 support/faster-xml-simple/test/fixtures/test-6.xml
@@ -1,4 +1,4 @@
-<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
+<ListBucketResult xmlns="http://oss.aliyun.com/doc/2006-03-01/">
<Name>projectionist</Name>
<Prefix/>
<Marker/>
@@ -26,4 +26,4 @@
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
-</ListBucketResult>
+</ListBucketResult>
View
4 support/faster-xml-simple/test/fixtures/test-7.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
+<AccessControlPolicy xmlns="http://oss.aliyun.com/doc/2006-03-01/">
<Owner>
<ID>bb2041a25975c3d4ce9775fe9e93e5b77a6a9fad97dc7e00686191f3790b13f1</ID>
<DisplayName>noradio</DisplayName>
@@ -19,4 +19,4 @@
<Permission>READ</Permission>
</Grant>
</AccessControlList>
-</AccessControlPolicy>
+</AccessControlPolicy>
View
4 test/base_test.rb
@@ -111,7 +111,7 @@ def test_default_connection_options_are_used_for_subsequent_connections
# No need to pass in the required options. The default connection will supply them
assert_nothing_raised do
- Bucket.establish_connection!(:server => 'foo.s3.amazonaws.com')
+ Bucket.establish_connection!(:server => 'foo.oss.aliyun.com')
end
assert Base.connection != Bucket.connection
@@ -125,7 +125,7 @@ def test_current_bucket
Base.current_bucket
end
- S3Object.establish_connection!(:server => 'foo-bucket.s3.amazonaws.com')
+ S3Object.establish_connection!(:server => 'foo-bucket.oss.aliyun.com')
assert_nothing_raised do
assert_equal 'foo-bucket', S3Object.current_bucket
end
View
8 test/connection_test.rb
@@ -85,10 +85,10 @@ def test_request_method_class_lookup
def test_url_for_uses_default_protocol_server_and_port
connection = Connection.new(:access_key_id => '123', :secret_access_key => 'abc', :port => 80)
- assert_match %r(^http://s3\.amazonaws\.com/foo\?), connection.url_for('/foo')
+ assert_match %r(^http://oss\.aliyun\.com/foo\?), connection.url_for('/foo')
connection = Connection.new(:access_key_id => '123', :secret_access_key => 'abc', :use_ssl => true, :port => 443)
- assert_match %r(^https://s3\.amazonaws\.com/foo\?), connection.url_for('/foo')
+ assert_match %r(^https://oss\.aliyun\.com/foo\?), connection.url_for('/foo')
end
def test_url_for_remembers_custom_protocol_server_and_port
@@ -121,6 +121,8 @@ def test_request_only_escapes_the_path_the_first_time_it_runs_and_not_subsequent
flexmock(connection.http).should_receive(:request).and_raise(Errno::EPIPE).ordered
flexmock(connection.http).should_receive(:request).ordered
connection.request :put, unescaped_path
+ rescue Net::HTTPBadResponse
+ #TODO 阿里云tengine过滤非法请求返回为非标准Http响应
end
def test_if_request_has_no_body_then_the_content_length_is_set_to_zero
@@ -167,7 +169,7 @@ def test_explicit_port_trumps_use_ssl
def test_invalid_options_raise
assert_raises(InvalidConnectionOption) do
- generate_options(:host => 'campfire.s3.amazonaws.com')
+ generate_options(:host => 'campfire.oss.aliyun.com')
end
end
View
14 test/fixtures/buckets.yml
@@ -1,5 +1,5 @@
empty_bucket_list: >
- <ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
+ <ListAllMyBucketsResult xmlns="http://oss.aliyun.com/doc/2006-03-01/">
<Owner>
<ID>ab00c3106e091f8fe23154c85678cda66628adb330bc00f02cf4a1c36d76bc48</ID>
<DisplayName>amazon</DisplayName>
@@ -9,7 +9,7 @@ empty_bucket_list: >
bucket_list_with_one_bucket: >
- <ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
+ <ListAllMyBucketsResult xmlns="http://oss.aliyun.com/doc/2006-03-01/">
<Owner>
<ID>ab00c3106e091f8fe23154c85678cda66628adb330bc00f02cf4a1c36d76bc48</ID>
<DisplayName>amazon</DisplayName>
@@ -24,7 +24,7 @@ bucket_list_with_one_bucket: >
bucket_list_with_more_than_one_bucket: >
- <ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
+ <ListAllMyBucketsResult xmlns="http://oss.aliyun.com/doc/2006-03-01/">
<Owner>
<ID>ab00c3106e091f8fe23154c85678cda66628adb330bc00f02cf4a1c36d76bc48</ID>
<DisplayName>amazon</DisplayName>
@@ -42,7 +42,7 @@ bucket_list_with_more_than_one_bucket: >
</ListAllMyBucketsResult>
empty_bucket: >
- <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
+ <ListBucketResult xmlns="http://oss.aliyun.com/doc/2006-03-01/">
<Name>marcel_molina</Name>
<Prefix></Prefix>
<Marker></Marker>
@@ -51,7 +51,7 @@ empty_bucket: >
</ListBucketResult>
bucket_with_one_key: >
- <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
+ <ListBucketResult xmlns="http://oss.aliyun.com/doc/2006-03-01/">
<Name>marcel_molina</Name>
<Prefix></Prefix>
<Marker></Marker>
@@ -71,7 +71,7 @@ bucket_with_one_key: >
</ListBucketResult>
bucket_with_more_than_one_key: >
- <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
+ <ListBucketResult xmlns="http://oss.aliyun.com/doc/2006-03-01/">
<Name>marcel_molina</Name>
<Prefix></Prefix>
<Marker></Marker>
@@ -102,7 +102,7 @@ bucket_with_more_than_one_key: >
</ListBucketResult>
truncated_bucket_with_more_than_one_key: >
- <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
+ <ListBucketResult xmlns="http://oss.aliyun.com/doc/2006-03-01/">
<Name>marcel_molina</Name>
<Prefix></Prefix>
<Marker></Marker>
View
6 test/fixtures/logging.yml
@@ -1,15 +1,15 @@
logging_enabled: >
- <BucketLoggingStatus xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
+ <BucketLoggingStatus xmlns="http://oss.aliyun.com/doc/2006-03-01/">
<LoggingEnabled>
<TargetBucket>mylogs</TargetBucket>
<TargetPrefix>access_log-</TargetPrefix>
</LoggingEnabled>
</BucketLoggingStatus>
logging_disabled: >
- <BucketLoggingStatus xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
+ <BucketLoggingStatus xmlns="http://oss.aliyun.com/doc/2006-03-01/">
<!--<LoggingEnabled>
<TargetBucket>myLogsBucket</TargetBucket>
<TargetPrefix>add/this/prefix/to/my/log/files/access_log-</TargetPrefix>
</LoggingEnabled>-->
- </BucketLoggingStatus>
+ </BucketLoggingStatus>
View
2 test/test_helper.rb
@@ -44,7 +44,7 @@ def signature
end
def authorization_header
- 'AWS 44CF9590006BF252F707:63mwfl+zYIOG6k95yxbgMruQ6QI='
+ 'OSS 44CF9590006BF252F707:63mwfl+zYIOG6k95yxbgMruQ6QI='
end
end

0 comments on commit 73c0077

Please sign in to comment.
Something went wrong with that request. Please try again.