omniauth-alephx 0.1.3 → 0.1.31

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDBlNTUwODgyOTlkYWI1MzVjNTQwMzQ4NjgzNmNlNTdkMWQ2NDY3Mg==
4
+ ODYwZTc0Mzk4YTQwYThlMmU1MjM3ZjU1ODlhMTQxYjViMjA3OGQ0ZQ==
5
5
  data.tar.gz: !binary |-
6
- NmUxOTg0YzVjM2JiMzlhZmYwY2YxMmEyYzk5ZDkzYzZjZTliYjRjMg==
6
+ NzMzMTA0YTYxMjQ4ZjZmNWI3M2M1N2UxZDRmNDEzYjIyZjhkYWFmMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YWVkMjUzZGEyODIyZjc0ZWU0YTU5MWEyODQxZDU3MGVhMTQ2YWJkY2RhZWZm
10
- OTg3YmM4MmJhNWY4ODA3NDg4YTY3ZWI5ZjE0MzA3YWMyZjllMjgwNTI2NTE5
11
- YWM2ZDI0MWYzZTM3N2FjM2YxNDVhYjkxNGEyMjUzNWJhZDNlZWQ=
9
+ YmVjNzI0ZWU4YThlMjc0MTdhOTQxNDZmYjZlMTA3OGMwZDVmYThmOWM3Yjk1
10
+ MmVhNzY2MzE5Zjg2MWMwYmI3NGU0MzNjZmQ2YTFhNDMyMjE4YjU5NGQ2Zjk4
11
+ NjdiODBlMjYyZmQyNWZkYTZkYTJjYzc5NGJhMTY4MDJmOWU4ODE=
12
12
  data.tar.gz: !binary |-
13
- OTdkNTA0YWE2Y2ExNzEzNDg1MTJkOTJiYmNjYWMyMTljNTc3NzE1N2E5MmEy
14
- YzI0OGJiOWI2ZjFkOTNlYWZiZGRiYWI1OWMwZWE4M2UyN2FkNTZiMTliNDQw
15
- ZmE5NDU5OTk4MDhiZGFjYjFiZDI5YmIwNTUwM2U3YzRjMDg1MTE=
13
+ YWEwMWIzZjcxMWZiNTc0NGE2YzgzYjlkMzJlMGQ0NTU3ZTRjNTdlYjkwNDJj
14
+ OTIzMDM2YTcxMTE5YjQ3ZDU5MzY0M2Q3YjU3ZDg3OThiNDU2MzRmNWUyM2Vi
15
+ ODE5Mzc1YTlmZTRjYTdmNmIzODUyMDQwZTFkYjc0ZTg5NTIyNGE=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.31
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Alephx
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.31"
4
4
  end
5
5
  end
@@ -10,7 +10,7 @@ module OmniAuth
10
10
  #required
11
11
  option :url # :url => "http://aleph.ugent.be/X"
12
12
  option :library # :library => "rug50"
13
-
13
+
14
14
  #only for test purpose (if you do not specify the option :form, a form will be created, using these options)
15
15
  option :title_form, "Aleph authentication"
16
16
  option :label_password,:password
@@ -21,7 +21,7 @@ module OmniAuth
21
21
 
22
22
  class << self
23
23
  attr_accessor :filters,:on_error
24
-
24
+
25
25
  def add_filter(&block)
26
26
  @filters = [] if @filters.nil?
27
27
  @filters << block
@@ -32,7 +32,7 @@ module OmniAuth
32
32
  @user_info[:bor_id]
33
33
  }
