devise_browserid_authenticatable 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 1.3.1
2
+
3
+ * Added the initializer-generator to the README.
4
+ * Fixed a possible syntax error in some environments...
5
+ * Some code cleanups
6
+
1
7
  # 1.3.0
2
8
 
3
9
  * Fixed a typo in the README.me - thanks @narr
@@ -21,4 +27,4 @@
21
27
 
22
28
  # 1.0.0
23
29
 
24
- * The initial release
30
+ * The initial release
data/README.md CHANGED
@@ -20,6 +20,8 @@ To install the gem, just add a
20
20
 
21
21
  to your Gemfile and run ```bundle install```.
22
22
 
23
+ Create the initializer running ```rails generate browser_id:install```.
24
+
23
25
  To enable the warden strategy, add the following lines to ```config/initializers/devise.rb```:
24
26
 
25
27
  config.warden do |manager|
@@ -1,17 +1,18 @@
1
1
  Gem::Specification.new do |s|
2
- s.name = "devise_browserid_authenticatable"
3
- s.summary = "BrowserID/Persona authentication for Devise 2+"
4
- s.description = "Mozilla BrowserID/Persona authentication module that works with Rails 3.1+ and Devise 2.1+"
2
+ s.name = 'devise_browserid_authenticatable'
3
+ s.summary = 'BrowserID/Persona authentication for Devise 2+'
4
+ s.description = 'Mozilla BrowserID/Persona authentication module that works with Rails 3.1+ and Devise 2.1+'
5
+ s.license = 'MIT'
5
6
 
6
- s.authors = ["Dennis Schubert"]
7
- s.email = "gems@schub.io"
8
- s.homepage = "https://github.com/denschub/devise_browserid_authenticatable"
7
+ s.authors = ['Dennis Schubert']
8
+ s.email = 'gems@schub.io'
9
+ s.homepage = 'https://github.com/denschub/devise_browserid_authenticatable'
9
10
 
10
11
  s.files = `git ls-files`.split("\n")
11
- s.require_paths = ["lib"]
12
+ s.require_paths = %w('lib')
13
+
14
+ s.version = '1.3.1'
12
15
 
13
- s.version = "1.3.0"
14
-
15
16
  s.add_dependency 'devise', '>= 2.1'
16
17
  s.add_development_dependency 'minitest'
17
18
  s.add_development_dependency 'rake'
@@ -1,3 +1,3 @@
1
- require "devise_browserid_authenticatable/config"
2
- require "devise_browserid_authenticatable/strategy"
3
- require "devise_browserid_authenticatable/railtie"
1
+ require 'devise_browserid_authenticatable/config'
2
+ require 'devise_browserid_authenticatable/strategy'
3
+ require 'devise_browserid_authenticatable/railtie'
@@ -1,9 +1,9 @@
1
- require "devise_browserid_authenticatable/view_helpers"
1
+ require 'devise_browserid_authenticatable/view_helpers'
2
2
 
3
3
  module BrowserId
4
4
  class Railtie < Rails::Railtie
5
- initializer "browser_id.view_helpers" do
5
+ initializer 'browser_id.view_helpers' do
6
6
  ActionView::Base.send :include, ViewHelpers
7
7
  end
8
8
  end
9
- end
9
+ end
@@ -10,21 +10,21 @@ class Devise::Strategies::BrowseridAuthenticatable < Devise::Strategies::Authent
10
10
  http = Net::HTTP.new(Devise::Strategies::BrowseridAuthenticatable.browserid_url, 443)
11
11
  http.use_ssl = true
12
12
 
13
- verification_request = Net::HTTP::Post.new("/verify")
14
- verification_request.set_form_data(assertion: params[:assertion], audience: request.host_with_port)
13
+ verification_request = Net::HTTP::Post.new('/verify')
14
+ verification_request.set_form_data({:assertion => params[:assertion], :audience => request.host_with_port})
15
15
 
16
16
  response = http.request(verification_request)
17
17
  @asserted = JSON.parse(response.body)
18
18
 
19
- (@asserted["status"] == "okay") and (@asserted["audience"] == request.host_with_port)
19
+ (@asserted['status'] == 'okay') and (@asserted['audience'] == request.host_with_port)
20
20
  end
21
21
 
22
22
  def authenticate!
23
- u = mapping.to.find_by_email(@asserted["email"])
23
+ u = mapping.to.find_by_email(@asserted['email'])
24
24
 
25
25
  unless u
26
26
  password = Devise.friendly_token
27
- u = mapping.to.new(:email => @asserted["email"], :password => password, :password_confirmation => password)
27
+ u = mapping.to.new(:email => @asserted['email'], :password => password, :password_confirmation => password)
28
28
  u.skip_confirmation! if u.respond_to?(:skip_confirmation!)
29
29
  u.save!
30
30
  end
@@ -2,5 +2,5 @@ Devise.setup do |config|
2
2
  config.warden do |manager|
3
3
  manager.default_strategies(:scope => :user).unshift :browserid_authenticatable
4
4
  end
5
- config.browserid_url = "login.persona.org"
5
+ config.browserid_url = 'login.persona.org'
6
6
  end
@@ -10,6 +10,6 @@ class InstallGeneratorTest < Rails::Generators::TestCase
10
10
  test 'create initializer' do
11
11
  run_generator
12
12
 
13
- assert_file "config/initializers/browser_id.rb"
13
+ assert_file 'config/initializers/browser_id.rb'
14
14
  end
15
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_browserid_authenticatable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-15 00:00:00.000000000 Z
12
+ date: 2013-07-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: devise
@@ -82,11 +82,12 @@ files:
82
82
  - test/generators/install_generator_test.rb
83
83
  - test/test_helper.rb
84
84
  homepage: https://github.com/denschub/devise_browserid_authenticatable
85
- licenses: []
85
+ licenses:
86
+ - MIT
86
87
  post_install_message:
87
88
  rdoc_options: []
88
89
  require_paths:
89
- - lib
90
+ - ! '''lib'''
90
91
  required_ruby_version: !ruby/object:Gem::Requirement
91
92
  none: false
92
93
  requirements: