mojodna-fireeagle 0.8.0.1 → 0.8.99

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ == 0.9.0
2
+
3
+ * Switch to happymapper for XML parsing
4
+ * Support for OAuth 1.0a
5
+
1
6
  == 0.8.0.0
2
7
 
3
8
  * Update recent method
@@ -52,15 +52,3 @@ class Hash
52
52
  false_count == 0 or false_count == size
53
53
  end
54
54
  end
55
-
56
- # FireEagle addition to the <code>OAuth::Consumer</code> class
57
- class OAuth::Consumer
58
- alias_method :create_http_with_verify, :create_http
59
- # Monkey patch to silence the SSL warnings
60
- def create_http_without_verify #:nodoc:
61
- http_object = create_http_with_verify
62
- http_object.verify_mode = OpenSSL::SSL::VERIFY_NONE if uri.scheme=="https"
63
- http_object
64
- end
65
- alias_method :create_http, :create_http_without_verify
66
- end
@@ -1,7 +1,7 @@
1
1
  module FireEagle
2
2
  class Client
3
3
  # TODO add access_token=() and request_token=() methods that check whether the tokens are usable
4
-
4
+
5
5
  attr_reader :access_token, :request_token, :consumer, :format
6
6
 
7
7
  # Initialize a FireEagle Client. Takes an options Hash.
@@ -20,35 +20,71 @@ module FireEagle
20
20
  # [<tt>:app_id</tt>] Your Mobile Application ID
21
21
  # [<tt>:debug</tt>] Boolean
22
22
  #
23
- # User-specific OAuth tokens tie FireEagle users to your application. As such, they are intended to be
24
- # distributed (with keys) to that user's mobile device and/or computer running your desktop or mobile client.
25
- # For web-based applications User-specific tokens will be retrieved by your web server where they should be
26
- # treated as private data. Take care to avoid releasing this data to the public, as the corresponding User's location
27
- # information may be inadvertently exposed. User-specific OAuth tokens should be considered the property of
28
- # your users.
23
+ # User-specific OAuth tokens tie Fire Eagle users to your application. As
24
+ # such, they are intended to be distributed (with keys) to that user's
25
+ # mobile device and/or computer running your desktop or mobile client. For
26
+ # web-based applications User-specific tokens will be retrieved by your
27
+ # web server where they should be treated as private data. Take care to
28
+ # avoid releasing this data to the public, as the corresponding User's
29
+ # location information may be inadvertently exposed. User-specific OAuth
30
+ # tokens should be considered the property of your users.
31
+ #
32
+ # General-purpose OAuth tokens are tied to your application and allow you,
33
+ # as a developer, to make more general (often batch-style) queries against
34
+ # Fire Eagle. As a result, allowing this token/secret combination loose
35
+ # has the potential to reveal a much greater amount of personal data. In
36
+ # an attempt to mitigate this, we will only grant general-purpose tokens
37
+ # to web applications (contact us with details, if you seek an exception).
38
+ # In addition, we require developers to provide a restrictive IP range at
39
+ # registration time in order to further mitigate the risk of
40
+ # general-purpose tokens being used inappropriately.
41
+ #
42
+ # In general, OAuth tokens should be considered sacrosanct in order to
43
+ # help us respect our users' privacy. Please take this responsibility on
44
+ # as your own. If your Application Oauth tokens are compromised, Fire
45
+ # Eagle will turn off your application service until the problem is
46
+ # resolved.
47
+ #
48
+ # If the Client is initialized without an OAuth access token, it's assumed
49
+ # you're operating a non-web based application.
50
+ #
51
+ # == Example web-based authentication flow:
52
+ #
53
+ # Initialize a client with your consumer key and consumer secret.
54
+ #
55
+ # >> c = FireEagle::Client.new(:consumer_key => "key", :consumer_secret => "sekret")
56
+ # => #<FireEagle::Client:0x1ce2e70 ... >
57
+ #
58
+ # Generate a request token with a +callback_url+:
29
59
  #
