muck-auth 3.5.0 → 3.5.1

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.5.0
1
+ 3.5.1
@@ -23,6 +23,7 @@ module MuckAuth
23
23
 
24
24
  initializer "muck_auth.add_middleware" do |app|
25
25
  raise MuckAuth::Exceptions::InvalidConfiguration, "Please provide a valid configuration for Muck Auth." if Secrets.auth_credentials.blank?
26
+
26
27
  Secrets.auth_credentials.each_key do |provider|
27
28
  Rails.application.config.middleware.use OmniAuth::Builder do
28
29
  provider(provider, Secrets.auth_credentials[provider]['key'], Secrets.auth_credentials[provider]['secret'], :scope => Secrets.auth_credentials[provider]['scope'])
@@ -8,6 +8,19 @@ module MuckAuth
8
8
  belongs_to :authenticatable, :polymorphic => true
9
9
  end
10
10
 
11
+ def access_token
12
+ access_token = OAuth::AccessToken.new(consumer, self.token, self.secret)
13
+ end
14
+
15
+ def consumer
16
+ strategy.consumer
17
+ end
18
+
19
+ def strategy
20
+ strategy_class = OmniAuth::Strategies.const_get("#{OmniAuth::Utils.camelize(self.provider)}")
21
+ strategy_class.new(nil, Secrets.auth_credentials[provider]['key'], Secrets.auth_credentials[provider]['secret'], :scope => Secrets.auth_credentials[provider]['scope'])
22
+ end
23
+
11
24
  module ClassMethods
12
25
 
13
26
  def all_services
data/muck-auth.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{muck-auth}
8
- s.version = "3.5.0"
8
+ s.version = "3.5.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin Ball"]
12
- s.date = %q{2011-03-19}
12
+ s.date = %q{2011-04-23}
13
13
  s.description = %q{A simple wrapper for the omniauth gem so that it is faster to include oauth in muck based applications.}
14
14
  s.email = %q{justin@tatemae.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muck-auth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 5
9
- - 0
10
- version: 3.5.0
9
+ - 1
10
+ version: 3.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Justin Ball
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-19 00:00:00 -06:00
18
+ date: 2011-04-23 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency