pelle-oauth 0.2.7 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. data/History.txt +14 -0
  2. data/Manifest.txt +19 -3
  3. data/README.rdoc +73 -0
  4. data/Rakefile +34 -4
  5. data/TODO +14 -0
  6. data/bin/oauth +5 -0
  7. data/lib/oauth.rb +3 -3
  8. data/lib/oauth/cli.rb +130 -0
  9. data/lib/oauth/client/helper.rb +3 -2
  10. data/lib/oauth/consumer.rb +1 -1
  11. data/lib/oauth/helper.rb +3 -0
  12. data/lib/oauth/oauth_test_helper.rb +26 -0
  13. data/lib/oauth/request_proxy/action_controller_request.rb +2 -4
  14. data/lib/oauth/request_proxy/base.rb +31 -0
  15. data/lib/oauth/request_proxy/jabber_request.rb +42 -0
  16. data/lib/oauth/request_proxy/mock_request.rb +36 -0
  17. data/lib/oauth/request_proxy/net_http.rb +0 -2
  18. data/lib/oauth/request_proxy/rack_request.rb +1 -3
  19. data/lib/oauth/signature/base.rb +20 -7
  20. data/lib/oauth/signature/plaintext.rb +1 -1
  21. data/lib/oauth/token.rb +3 -3
  22. data/lib/oauth/version.rb +2 -8
  23. data/oauth.gemspec +43 -0
  24. data/script/txt2html +1 -1
  25. data/test/cases/oauth_case.rb +19 -0
  26. data/test/cases/spec/1_0-final/test_construct_request_url.rb +62 -0
  27. data/test/cases/spec/1_0-final/test_normalize_request_parameters.rb +88 -0
  28. data/test/cases/spec/1_0-final/test_parameter_encodings.rb +86 -0
  29. data/test/cases/spec/1_0-final/test_signature_base_strings.rb +77 -0
  30. data/test/keys/rsa.cert +11 -0
  31. data/test/keys/rsa.pem +16 -0
  32. data/test/test_action_controller_request_proxy.rb +2 -1
  33. data/test/test_consumer.rb +17 -18
  34. data/test/test_helper.rb +8 -0
  35. data/test/test_net_http_client.rb +7 -7
  36. data/test/test_net_http_request_proxy.rb +3 -3
  37. data/test/test_rack_request_proxy.rb +3 -3
  38. data/test/test_rsa_sha1.rb +59 -0
  39. data/test/test_signature_plain_text.rb +31 -0
  40. data/website/index.html +1 -1
  41. metadata +53 -14
  42. data/config/hoe.rb +0 -71
  43. data/config/requirements.rb +0 -17
@@ -0,0 +1,31 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+ require 'oauth/signature/plaintext'
3
+
4
+ class TestSignaturePlaintext < Test::Unit::TestCase
5
+ def test_that_plaintext_implements_plaintext
6
+ assert OAuth::Signature.available_methods.include?('plaintext')
7
+ end
8
+
9
+ def test_that_get_request_from_oauth_test_cases_produces_matching_signature
10
+ request = Net::HTTP::Get.new('/photos?file=vacation.jpg&size=original&oauth_version=1.0&oauth_consumer_key=dpf43f3p2l4k3l03&oauth_token=nnch734d00sl2jdk&oauth_signature=kd94hf93k423kf44%26&oauth_timestamp=1191242096&oauth_nonce=kllo9940pd9333jh&oauth_signature_method=PLAINTEXT')
11
+
12
+ consumer = OAuth::Consumer.new('dpf43f3p2l4k3l03','kd94hf93k423kf44')
13
+ token = OAuth::Token.new('nnch734d00sl2jdk', nil)
14
+
15
+ assert OAuth::Signature.verify(request, { :consumer => consumer,
16
+ :token => token,
17
+ :uri => 'http://photos.example.net/photos' } )
18
+ end
19
+
20
+ def test_that_get_request_from_oauth_test_cases_produces_matching_signature_part_two
21
+ request = Net::HTTP::Get.new('/photos?file=vacation.jpg&size=original&oauth_version=1.0&oauth_consumer_key=dpf43f3p2l4k3l03&oauth_token=nnch734d00sl2jdk&oauth_signature=kd94hf93k423kf44%26pfkkdhi9sl3r4s00&oauth_timestamp=1191242096&oauth_nonce=kllo9940pd9333jh&oauth_signature_method=PLAINTEXT')
22
+
23
+ consumer = OAuth::Consumer.new('dpf43f3p2l4k3l03','kd94hf93k423kf44')
24
+ token = OAuth::Token.new('nnch734d00sl2jdk', 'pfkkdhi9sl3r4s00')
25
+
26
+ assert OAuth::Signature.verify(request, { :consumer => consumer,
27
+ :token => token,
28
+ :uri => 'http://photos.example.net/photos' } )
29
+ end
30
+
31
+ end
data/website/index.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>Ruby OAuth GEM</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/oauth"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/oauth" class="numbers">0.2.6</a>
36
+ <a href="http://rubyforge.org/projects/oauth" class="numbers">0.2.7</a>
37
37
  </div>
38
38
  <h2>What</h2>
39
39
  <p>This is a RubyGem for implementing both OAuth clients and servers in Ruby applications.</p>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pelle-oauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pelle Braendgaard
@@ -9,13 +9,13 @@ authors:
9
9
  - Larry Halff
10
10
  - Jesse Clark
11
11
  - Jon Crosby
12
- - SethFitzsimmons
12
+ - Seth Fitzsimmons
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2008-04-27 00:00:00 -07:00
18
- default_executable:
17
+ date: 2009-01-25 00:00:00 -08:00
18
+ default_executable: oauth
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: ruby-hmac
@@ -26,37 +26,59 @@ dependencies:
26
26
  - !ruby/object:Gem::Version
27
27
  version: 0.3.1
28
28
  version:
29
+ - !ruby/object:Gem::Dependency
30
+ name: newgem
31
+ version_requirement:
32
+ version_requirements: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 1.2.3
37
+ version:
38
+ - !ruby/object:Gem::Dependency
39
+ name: hoe
40
+ version_requirement:
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 1.8.0
46
+ version:
29
47
  description: OAuth Core Ruby implementation
30
- email:
31
- - pelleb@gmail.com
32
- executables: []
33
-
48
+ email: pelleb@gmail.com
49
+ executables:
50
+ - oauth
34
51
  extensions: []
35
52
 
36
53
  extra_rdoc_files:
37
54
  - History.txt
38
55
  - License.txt
39
56
  - Manifest.txt
40
- - README.txt
57
+ - README.rdoc
58
+ - specs.txt
41
59
  - website/index.txt
42
60
  files:
43
61
  - History.txt
44
62
  - License.txt
45
63
  - Manifest.txt
46
- - README.txt
64
+ - README.rdoc
47
65
  - Rakefile
48
- - config/hoe.rb
49
- - config/requirements.rb
66
+ - TODO
67
+ - bin/oauth
50
68
  - lib/oauth.rb
69
+ - lib/oauth/cli.rb
51
70
  - lib/oauth/client.rb
52
71
  - lib/oauth/client/action_controller_request.rb
53
72
  - lib/oauth/client/helper.rb
54
73
  - lib/oauth/client/net_http.rb
55
74
  - lib/oauth/consumer.rb
56
75
  - lib/oauth/helper.rb
76
+ - lib/oauth/oauth_test_helper.rb
57
77
  - lib/oauth/request_proxy.rb
58
78
  - lib/oauth/request_proxy/action_controller_request.rb
59
79
  - lib/oauth/request_proxy/base.rb
80
+ - lib/oauth/request_proxy/jabber_request.rb
81
+ - lib/oauth/request_proxy/mock_request.rb
60
82
  - lib/oauth/request_proxy/net_http.rb
61
83
  - lib/oauth/request_proxy/rack_request.rb
62
84
  - lib/oauth/server.rb
@@ -73,13 +95,22 @@ files:
73
95
  - lib/oauth/signature/sha1.rb
74
96
  - lib/oauth/token.rb
75
97
  - lib/oauth/version.rb
98
+ - oauth.gemspec
76
99
  - script/destroy
77
100
  - script/generate
78
101
  - script/txt2html
79
102
  - setup.rb
103
+ - specs.txt
80
104
  - tasks/deployment.rake
81
105
  - tasks/environment.rake
82
106
  - tasks/website.rake
107
+ - test/cases/oauth_case.rb
108
+ - test/cases/spec/1_0-final/test_construct_request_url.rb
109
+ - test/cases/spec/1_0-final/test_normalize_request_parameters.rb
110
+ - test/cases/spec/1_0-final/test_parameter_encodings.rb
111
+ - test/cases/spec/1_0-final/test_signature_base_strings.rb
112
+ - test/keys/rsa.cert
113
+ - test/keys/rsa.pem
83
114
  - test/test_action_controller_request_proxy.rb
84
115
  - test/test_consumer.rb
85
116
  - test/test_helper.rb
@@ -87,21 +118,23 @@ files:
87
118
  - test/test_net_http_client.rb
88
119
  - test/test_net_http_request_proxy.rb
89
120
  - test/test_rack_request_proxy.rb
121
+ - test/test_rsa_sha1.rb
122
+ - test/test_server.rb
90
123
  - test/test_signature.rb
91
124
  - test/test_signature_base.rb
125
+ - test/test_signature_plain_text.rb
92
126
  - test/test_token.rb
93
127
  - website/index.html
94
128
  - website/index.txt
95
129
  - website/javascripts/rounded_corners_lite.inc.js