30
- # General-purpose OAuth tokens are tied to your application and allow you, as a developer, to make more
31
- # general (often batch-style) queries against FireEagle. As a result, allowing this token/secret combination
32
- # loose has the potential to reveal a much greater amount of personal data. In an attempt to mitigate this, we will
33
- # only grant general-purpose tokens to web applications (contact us with details, if you seek an exception). In
34
- # addition, we require developers to provide a restrictive IP range at registration time in order to further mitigate
35
- # the risk of general-purpose tokens being used inappropriately.
60
+ # >> c.get_request_token("http://example.com/cb")
61
+ # => #<OAuth::Token:0x1cdb5bc @token="request_token", @secret="sekret">
36
62
  #
37
- # In general, OAuth tokens should be considered sacrosanct in order to help us respect our users' privacy. Please
38
- # take this responsibility on as your own. If your Application Oauth tokens are compromised, FireEagle will
39
- # turn off your application service until the problem is resolved.
63
+ # Prompt your user to visit your app's authorization url:
40
64
  #
41
- # If the Client is initialized without an OAuth access token, it's assumed you're operating a non-web based application.
65
+ # >> c.authorization_url
66
+ # => "http://fireeagle.yahoo.net/oauth/authorize?oauth_token=request_token"
67
+ #
68
+ # When the user has completed this step, s/he will be redirected back to
69
+ # the callback url you configured when obtaining a request token.
70
+ # +oauth_verifier+ will be present in the callback.
71
+ #
72
+ # >> c.convert_to_access_token(oauth_verifier)
73
+ # => #<OAuth::Token:0x1cd3bf0 @token="access_token", @secret="access_token_secret">
42
74
  #
43
75
  # == Non web-based applications
44
76
  #
45
- # For non web-based applications, such as a mobile client application, the authentication between the user and
46
- # the application is slightly different. The request token is displayed to the user by the client application. The
47
- # user then logs into the FireEagle website (using mobile_authorization_url) and enters this code to authorize the application.
48
- # When the user finishes the authorization step the client application exchanges the request token for an access token
49
- # (using convert_to_access_token). This is a lightweight method for non-web application users to authenticate an application
50
- # without entering any identifying information into a potentially insecure application. Request tokens are valid for only
51
- # 1 hour after being issued.
77
+ # For non web-based applications, such as a mobile client application, the
78
+ # authentication between the user and the application is slightly
79
+ # different. The request token is displayed to the user by the client
80
+ # application. The user then logs into the FireEagle website (using
81
+ # mobile_authorization_url) and enters this code to authorize the
82
+ # application. When the user finishes the authorization step the client
83
+ # application exchanges the request token for an access token (using
84
+ # +convert_to_access_token+). This is a lightweight method for non-web
85
+ # application users to authenticate an application without entering any
86
+ # identifying information into a potentially insecure application. Request
87
+ # tokens are valid for only 1 hour after being issued.
52
88
  #
53
89
  # == Example mobile-based authentication flow:
54
90
  #
@@ -67,9 +103,10 @@ module FireEagle
67
103
  # >> c.mobile_authorization_url
68
104
  # => "http://fireeagle.yahoo.net/oauth/mobile_auth/12345"
69
105
  #
70
- # Once the user has indicated to you that they've done this, convert their request token to an access token:
106
+ # Once the user has indicated to you that they've done this (and provided
107
+ # a verification code), convert their request token to an access token:
71
108
  #
72
- # >> c.convert_to_access_token
109
+ # >> c.convert_to_access_token(oauth_verifier)
73
110
  # => #<OAuth::Token:0x1cd3bf0 @token="access_token", @secret="access_token_secret">
74
111
  #
75
112
  # You're done!
@@ -100,10 +137,10 @@ module FireEagle
100
137
  end
101
138
  end
102
139
 
103
- # Obtain an <strong>new</strong> unauthorized OAuth Request token
104
- def get_request_token(force_token_regeneration = false)
140
+ # Obtain a <strong>new</strong> unauthorized OAuth Request token
141
+ def get_request_token(callback_url = "", force_token_regeneration = false)
105
142
  if force_token_regeneration || @request_token.nil?
