oauth_provider_engine 0.0.4 → 0.0.5

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.
@@ -21,6 +21,15 @@ module OauthProviderEngine
21
21
  params.to_query
22
22
  end
23
23
 
24
+ def extend_access
25
+ generate_expiry
26
+ end
27
+
28
+ def extend_access!
29
+ extend_access
30
+ self.save
31
+ end
32
+
24
33
  protected
25
34
 
26
35
  def generate_keys
@@ -7,25 +7,23 @@ module OauthProviderEngine
7
7
  # see if the user is logged in. if the user is not logged in, redirect them to
8
8
  # your login page. upon successful login, they should be redirected back to the
9
9
  # authenticate action with the same oauth_token param
10
- class_attribute :authenticate_method
11
- self.authenticate_method = Proc.new{|c| raise "need to override the authenticate method"}
10
+ attr_accessor :authenticate_method
12
11
 
13
12
  # this method is used to protect the applications controller. if you do not protect the controller,
14
13
  # anyone can create their own applications (which is a valid scenario).
15
- class_attribute :admin_authenticate_method
16
- self.admin_authenticate_method = Proc.new{|c| raise "need to override the admin authenticate method"}
14
+ attr_accessor :admin_authenticate_method
17
15
 
18
16
  # this proc should be used to fetch the uniq user id from the controller
19
- class_attribute :user_method
20
- self.user_method = Proc.new{|c| raise "need to override the method of retrieving the user id"}
17
+ attr_accessor :user_method
21
18
 
22
19
  # these settings allow you to specify what layout to use for the applications resource and the
23
20
  # oauth authorize page
24
- class_attribute :admin_layout
25
- class_attribute :oauth_layout
21
+ attr_accessor :admin_layout
22
+ attr_accessor :oauth_layout
26
23
 
27
24
  # this setting lets you specify the expiry on an access_token
28
- class_attribute :access_token_expiry
25
+ # defaults to no expiration
26
+ attr_accessor :access_token_expiry
29
27
 
30
28
  def generate_key(length = 32)
31
29
  Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{rand(1000)}--")[0,length-1]
@@ -39,6 +37,11 @@ module OauthProviderEngine
39
37
  yield self if block_given?
40
38
  end
41
39
  end
40
+
41
+ # configuration defaults
42
+ self.authenticate_method = Proc.new{|c| raise "need to override the authenticate method"}
43
+ self.admin_authenticate_method = Proc.new{|c| raise "need to override the admin authenticate method"}
44
+ self.user_method = Proc.new{|c| raise "need to override the method of retrieving the user id"}
42
45
  end
43
46
 
44
47
  require 'oauth_provider_engine/version'
@@ -1,3 +1,3 @@
1
1
  module OauthProviderEngine
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -4,6 +4,7 @@ require File.expand_path('../lib/oauth_provider_engine/version', __FILE__)
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "oauth_provider_engine"
6
6
  s.version = OauthProviderEngine::VERSION
7
+ s.description = 'A Rails Engine that allow the site to act as an OAuth provider'
7
8
  s.summary = 'A Rails Engine that allow the site to act as an OAuth provider'
8
9
  s.add_dependency "rails", ">= 3.0.0"
9
10
  s.add_dependency "oauth", "~> 0.4.0"
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: oauth_provider_engine
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.4
5
+ version: 0.0.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jeff Ching
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-05-16 00:00:00 Z
13
+ date: 2012-05-17 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -34,7 +34,7 @@ dependencies:
34
34
  version: 0.4.0
35
35
  type: :runtime
36
36
  version_requirements: *id002
37
- description:
37
+ description: A Rails Engine that allow the site to act as an OAuth provider
38
38
  email: jeff@chingr.com
39
39
  executables: []
40
40