simple_oauth 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +4 -4
- data/LICENSE +1 -1
- data/README.md +4 -4
- data/Rakefile +0 -2
- data/lib/simple_oauth/header.rb +1 -1
- data/simple_oauth.gemspec +1 -1
- data/spec/simple_oauth/header_spec.rb +18 -0
- data/spec/spec_helper.rb +3 -1
- metadata +3 -4
data/.travis.yml
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Simply builds and verifies OAuth headers
|
4
4
|
|
5
|
-
##
|
5
|
+
## Contributing
|
6
6
|
1. Fork the project.
|
7
7
|
2. Create a topic branch.
|
8
8
|
3. Add failing tests.
|
@@ -11,7 +11,7 @@ Simply builds and verifies OAuth headers
|
|
11
11
|
6. Commit and push your changes.
|
12
12
|
7. Submit a pull request. Please do not include changes to the gemspec.
|
13
13
|
|
14
|
-
##
|
14
|
+
## Supported Rubies
|
15
15
|
This library aims to support and is [tested
|
16
16
|
against](http://travis-ci.org/laserlemon/simple_oauth) the following Ruby
|
17
17
|
implementations:
|
@@ -19,7 +19,7 @@ implementations:
|
|
19
19
|
* Ruby 1.8.7
|
20
20
|
* Ruby 1.9.2
|
21
21
|
* Ruby 1.9.3
|
22
|
-
|
22
|
+
* Ruby head
|
23
23
|
* [JRuby](http://www.jruby.org/)
|
24
24
|
* [Rubinius](http://rubini.us/)
|
25
25
|
|
@@ -37,6 +37,6 @@ implementation, you will be personally responsible for providing patches in a
|
|
37
37
|
timely fashion. If critical issues for a particular implementation exist at the
|
38
38
|
time of a major release, support for that Ruby version may be dropped.
|
39
39
|
|
40
|
-
##
|
40
|
+
## Copyright
|
41
41
|
Copyright (c) 2010 Steve Richert, Erik Michaels-Ober.
|
42
42
|
See [LICENSE](https://github.com/laserlemon/simple_oauth/blob/master/LICENSE) for details.
|
data/Rakefile
CHANGED
data/lib/simple_oauth/header.rb
CHANGED
@@ -25,7 +25,7 @@ module SimpleOAuth
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def self.parse(header)
|
28
|
-
header.to_s.sub(/^OAuth\s/, '').split(
|
28
|
+
header.to_s.sub(/^OAuth\s/, '').split(/,\s*/).inject({}) do |attributes, pair|
|
29
29
|
match = pair.match(/^(\w+)\=\"([^\"]*)\"$/)
|
30
30
|
attributes.merge(match[1].sub(/^oauth_/, '').to_sym => decode(match[2]))
|
31
31
|
end
|
data/simple_oauth.gemspec
CHANGED
@@ -86,6 +86,24 @@ describe SimpleOAuth::Header do
|
|
86
86
|
parsed_options.should have_key(:signature)
|
87
87
|
parsed_options[:signature].should_not be_nil
|
88
88
|
end
|
89
|
+
|
90
|
+
it 'should handle optional "linear white space"' do
|
91
|
+
parsed_header_with_spaces = SimpleOAuth::Header.parse 'OAuth oauth_consumer_key="abcd", oauth_nonce="oLKtec51GQy", oauth_signature="efgh%26mnop", oauth_signature_method="PLAINTEXT", oauth_timestamp="1286977095", oauth_token="ijkl", oauth_version="1.0"'
|
92
|
+
parsed_header_with_spaces.should be_a_kind_of(Hash)
|
93
|
+
parsed_header_with_spaces.keys.size.should eq 7
|
94
|
+
|
95
|
+
parsed_header_with_tabs = SimpleOAuth::Header.parse 'OAuth oauth_consumer_key="abcd", oauth_nonce="oLKtec51GQy", oauth_signature="efgh%26mnop", oauth_signature_method="PLAINTEXT", oauth_timestamp="1286977095", oauth_token="ijkl", oauth_version="1.0"'
|
96
|
+
parsed_header_with_tabs.should be_a_kind_of(Hash)
|
97
|
+
parsed_header_with_tabs.keys.size.should eq 7
|
98
|
+
|
99
|
+
parsed_header_with_spaces_and_tabs = SimpleOAuth::Header.parse 'OAuth oauth_consumer_key="abcd", oauth_nonce="oLKtec51GQy", oauth_signature="efgh%26mnop", oauth_signature_method="PLAINTEXT", oauth_timestamp="1286977095", oauth_token="ijkl", oauth_version="1.0"'
|
100
|
+
parsed_header_with_spaces_and_tabs.should be_a_kind_of(Hash)
|
101
|
+
parsed_header_with_spaces_and_tabs.keys.size.should eq 7
|
102
|
+
|
103
|
+
parsed_header_without_spaces = SimpleOAuth::Header.parse 'OAuth oauth_consumer_key="abcd",oauth_nonce="oLKtec51GQy",oauth_signature="efgh%26mnop",oauth_signature_method="PLAINTEXT",oauth_timestamp="1286977095",oauth_token="ijkl",oauth_version="1.0"'
|
104
|
+
parsed_header_without_spaces.should be_a_kind_of(Hash)
|
105
|
+
parsed_header_without_spaces.keys.size.should eq 7
|
106
|
+
end
|
89
107
|
end
|
90
108
|
|
91
109
|
describe '#initialize' do
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_oauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-05-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -103,9 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
requirements: []
|
105
105
|
rubyforge_project:
|
106
|
-
rubygems_version: 1.8.
|
106
|
+
rubygems_version: 1.8.24
|
107
107
|
signing_key:
|
108
108
|
specification_version: 3
|
109
109
|
summary: Simply builds and verifies OAuth headers
|
110
110
|
test_files: []
|
111
|
-
has_rdoc:
|