blueauth 0.0.9 → 0.0.10
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 +4 -4
- data/lib/blueauth.rb +5 -5
- data/lib/blueauth/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d43f780a0b6f124b426f1e3996491c7f5499184b
|
4
|
+
data.tar.gz: edc0da9ca9d17ba4ed9435adce580bf7f4f24de2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9c6a298798d093d875657426d90ad6ec779b1bdfebd0c2adf33b23a2fe4b2c5cb9e043ec5567e4a7ddf715a62cca48753eeec0739d2fa75eec41fb674dfd113
|
7
|
+
data.tar.gz: f6e1250e7db720a4e56b5738b0bc0be02409efad2a29a9f39c61740ed22c7a1054aed50cf9aacb9f750e2cb64c36d87606b6fc6df7e0f2740041814304961170
|
data/lib/blueauth.rb
CHANGED
@@ -4,11 +4,11 @@ require 'net-ldap'
|
|
4
4
|
|
5
5
|
module Blueauth
|
6
6
|
|
7
|
-
BPHOST = 'bluepages.ibm.com'
|
8
|
-
BGHOST = 'bluegroups.ibm.com'
|
9
7
|
BPBASE = 'ou=bluepages,o=ibm.com'
|
10
8
|
BGBASE = 'ou=memberlist,ou=ibmgroups,o=ibm.com'
|
11
9
|
|
10
|
+
BPHOSTS = [['9.57.182.78',636], ['9.17.186.253',636], ['bluepages.ibm.com',636]]
|
11
|
+
|
12
12
|
old_verbose, $VERBOSE = $VERBOSE, nil
|
13
13
|
Net::LDAP::LDAPControls::PAGED_RESULTS = FALSE
|
14
14
|
$VERBOSE = old_verbose
|
@@ -16,7 +16,7 @@ module Blueauth
|
|
16
16
|
# using this method a user can be authenticated
|
17
17
|
# Intraned ID, password are mandatory
|
18
18
|
def self.authenticate(id, password)
|
19
|
-
ldap = Net::LDAP.new
|
19
|
+
ldap = Net::LDAP.new hosts: BPHOSTS, base: BPBASE, :encryption => { :method => :simple_tls }#, :tls_options => { :verify_mode => OpenSSL::SSL::VERIFY_NONE } }
|
20
20
|
user = search id.strip
|
21
21
|
unless user.nil?
|
22
22
|
ldap.auth user[:dn], password.strip
|
@@ -42,7 +42,6 @@ module Blueauth
|
|
42
42
|
# return object contains
|
43
43
|
# :name, :country, :intranetid, :dn
|
44
44
|
def self.search(id)
|
45
|
-
ldap = Net::LDAP.new host: BPHOST, port: 636, base: BPBASE, :encryption => :simple_tls
|
46
45
|
if id.include? '@'
|
47
46
|
searchfield = 'mail'
|
48
47
|
elsif id.include? '/'
|
@@ -67,6 +66,7 @@ module Blueauth
|
|
67
66
|
end
|
68
67
|
filter = Net::LDAP::Filter.eq(searchfield, id) & Net::LDAP::Filter.eq('objectclass', "ibmPerson")
|
69
68
|
begin
|
69
|
+
ldap = Net::LDAP.new hosts: BPHOSTS, base: BPBASE, :encryption => { :method => :simple_tls }#, :tls_options => { :verify_mode => OpenSSL::SSL::VERIFY_NONE } }
|
70
70
|
user_array = ldap.search(base: BPBASE, filter: filter, size: 1)
|
71
71
|
rescue => e
|
72
72
|
raise Blueauth::BlueError, "BluePages Search issue -> #{e.message}"
|
@@ -83,7 +83,7 @@ module Blueauth
|
|
83
83
|
|
84
84
|
def self.bluegroups(dn)
|
85
85
|
result = []
|
86
|
-
bg = Net::LDAP.new
|
86
|
+
bg = Net::LDAP.new hosts: BPHOSTS, base: BGBASE, :encryption => { :method => :simple_tls }#, :tls_options => { :verify_mode => OpenSSL::SSL::VERIFY_NONE } }
|
87
87
|
bgf = Net::LDAP::Filter.eq('uniquemember', dn)
|
88
88
|
begin
|
89
89
|
bgres = bg.search(base: BGBASE, filter: bgf, attributes: ['cn'])
|
data/lib/blueauth/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blueauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zoltan-izso
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ldap
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.6.
|
111
|
+
rubygems_version: 2.6.7
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Bluepages Authentication for IBMers within IBM's Intranet
|