rack-auth-ldap 1.0 → 1.2
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 +5 -13
- data/.gitignore +1 -0
- data/README.rdoc +26 -8
- data/Rakefile +7 -1
- data/examples/Gemfile +6 -0
- data/examples/config.ru +1 -0
- data/lib/rack/auth/ldap/version.rb +5 -6
- data/lib/rack/auth/ldap.rb +78 -58
- data/rack-auth-ldap.gemspec +17 -16
- data/spec/config/ldap.yml +2 -2
- data/spec/rack-auth-ldap_spec.rb +30 -19
- metadata +71 -46
- data/Gemfile.lock +0 -45
- data/ldap.rb +0 -0
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
N2I2Y2YzY2JmOWMyNTBmMGUyOGQwMzFhZjJiN2E2NDI4MTcxNGQ2OA==
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a26f75621896ce2d5323fcfb2ba0f3859de1010af2b154625b5ed20436aea14b
|
4
|
+
data.tar.gz: '0827753cdf8d8c2c3e072ff4f5878d5aac95b0b69d1ae7f80c4c80d4d6ccb469'
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
OTNkZDFiMDFhMzMzYjM3M2Q2YzZhYzA3ZTU2YTg4MjE3YTM3NWIxYzgzNGQ0
|
11
|
-
ZDgzOWVmMmQ5MzE5MTI4ZmNkNzMwZjEzODM1MDIzOTE2MTY3ZTA=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
M2VlNDg2ZTk1NDE1MzI3Y2RiNmFkN2M2N2ZkNTgyZmJlNmNmMGUxYWJmZWM0
|
14
|
-
NDMzYTc4ZDQzZWI1Mjk4MjNjMzI3Y2EwY2M1NzFkOTNhN2E1NmQ5YzBlMTJl
|
15
|
-
YTYyMDA2MmQ2MmVhOGVkOTczZGI2ZDQ1ZGEwZDliZThiYWEyNTQ=
|
6
|
+
metadata.gz: b6e5d4c64370cca9b5b8591a95897ace32d9785b05e9c491a3923d73a6f2c2386c4e9336b4070b67905f75634c3cb86b166a0e0ccf05589764d7517ffc88969b
|
7
|
+
data.tar.gz: 69f6a21f010e4cfd69cec21c70b2c19b3090d6b55cc3c1a063efa84abc76651c22bac057566ac6dd3412392a5c6081ebc8fda7b61be2b2076cd775aa95085249
|
data/.gitignore
CHANGED
data/README.rdoc
CHANGED
@@ -7,17 +7,16 @@ Rack Middleware LDAP authentication
|
|
7
7
|
Copyright (c) 2014 Romain GEORGES. See COPYRIGHT for details.
|
8
8
|
Copyright (C) 2007, 2008, 2009, 2010 Christian Neukirchen <purl.org/net/chneukirchen> for Rack Project
|
9
9
|
|
10
|
-
== Presentation
|
10
|
+
== Presentation
|
11
11
|
|
12
|
-
Rack::Auth::Ldap is a basic authentication module with LDAP support
|
13
|
-
Rack::Auth::Ldap is heavily based on Rack:Auth::Basic from the Rack main Project by Christian Neukirchen
|
12
|
+
Rack::Auth::Ldap is a basic authentication module with LDAP support
|
13
|
+
Rack::Auth::Ldap is heavily based on Rack:Auth::Basic from the Rack main Project by Christian Neukirchen
|
14
14
|
|
15
|
-
This is an additional module for Rack to authenticate users against an LDAP
|
15
|
+
This is an additional module for Rack to authenticate users against an LDAP server
|
16
16
|
|
17
|
+
== Usage
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
=== Initialise
|
19
|
+
=== Initialize
|
21
20
|
|
22
21
|
In you config.ru, simply add :
|
23
22
|
|
@@ -32,8 +31,10 @@ In you config.ru, simply add :
|
|
32
31
|
use Rack::Auth::Ldap
|
33
32
|
run Sinatra::Application
|
34
33
|
|
35
|
-
this configuration activate the Basic
|
34
|
+
this configuration activate the Basic Authentication for the entire application
|
36
35
|
|
36
|
+
To use custom configuration file:
|
37
|
+
use RAck::Auth::Ldap, file: '/path/to/my/cconfig.yml'
|
37
38
|
|
38
39
|
=== Configure
|
39
40
|
|
@@ -71,3 +72,20 @@ if you want to deactivate root authentication before user binding :
|
|
71
72
|
|
72
73
|
development:
|
73
74
|
<<: *ldap_defaults
|
75
|
+
|
76
|
+
to use ldaps add:
|
77
|
+
simple_tls: true
|
78
|
+
|
79
|
+
to use start tls add:
|
80
|
+
start_tls: true
|
81
|
+
|
82
|
+
if you need to set openssl options add a "tls_options" hash e.g.:
|
83
|
+
tls_options:
|
84
|
+
ca_path: /my/certificate/dir
|
85
|
+
or
|
86
|
+
tls_options:
|
87
|
+
ca_file: /my/certificate/file
|
88
|
+
|
89
|
+
to help debug tls you can add:
|
90
|
+
debug: true
|
91
|
+
which will send debugging messages to stdout
|
data/Rakefile
CHANGED
@@ -56,4 +56,10 @@ Rake::RDocTask.new('rdoc') do |d|
|
|
56
56
|
d.options << '--line-numbers' << '--diagram' << '-SHN'
|
57
57
|
end
|
58
58
|
|
59
|
-
task :default => [:gem]
|
59
|
+
task :default => [:gem]
|
60
|
+
|
61
|
+
task :stage do
|
62
|
+
Rake::Task["clean"].invoke
|
63
|
+
Rake::Task["clobber"].invoke
|
64
|
+
Rake::Task["install"].invoke
|
65
|
+
end
|
data/examples/Gemfile
ADDED
data/examples/config.ru
CHANGED
@@ -1,14 +1,13 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
# Author : Romain GEORGES
|
1
|
+
# coding: utf-8
|
2
|
+
# Author : Romain GEORGES
|
4
3
|
|
5
|
-
# the Rack module from Rack Sources
|
4
|
+
# the Rack module from Rack Sources
|
6
5
|
module Rack
|
7
6
|
|
8
|
-
# the Rack::Auth module from Rack Sources
|
7
|
+
# the Rack::Auth module from Rack Sources
|
9
8
|
module Auth
|
10
9
|
# the current version for Rack::Auth::Ldap => gem rack-auth-ldap
|
11
10
|
# used by gemspec
|
12
|
-
LDAP_VERSION = "1.
|
11
|
+
LDAP_VERSION = "1.2"
|
13
12
|
end
|
14
13
|
end
|
data/lib/rack/auth/ldap.rb
CHANGED
@@ -1,5 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
#inhibit warning : due to net-ldap warning on Socket.tcp
|
4
|
+
$-w = nil
|
5
|
+
|
1
6
|
require 'rack'
|
2
|
-
require 'ldap'
|
7
|
+
require 'net/ldap'
|
3
8
|
require 'rack/auth/abstract/handler'
|
4
9
|
require 'rack/auth/abstract/request'
|
5
10
|
require 'yaml'
|
@@ -10,20 +15,19 @@ module Rack
|
|
10
15
|
# the auth module from Rack Sources
|
11
16
|
module Auth
|
12
17
|
|
13
|
-
|
14
|
-
# class Config provide Yaml config mapping for Rack::Auth::Module
|
18
|
+
# class Config provide Yaml config mapping for Rack::Auth::Module
|
15
19
|
# the class map ldap configurations values
|
16
20
|
# @note this class is not provide to be used standalone
|
17
|
-
class Config
|
21
|
+
class Config
|
18
22
|
|
19
|
-
# initializer for Config class
|
23
|
+
# initializer for Config class
|
20
24
|
# @param [Hash<Symbol>] options initialisation options
|
21
25
|
# @option options [Symbol] :file The YAML filename (default to ./ldap.yml, the config.ru path)
|
22
|
-
# @return [Config] object himself
|
26
|
+
# @return [Config] object himself
|
23
27
|
def initialize(options = { :file => './ldap.yml'})
|
24
28
|
@values = defaults
|
25
29
|
target = (ENV['RACK_ENV'])? ENV['RACK_ENV'] : 'test'
|
26
|
-
config_values =
|
30
|
+
config_values = load_yaml(::File.expand_path(options[:file], Dir.pwd))[target]
|
27
31
|
debug = ::File.open("/tmp/test.txt",'a+')
|
28
32
|
debug.puts ENV['RACK_ENV']
|
29
33
|
debug.close
|
@@ -32,12 +36,25 @@ module Rack
|
|
32
36
|
end
|
33
37
|
@values.merge! config_values
|
34
38
|
@values.keys.each do |meth|
|
35
|
-
bloc = Proc.new {@values[meth] }
|
36
|
-
self.class.send :define_method, meth, &bloc
|
37
|
-
end
|
39
|
+
bloc = Proc.new {@values[meth] }
|
40
|
+
self.class.send :define_method, meth, &bloc
|
41
|
+
end
|
38
42
|
end
|
39
|
-
|
40
|
-
private
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def load_yaml(file)
|
47
|
+
if ::File.exist?(file)
|
48
|
+
::YAML.load ::ERB.new(IO.read(file)).result
|
49
|
+
else
|
50
|
+
raise "Could not load ldap configuration. No such file - #{file}"
|
51
|
+
end
|
52
|
+
rescue ::Psych::SyntaxError => e
|
53
|
+
raise "YAML syntax error occurred while parsing #{file}. " \
|
54
|
+
"Please note that YAML must be consistently indented using spaces. Tabs are not allowed. " \
|
55
|
+
"Error: #{e.message}"
|
56
|
+
end
|
57
|
+
|
41
58
|
# private method with default configuration values for LDAP
|
42
59
|
# @return [Hash<Symbol>] the default values of LDAP configuration
|
43
60
|
def defaults
|
@@ -50,39 +67,41 @@ module Rack
|
|
50
67
|
:port => 389,
|
51
68
|
:scope => :subtree,
|
52
69
|
:username_ldap_attribute => 'uid',
|
70
|
+
:ldaps => false,
|
71
|
+
:starttls => false,
|
72
|
+
:tls_options => nil,
|
73
|
+
:debug => false
|
53
74
|
}
|
54
75
|
end
|
55
|
-
|
56
|
-
|
57
76
|
end
|
58
77
|
|
59
|
-
# class Ldap, the main authentication component for Rack
|
78
|
+
# class Ldap, the main authentication component for Rack
|
60
79
|
# inherited from the default Rack::Auth::AbstractHandler
|
61
|
-
# @note please do not instantiate, this classe is reserved to Rack
|
62
|
-
# @example Usage
|
80
|
+
# @note please do not instantiate, this classe is reserved to Rack
|
81
|
+
# @example Usage
|
63
82
|
# # in a config.ru
|
64
83
|
# gem 'rack-auth-ldap'
|
65
84
|
# require 'rack/auth/ldap'
|
66
85
|
# use Rack::Auth::Ldap
|
67
86
|
class Ldap < AbstractHandler
|
68
|
-
|
87
|
+
|
69
88
|
# the config read accessor
|
70
89
|
# @attr [Rack::Auth::Config] the read accessor to the LDAP Config object
|
71
90
|
attr_reader :config
|
72
|
-
|
91
|
+
|
73
92
|
# initializer for the Ldap Class
|
74
|
-
# @note please don not instantiate without rack config.ru
|
93
|
+
# @note please don not instantiate without rack config.ru
|
75
94
|
# @see Rack::Auth::Ldap
|
76
95
|
# @return [Ldap] self object
|
77
96
|
# @param [Block,Proc,Lambda] app the rack application
|
78
97
|
# @param [hash<Symbol>] config_options the configurable options
|
79
|
-
# @option config_options [Symbol] :file the path to the YAML configuration file
|
98
|
+
# @option config_options [Symbol] :file the path to the YAML configuration file
|
80
99
|
def initialize(app, config_options = {})
|
81
100
|
super(app)
|
82
101
|
@config = Config.new(config_options)
|
83
102
|
end
|
84
103
|
|
85
|
-
# call wrapper to provide authentication if not
|
104
|
+
# call wrapper to provide authentication if not
|
86
105
|
# @param [Hash] env the rack environnment variable
|
87
106
|
# @return [Array] the tri-dimensional Array [status,headers,[body]]
|
88
107
|
def call(env)
|
@@ -100,53 +119,57 @@ module Rack
|
|
100
119
|
private
|
101
120
|
|
102
121
|
# forge a challange header for HTTP basic auth with the realm attribut
|
103
|
-
# @return [String] the header
|
122
|
+
# @return [String] the header
|
104
123
|
def challenge
|
105
124
|
'Basic realm="%s"' % realm
|
106
125
|
end
|
107
|
-
|
108
|
-
# do the LDAP connection => search => bind with the credentials get into request headers
|
126
|
+
|
127
|
+
# do the LDAP connection => search => bind with the credentials get into request headers
|
109
128
|
# @param [Rack::Auth::Ldap::Request] auth a LDAP authenticator object
|
110
129
|
# @return [TrueClass,FalseClass] Boolean true/false
|
111
|
-
def valid?(auth)
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
130
|
+
def valid?(auth)
|
131
|
+
# how to connect to the ldap server: ldap, ldaps, ldap + starttls
|
132
|
+
if @config.ldaps
|
133
|
+
enc = { :method => :simple_tls }
|
134
|
+
elsif @config.starttls
|
135
|
+
enc = { :method => :start_tls }
|
136
|
+
enc[:tls_options] = @config.tls_options if @config.tls_options
|
137
|
+
else
|
138
|
+
enc = nil # just straight ldap
|
119
139
|
end
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
140
|
+
conn = Net::LDAP.new( :host => @config.hostname, :port => @config.port,
|
141
|
+
:base => @config.basedn,
|
142
|
+
:encryption => enc )
|
143
|
+
|
144
|
+
$stdout.puts "Net::LDAP.new => #{conn.inspect}" if @config.debug
|
145
|
+
|
146
|
+
if @config.auth
|
147
|
+
$stdout.puts "doing auth for #{@config.rootdn.inspect}" if @config.debug
|
148
|
+
conn.auth @config.rootdn, @config.passdn
|
149
|
+
# conn.get_operation_result.message has the reson for a failure
|
150
|
+
return false unless conn.bind
|
128
151
|
end
|
129
|
-
end
|
130
152
|
|
131
|
-
|
153
|
+
filter = Net::LDAP::Filter.eq(@config.username_ldap_attribute,
|
154
|
+
auth.username)
|
132
155
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
return res[_scope]
|
156
|
+
$stdout.puts "Net::LDAP::Filter.eq => #{filter.inspect}" if @config.debug
|
157
|
+
|
158
|
+
# find the user and rebind as them to test the password
|
159
|
+
#return conn.bind_as(:filter => filter, :password => auth.password)
|
160
|
+
$stdout.puts "doing bind_as password.size: #{auth.password.size}..." if @config.debug
|
161
|
+
ret = conn.bind_as(:filter => filter, :password => auth.password)
|
162
|
+
$stdout.puts "bind_as => #{ret.inspect}" if @config.debug
|
163
|
+
ret
|
142
164
|
end
|
143
165
|
|
166
|
+
private
|
144
167
|
|
145
168
|
|
146
169
|
# Request class the LDAP credentials authenticator
|
147
|
-
# @note please do not instantiate manually, used by Rack::Auth:Ldap
|
170
|
+
# @note please do not instantiate manually, used by Rack::Auth:Ldap
|
148
171
|
class Request < Auth::AbstractRequest
|
149
|
-
|
172
|
+
|
150
173
|
# return true if the auth scheme provide is really a basic scheme
|
151
174
|
# @return [FalseClass,TrueClass] the result
|
152
175
|
def basic?
|
@@ -158,7 +181,7 @@ module Rack
|
|
158
181
|
def credentials
|
159
182
|
@credentials ||= params.unpack("m*").first.split(/:/, 2)
|
160
183
|
end
|
161
|
-
|
184
|
+
|
162
185
|
# read accessor on the first credentials, username
|
163
186
|
# @return [String] the username
|
164
187
|
def username
|
@@ -176,6 +199,3 @@ module Rack
|
|
176
199
|
end
|
177
200
|
end
|
178
201
|
end
|
179
|
-
|
180
|
-
|
181
|
-
|
data/rack-auth-ldap.gemspec
CHANGED
@@ -6,26 +6,27 @@ require 'rack/auth/ldap/version'
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "rack-auth-ldap"
|
8
8
|
s.summary = %Q{Rack middleware providing LDAP authentication}
|
9
|
-
s.email = "romain@ultragreen.net"
|
9
|
+
s.email = "romain@ultragreen.net"
|
10
10
|
s.homepage = "http://www.github.com/lecid/rack-auth-ldap"
|
11
11
|
s.authors = ["Romain GEORGES"]
|
12
12
|
s.version = Rack::Auth::LDAP_VERSION
|
13
|
-
|
14
|
-
|
13
|
+
|
14
|
+
|
15
15
|
s.description = %q{rack-auth-ldap : provide LDAP authentication for Rack middelware}
|
16
|
-
s.
|
17
|
-
s.add_development_dependency
|
18
|
-
s.add_development_dependency
|
19
|
-
s.add_development_dependency
|
20
|
-
s.add_development_dependency
|
21
|
-
s.add_development_dependency
|
22
|
-
s.add_development_dependency
|
23
|
-
s.
|
24
|
-
s.add_dependency('rack')
|
25
|
-
s.required_ruby_version = '>= 1.9.0'
|
26
|
-
s.license = "BSD"
|
27
|
-
s.files = `git ls-files`.split($/)
|
28
|
-
end
|
16
|
+
s.add_development_dependency 'rspec', '~> 3.9.0'
|
17
|
+
s.add_development_dependency 'yard', '~> 0.9.24'
|
18
|
+
s.add_development_dependency 'rdoc', '~> 6.2.1'
|
19
|
+
s.add_development_dependency 'roodi', '~> 5.0.0'
|
20
|
+
s.add_development_dependency 'code_statistics', '~> 0.2.13'
|
21
|
+
s.add_development_dependency 'yard-rspec', '~> 0.1'
|
22
|
+
s.add_development_dependency 'ladle', '~> 1.0.1'
|
23
|
+
s.add_development_dependency 'rake', '~> 13.0.1'
|
29
24
|
|
30
25
|
|
31
26
|
|
27
|
+
|
28
|
+
s.add_dependency 'net-ldap', '~> 0.16.2'
|
29
|
+
s.add_dependency 'rack', '~> 2.2.2'
|
30
|
+
s.license = "BSD-2-Clause"
|
31
|
+
s.files = `git ls-files`.split($/)
|
32
|
+
end
|
data/spec/config/ldap.yml
CHANGED
data/spec/rack-auth-ldap_spec.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# coding: utf-8
|
1
2
|
require 'ladle'
|
2
3
|
require 'rack/auth/ldap'
|
3
4
|
require 'rack/lint'
|
@@ -6,11 +7,11 @@ require 'rack/mock'
|
|
6
7
|
describe Rack::Auth::Ldap do
|
7
8
|
|
8
9
|
before :all do
|
9
|
-
@ldap_server = Ladle::Server.new({
|
10
|
+
@ldap_server = Ladle::Server.new({
|
10
11
|
:quiet => true, :port => 3897,
|
11
12
|
:ldif => "./spec/config/users.ldif",
|
12
13
|
:domain => "dc=test",
|
13
|
-
:tmpdir => '/tmp'
|
14
|
+
:tmpdir => '/tmp'
|
14
15
|
}).start
|
15
16
|
end
|
16
17
|
|
@@ -48,11 +49,21 @@ describe Rack::Auth::Ldap do
|
|
48
49
|
end
|
49
50
|
|
50
51
|
def assert_basic_auth_challenge(response)
|
51
|
-
response.client_error
|
52
|
-
response.status.
|
53
|
-
response.
|
54
|
-
response.headers['WWW-Authenticate'].
|
55
|
-
response.body.
|
52
|
+
expect(response.client_error?).to be true
|
53
|
+
expect(response.status).to eq 401
|
54
|
+
expect(response).to include 'WWW-Authenticate'
|
55
|
+
expect(response.headers['WWW-Authenticate']).to match /Basic realm="#{Regexp.escape(realm)}"/
|
56
|
+
expect(response.body).to be_empty
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'should render ldap.yaml with erb and use env vars' do
|
60
|
+
allow(ENV).to receive(:[]).with('RACK_ENV')
|
61
|
+
allow(ENV).to receive(:[]).with('HOSTNAME').and_return('localhost.local')
|
62
|
+
allow(ENV).to receive(:[]).with('PORT').and_return('9090')
|
63
|
+
|
64
|
+
app = Rack::Auth::Ldap.new(unprotected_app,{:file => './spec/config/ldap.yml'})
|
65
|
+
expect(app.config.hostname).to eq('localhost.local')
|
66
|
+
expect(app.config.port).to eq(9090)
|
56
67
|
end
|
57
68
|
|
58
69
|
it 'should challenge correctly when no credentials are specified' do
|
@@ -63,37 +74,37 @@ describe Rack::Auth::Ldap do
|
|
63
74
|
|
64
75
|
it 'should rechallenge if incorrect credentials are specified' do
|
65
76
|
request_with_basic_auth 'falseuser', 'password' do |response|
|
66
|
-
response.client_error
|
77
|
+
expect(response.client_error?).to be true
|
67
78
|
assert_basic_auth_challenge response
|
68
79
|
end
|
69
80
|
end
|
70
81
|
|
71
82
|
it 'should return application output if correct credentials are specified' do
|
72
83
|
request_with_basic_auth 'testuser', 'testpassword' do |response|
|
73
|
-
response.client_error
|
74
|
-
response.status.
|
75
|
-
response.body.to_s.
|
84
|
+
expect(response.client_error?).to be false
|
85
|
+
expect(response.status).to eq 200
|
86
|
+
expect(response.body.to_s).to eq 'Hi testuser'
|
76
87
|
end
|
77
88
|
end
|
78
89
|
|
79
90
|
it 'should return 400 Bad Request if different auth scheme used' do
|
80
91
|
request 'HTTP_AUTHORIZATION' => 'Digest params' do |response|
|
81
|
-
response.client_error
|
82
|
-
response.status.
|
83
|
-
response.
|
92
|
+
expect(response.client_error?).to be true
|
93
|
+
expect(response.status).to eq 400
|
94
|
+
expect(response).not_to include 'WWW-Authenticate'
|
84
95
|
end
|
85
96
|
end
|
86
97
|
|
87
98
|
it 'should return 400 Bad Request for a malformed authorization header' do
|
88
99
|
request 'HTTP_AUTHORIZATION' => '' do |response|
|
89
|
-
response.client_error
|
90
|
-
response.status.
|
91
|
-
response.
|
100
|
+
expect(response.client_error?).to be true
|
101
|
+
expect(response.status).to eq 400
|
102
|
+
expect(response).not_to include 'WWW-Authenticate'
|
92
103
|
end
|
93
104
|
end
|
94
|
-
|
105
|
+
|
95
106
|
it 'should takes realm as optional constructor arg' do
|
96
107
|
app = Rack::Auth::Basic.new(unprotected_app, realm) { true }
|
97
|
-
realm.
|
108
|
+
expect(realm).to eq app.realm
|
98
109
|
end
|
99
110
|
end
|
metadata
CHANGED
@@ -1,143 +1,170 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-auth-ldap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Romain GEORGES
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.9.0
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.9.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: yard
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.9.24
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.9.24
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rdoc
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 6.2.1
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 6.2.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: roodi
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 5.0.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 5.0.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: code_statistics
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.2.13
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 0.2.13
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: yard-rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
89
|
+
version: '0.1'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
96
|
+
version: '0.1'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: ladle
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 1.0.1
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.0.1
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rake
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 13.0.1
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 13.0.1
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: net-ldap
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.16.2
|
104
132
|
type: :runtime
|
105
133
|
prerelease: false
|
106
134
|
version_requirements: !ruby/object:Gem::Requirement
|
107
135
|
requirements:
|
108
|
-
- -
|
136
|
+
- - "~>"
|
109
137
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
138
|
+
version: 0.16.2
|
111
139
|
- !ruby/object:Gem::Dependency
|
112
140
|
name: rack
|
113
141
|
requirement: !ruby/object:Gem::Requirement
|
114
142
|
requirements:
|
115
|
-
- -
|
143
|
+
- - "~>"
|
116
144
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
145
|
+
version: 2.2.2
|
118
146
|
type: :runtime
|
119
147
|
prerelease: false
|
120
148
|
version_requirements: !ruby/object:Gem::Requirement
|
121
149
|
requirements:
|
122
|
-
- -
|
150
|
+
- - "~>"
|
123
151
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
125
|
-
description:
|
152
|
+
version: 2.2.2
|
153
|
+
description: 'rack-auth-ldap : provide LDAP authentication for Rack middelware'
|
126
154
|
email: romain@ultragreen.net
|
127
155
|
executables: []
|
128
156
|
extensions: []
|
129
157
|
extra_rdoc_files: []
|
130
158
|
files:
|
131
|
-
- .gitignore
|
159
|
+
- ".gitignore"
|
132
160
|
- COPYRIGHT
|
133
161
|
- Gemfile
|
134
|
-
- Gemfile.lock
|
135
162
|
- README.rdoc
|
136
163
|
- Rakefile
|
164
|
+
- examples/Gemfile
|
137
165
|
- examples/config.ru
|
138
166
|
- examples/ldap.yml
|
139
167
|
- examples/sinatra_example.rb
|
140
|
-
- ldap.rb
|
141
168
|
- lib/rack/auth/ldap.rb
|
142
169
|
- lib/rack/auth/ldap/version.rb
|
143
170
|
- rack-auth-ldap.gemspec
|
@@ -146,7 +173,7 @@ files:
|
|
146
173
|
- spec/rack-auth-ldap_spec.rb
|
147
174
|
homepage: http://www.github.com/lecid/rack-auth-ldap
|
148
175
|
licenses:
|
149
|
-
- BSD
|
176
|
+
- BSD-2-Clause
|
150
177
|
metadata: {}
|
151
178
|
post_install_message:
|
152
179
|
rdoc_options: []
|
@@ -154,19 +181,17 @@ require_paths:
|
|
154
181
|
- lib
|
155
182
|
required_ruby_version: !ruby/object:Gem::Requirement
|
156
183
|
requirements:
|
157
|
-
- -
|
184
|
+
- - ">="
|
158
185
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
186
|
+
version: '0'
|
160
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
188
|
requirements:
|
162
|
-
- -
|
189
|
+
- - ">="
|
163
190
|
- !ruby/object:Gem::Version
|
164
191
|
version: '0'
|
165
192
|
requirements: []
|
166
|
-
|
167
|
-
rubygems_version: 2.2.2
|
193
|
+
rubygems_version: 3.1.2
|
168
194
|
signing_key:
|
169
195
|
specification_version: 4
|
170
196
|
summary: Rack middleware providing LDAP authentication
|
171
197
|
test_files: []
|
172
|
-
has_rdoc: true
|
data/Gemfile.lock
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
rack-auth-ldap (0.1)
|
5
|
-
rack
|
6
|
-
ruby-ldap
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: http://rubygems.org/
|
10
|
-
specs:
|
11
|
-
code_statistics (0.2.13)
|
12
|
-
diff-lcs (1.2.5)
|
13
|
-
json (1.8.1)
|
14
|
-
rack (1.5.2)
|
15
|
-
rdoc (4.1.1)
|
16
|
-
json (~> 1.4)
|
17
|
-
roodi (4.0.0)
|
18
|
-
ruby_parser (~> 3.2, >= 3.2.2)
|
19
|
-
rspec (2.14.1)
|
20
|
-
rspec-core (~> 2.14.0)
|
21
|
-
rspec-expectations (~> 2.14.0)
|
22
|
-
rspec-mocks (~> 2.14.0)
|
23
|
-
rspec-core (2.14.8)
|
24
|
-
rspec-expectations (2.14.5)
|
25
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
26
|
-
rspec-mocks (2.14.6)
|
27
|
-
ruby-ldap (0.9.16)
|
28
|
-
ruby_parser (3.6.0)
|
29
|
-
sexp_processor (~> 4.1)
|
30
|
-
sexp_processor (4.4.3)
|
31
|
-
yard (0.8.7.4)
|
32
|
-
yard-rspec (0.1)
|
33
|
-
yard
|
34
|
-
|
35
|
-
PLATFORMS
|
36
|
-
ruby
|
37
|
-
|
38
|
-
DEPENDENCIES
|
39
|
-
code_statistics
|
40
|
-
rack-auth-ldap!
|
41
|
-
rdoc
|
42
|
-
roodi
|
43
|
-
rspec
|
44
|
-
yard
|
45
|
-
yard-rspec
|
data/ldap.rb
DELETED
File without changes
|