96
130
  - website/stylesheets/screen.css
97
131
  - website/template.rhtml
98
- - test/test_server.rb
99
132
  has_rdoc: true
100
133
  homepage: http://oauth.rubyforge.org
101
134
  post_install_message:
102
135
  rdoc_options:
103
136
  - --main
104
- - README.txt
137
+ - README.rdoc
105
138
  require_paths:
106
139
  - lib
107
140
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -124,6 +157,10 @@ signing_key:
124
157
  specification_version: 2
125
158
  summary: OAuth Core Ruby implementation
126
159
  test_files:
160
+ - test/cases/spec/1_0-final/test_construct_request_url.rb
161
+ - test/cases/spec/1_0-final/test_normalize_request_parameters.rb
162
+ - test/cases/spec/1_0-final/test_parameter_encodings.rb
163
+ - test/cases/spec/1_0-final/test_signature_base_strings.rb
127
164
  - test/test_action_controller_request_proxy.rb
128
165
  - test/test_consumer.rb
129
166
  - test/test_helper.rb
@@ -131,7 +168,9 @@ test_files:
131
168
  - test/test_net_http_client.rb
132
169
  - test/test_net_http_request_proxy.rb
133
170
  - test/test_rack_request_proxy.rb
171
+ - test/test_rsa_sha1.rb
134
172
  - test/test_server.rb
135
173
  - test/test_signature.rb
136
174
  - test/test_signature_base.rb
175
+ - test/test_signature_plain_text.rb
137
176
  - test/test_token.rb
data/config/hoe.rb DELETED
@@ -1,71 +0,0 @@
1
- require 'oauth/version'
2
-
3
- AUTHOR = ['Pelle Braendgaard','Blaine Cook','Larry Halff','Jesse Clark','Jon Crosby', 'Seth Fitzsimmons'] # can also be an array of Authors
4
- EMAIL = "pelleb@gmail.com"
5
- DESCRIPTION = "OAuth Core Ruby implementation"
6
- GEM_NAME = 'oauth' # what ppl will type to install your gem
7
- RUBYFORGE_PROJECT = 'oauth' # The unix name for your project
8
- HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
9
- DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
10
-
11
- @config_file = "~/.rubyforge/user-config.yml"
12
- @config = nil
13
- RUBYFORGE_USERNAME = "unknown"
14
- def rubyforge_username
15
- unless @config
16
- begin
17
- @config = YAML.load(File.read(File.expand_path(@config_file)))
18
- rescue
19
- puts <<-EOS
20
- ERROR: No rubyforge config file found: #{@config_file}
21
- Run 'rubyforge setup' to prepare your env for access to Rubyforge
22
- - See http://newgem.rubyforge.org/rubyforge.html for more details
23
- EOS
24
- exit
25
- end
26
- end
27
- RUBYFORGE_USERNAME.replace @config["username"]
28
- end
29
-
30
-
31
- REV = nil
32
- # UNCOMMENT IF REQUIRED:
33
- # REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
34
- VERS = Oauth::VERSION::STRING + (REV ? ".#{REV}" : "")
35
- RDOC_OPTS = ['--quiet', '--title', 'oauth documentation',
36
- "--opname", "index.html",
37
- "--line-numbers",
38
- "--main", "README",
39
- "--inline-source"]
40
-
41
- class Hoe
42
- def extra_deps
43
- @extra_deps.reject! { |x| Array(x).first == 'hoe' }
44
- @extra_deps
45
- end
46
- end
47
-
48
- # Generate all the Rake tasks
49
- # Run 'rake -T' to see list of generated tasks (from gem root directory)
50
- hoe = Hoe.new(GEM_NAME, VERS) do |p|
51
- p.author = AUTHOR
52
- p.description = DESCRIPTION
53
- p.email = EMAIL
54
- p.summary = DESCRIPTION
55
- p.url = HOMEPATH
56
- p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
57
- p.test_globs = ["test/**/test_*.rb"]
58
- p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
59
-
60
- # == Optional
61
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
62
- p.extra_deps = [['ruby-hmac','>= 0.3.1'] ] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
63
-
64
- #p.spec_extras = {} # A hash of extra values to set in the gemspec.
65
-
66
- end
67
-
68
- CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
69
- PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
70
- hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
71
- hoe.rsync_args = '-av --delete --ignore-errors'
@@ -1,17 +0,0 @@
1
- require 'fileutils'
2
- include FileUtils
3
-
4
- require 'rubygems'
5
- %w[rake hoe newgem rubigen].each do |req_gem|
6
- begin
7
- require req_gem
8
- rescue LoadError
9
- puts "This Rakefile requires the '#{req_gem}' RubyGem."
10
- puts "Installation: gem install #{req_gem} -y"
11
- exit
12
- end
13
- end
14
-
15
- $:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
16
-
17
- require 'oauth'