106
- @request_token = consumer.get_request_token
143
+ @request_token = consumer.get_request_token(:oauth_callback => callback_url)
107
144
  end
108
145
  @request_token
109
146
  end
@@ -120,10 +157,10 @@ module FireEagle
120
157
  request_token.authorize_url
121
158
  end
122
159
 
123
- #Exchange an authorized OAuth Request token for an access token. For use by desktop-based and mobile applications.
124
- def convert_to_access_token
125
- raise FireEagle::ArgumentError, "call #get_request_token and have user authorize the token first" if @request_token.nil?
126
- @access_token = request_token.get_access_token
160
+ # Exchange an authorized OAuth Request token for an access token. For use by desktop-based and mobile applications.
161
+ def convert_to_access_token(oauth_verifier)
162
+ raise FireEagle::ArgumentError, "call #get_request_token and have the user authorize the token first" if @request_token.nil?
163
+ @access_token = request_token.get_access_token(:oauth_verifier => oauth_verifier)
127
164
  end
128
165
 
129
166
  # Disambiguates potential values for update query. Results from lookup can be passed to
@@ -2,9 +2,8 @@ module FireEagle #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 8
5
- TINY = 0
6
- TEENY = 1
5
+ TINY = 99
7
6
 
8
- STRING = [MAJOR, MINOR, TINY, TEENY].join('.')
7
+ STRING = [MAJOR, MINOR, TINY].join('.')
9
8
  end
10
9
  end
metadata CHANGED
@@ -1,28 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mojodna-fireeagle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.1
4
+ version: 0.8.99
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Newland
8
+ - Seth Fitzsimmons
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
12
 
12
- date: 2009-02-03 00:00:00 -08:00
13
+ date: 2009-05-26 00:00:00 -07:00
13
14
  default_executable:
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
- name: oauth
17
+ name: mojodna-oauth
18
+ type: :runtime
17
19
  version_requirement:
18
20
  version_requirements: !ruby/object:Gem::Requirement
19
21
  requirements:
20
22
  - - ">="
21
23
  - !ruby/object:Gem::Version
22
- version: 0.3.1
24
+ version: 0.3.4.1
23
25
  version:
24
26
  - !ruby/object:Gem::Dependency
25
27
  name: happymapper
28
+ type: :runtime
26
29
  version_requirement:
27
30
  version_requirements: !ruby/object:Gem::Requirement
28
31
  requirements:
@@ -32,6 +35,7 @@ dependencies:
32
35
  version:
33
36
  - !ruby/object:Gem::Dependency
34
37
  name: GeoRuby
38
+ type: :runtime
35
39
  version_requirement:
36
40
  version_requirements: !ruby/object:Gem::Requirement
37
41
  requirements:
@@ -41,6 +45,7 @@ dependencies:
41
45
  version:
42
46
  - !ruby/object:Gem::Dependency
43
47
  name: hoe
48
+ type: :development
44
49
  version_requirement:
45
50
  version_requirements: !ruby/object:Gem::Requirement
46
51
  requirements:
@@ -48,9 +53,10 @@ dependencies:
48
53
  - !ruby/object:Gem::Version
49
54
  version: 1.8.0
50
55
  version:
51
- description: Ruby wrapper for Yahoo!'s FireEagle
56
+ description: Ruby wrapper for Yahoo!'s Fire Eagle
52
57
  email:
53
58
  - jnewland@gmail.com
59
+ - seth@mojodna.net
54
60
  executables: []
55
61
 
56
62
  extensions: []
@@ -121,6 +127,6 @@ rubyforge_project: fireeagle
121
127
  rubygems_version: 1.2.0
122
128
  signing_key:
123
129
  specification_version: 2
124
- summary: Ruby wrapper for Yahoo!'s FireEagle
130
+ summary: Ruby wrapper for Yahoo!'s Fire Eagle
125
131
  test_files: []
126
132