34
34
  info {
35
- {
35
+ {
36
36
  :name => @user_info[:name],
37
37
  :email => @user_info[:email]
38
38
  }
@@ -45,7 +45,7 @@ module OmniAuth
45
45
  }
46
46
 
47
47
  def request_phase
48
-
48
+
49
49
  form = OmniAuth::Form.new(:title => options[:title_form], :url => callback_path)
50
50
  form.text_field options[:label_username],:username
51
51
  form.password_field options[:label_password],:password
@@ -54,11 +54,11 @@ module OmniAuth
54
54
 
55
55
  end
56
56
 
57
- def callback_phase
57
+ def callback_phase
58
58
 
59
59
  params = request.params
60
60
 
61
- rp = request_path+"?"+{ :username => params['username'] }.to_query
61
+ rp = script_name + request_path+"?"+{ :username => params['username'] }.to_query
62
62
 
63
63
  if missing_credentials?
64
64
  session['omniauth.alephx.error'] = :missing_credentials
@@ -76,9 +76,9 @@ module OmniAuth
76
76
  end
77
77
 
78
78
  username = params['username']
79
- password = params['password']
80
-
81
- unless bor_auth(username,password)
79
+ password = params['password']
80
+
81
+ unless bor_auth(username,password)
82
82
  session['omniauth.alephx.error'] = :invalid_credentials
83
83
  self.class.on_error.call(:invalid_credentials) unless self.class.on_error.nil?
84
84
  return redirect(rp)
@@ -96,7 +96,7 @@ module OmniAuth
96
96
  end
97
97
 
98
98
  def bor_auth(username,password)
99
-
99
+
100
100
  uri = URI.parse(options[:url]+"?"+{
101
101
  :op => "bor-auth",
102
102
  :bor_id => username,
@@ -111,7 +111,7 @@ module OmniAuth
111
111
  res = http.request(Net::HTTP::Get.new(uri.request_uri))
112
112
 
113
113
  document = XmlSimple.xml_in(res.body,{ 'ForceArray' => false })
114
-
114
+
115
115
  return false if document['error']
116
116
 
117
117
  @user_info = {
@@ -119,11 +119,11 @@ module OmniAuth
119
119
  :bor_id => document['z303']['z303-id'],
120
120
  :name => document['z303']['z303-name'],
121
121
  :email => document['z304']['z304-email-address']
122
- }
122
+ }
123
123
 
124
124
  return true
125
125
 
126
- end
126
+ end
127
127
  def missing_credentials?
128
128
  request['username'].nil? or request['username'].empty? or request['password'].nil? or request['password'].empty?
129
129
  end
@@ -2,15 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: omniauth-alephx 0.1.3 ruby lib
5
+ # stub: omniauth-alephx 0.1.31 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "omniauth-alephx"
9
- s.version = "0.1.3"
9
+ s.version = "0.1.31"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
12
13
  s.authors = ["Nicolas Franck"]
13
- s.date = "2014-09-05"
14
+ s.date = "2015-10-05"
14
15
  s.description = "omniauth strategy for authenticating against AlephX Service"
15
16
  s.email = "nicolas.franck@ugent.be"
16
17
  s.extra_rdoc_files = [
@@ -29,13 +30,11 @@ Gem::Specification.new do |s|
29
30
  "lib/omniauth-alephx/version.rb",
30
31
  "lib/omniauth/strategies/alephx.rb",
31
32
  "omniauth-alephx.gemspec",
32
- "test/helper.rb",
33
- "test/test_omniauth-alephx.rb"
33
+ "test/helper.rb"
34
34
  ]
35
35
  s.homepage = "http://github.com/nicolasfranck/omniauth-alephx"
36
36
  s.licenses = ["MIT"]
37
- s.require_paths = ["lib"]
38
- s.rubygems_version = "2.1.11"
37
+ s.rubygems_version = "2.4.5"
39
38
  s.summary = "omniauth strategy for authenticating against AlephX Service"
40
39
 
41
40
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-alephx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Franck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-05 00:00:00.000000000 Z
11
+ date: 2015-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -128,7 +128,6 @@ files:
128
128
  - lib/omniauth/strategies/alephx.rb
129
129
  - omniauth-alephx.gemspec
130
130
  - test/helper.rb
131
- - test/test_omniauth-alephx.rb
132
131
  homepage: http://github.com/nicolasfranck/omniauth-alephx
133
132
  licenses:
134
133
  - MIT
@@ -149,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
148
  version: '0'
150
149
  requirements: []
151
150
  rubyforge_project:
152
- rubygems_version: 2.1.11
151
+ rubygems_version: 2.4.5
153
152
  signing_key:
154
153
  specification_version: 4
155
154
  summary: omniauth strategy for authenticating against AlephX Service
@@ -1,7 +0,0 @@
1
- require 'helper'
2
-
3
- class TestOmniauthAlephx < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
6
- end
7
- end