blueauth 0.0.13 → 0.0.14
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/.travis.yml +15 -4
- data/README.md +1 -1
- data/blueauth.gemspec +1 -0
- data/lib/blueauth.rb +16 -11
- data/lib/blueauth/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3971e904a5cc8af2fe7a1ba19a9ce85c01e3c107
|
4
|
+
data.tar.gz: f532e68bc14d53f08ed7114c48c9f6804b058f81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fd050c0c12b2596f321c82e5ff4ec92bc636272513f4a882373bd3429084c106e232daa45be706da37f9b6fe2b81d61e22ed7a7e4fa464a1ffd31d47dd3f02d
|
7
|
+
data.tar.gz: bccf67b6c695497ab5d4b47535f3dea3e028c43301c68c06cf04edeff4d27673edb1d281a850ca54edb51ab510658f51bfb118951f8fbeb22ffbe9d42d3e3419
|
data/.travis.yml
CHANGED
@@ -1,4 +1,15 @@
|
|
1
|
-
language: ruby
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
language: ruby
|
2
|
+
os: linux
|
3
|
+
dist: trusty
|
4
|
+
sudo: false
|
5
|
+
rvm:
|
6
|
+
- 2.2.3
|
7
|
+
- 2.3.3
|
8
|
+
- 2.3.4
|
9
|
+
before_install: gem install bundler -v 1.11.2
|
10
|
+
group: bluezone
|
11
|
+
script:
|
12
|
+
- bundle exec rspec
|
13
|
+
env:
|
14
|
+
global:
|
15
|
+
secure: KFlWkwIjU5WINcibYt9dAjtztnSLmp1jv6qM+6uESGqHjFAYNYzQIEuFPnPumEXk2Ud49KB/hh4++Wwbv1yJQUQ5XaG6cS7b61c1SRijdly3kW0x+MKPTl6JFomxO+H/dpBCLj8HF63DNg3S0tRedeRxamNkVfXOovZzjZv2O5iuOWS3e/YL5YQI4bGbZgSQH08ZeJjMIVvW6ZbOFYS097rjB5k7g8xEkrs39VGDf1dJ2e/BvckCzVk5aleibYxgofABJNtx2cv5yHAFF4bd3H3jptIYOOaqeLumys3Ss6Z4aCC+TydasJpAKk091lN5Mtkbss19KYZZgIgP0gmtq5e7a6qVA15XHCX5prhSwcEaFi7B5tHao4s2P5dUymOM3r4eXFT368dmTOrHgIU7rjEhmYZYearSjcxxupTG7cEi2w2T3y/ojTU4OVj1JmSYKrJTlBKyv41ruuKkighYLcKrpDVVV3uwnx2xXdcLRNVa5EsEWF3TjgjmlUhu3BVisavdcB2tRPfpk/o27NVdmcqHutrFbbQc91M26ctbq6jc3QYohie+AyX9P3ux5L5KOFZ4jUt+JNlN2p127oJgCYYWUfuqD+6Gv1PRmZLbI64Vio4hmE6X+qw2fJqYUoai852Bfm0nPlMRxTZXgpeUE9eNL/PpyfQoqywUwIkAoZY=
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Blueauth
|
1
|
+
# Blueauth [](https://travis.ibm.com/zoltan-izso/blueauth)
|
2
2
|
|
3
3
|
The purpose of this gem is to allow IBMers to search and authenticate user that are registered in IBM's Enterprise Directory. This gem can only be used in IBM's Intranet network. Every IBM employee can be searched based on his/her Intraned ID, or Notes ID, or Common name.
|
4
4
|
|
data/blueauth.gemspec
CHANGED
data/lib/blueauth.rb
CHANGED
@@ -18,23 +18,26 @@ module Blueauth
|
|
18
18
|
@cert_store.add_cert OpenSSL::X509::Certificate.new(NEW_CERT)
|
19
19
|
@cert_store.add_cert OpenSSL::X509::Certificate.new(OLD_CERT)
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
def self.open_ldap
|
22
|
+
Net::LDAP.new hosts: BPHOSTS, encryption: {
|
23
|
+
method: :simple_tls,
|
24
|
+
tls_options: {
|
25
|
+
ssl_version: :TLSv1_2,
|
26
|
+
verify_mode: OpenSSL::SSL::VERIFY_PEER,
|
27
|
+
cert_store: @cert_store
|
28
|
+
}
|
27
29
|
}
|
28
|
-
|
30
|
+
end
|
29
31
|
|
30
32
|
# using this method a user can be authenticated
|
31
33
|
# Intraned ID, password are mandatory
|
32
34
|
def self.authenticate(id, password)
|
33
35
|
user = search id.strip
|
34
36
|
unless user.nil?
|
35
|
-
|
37
|
+
ldap = open_ldap
|
38
|
+
ldap.auth user[:dn], password.strip
|
36
39
|
begin
|
37
|
-
auth =
|
40
|
+
auth = ldap.bind
|
38
41
|
rescue => e
|
39
42
|
raise Blueauth::BlueError, "BluePages Bind issue -> #{e.message}"
|
40
43
|
end
|
@@ -79,7 +82,8 @@ module Blueauth
|
|
79
82
|
end
|
80
83
|
filter = Net::LDAP::Filter.eq(searchfield, id) & Net::LDAP::Filter.eq('objectclass', "ibmPerson")
|
81
84
|
begin
|
82
|
-
|
85
|
+
ldap = open_ldap
|
86
|
+
user_array = ldap.search(base: BPBASE, filter: filter, size: 1)
|
83
87
|
rescue => e
|
84
88
|
raise Blueauth::BlueError, "BluePages Search issue -> #{e.message}"
|
85
89
|
end
|
@@ -97,7 +101,8 @@ module Blueauth
|
|
97
101
|
result = []
|
98
102
|
filter = Net::LDAP::Filter.eq('uniquemember', dn)
|
99
103
|
begin
|
100
|
-
|
104
|
+
ldap = open_ldap
|
105
|
+
bgres = ldap.search(base: BGBASE, filter: filter, attributes: ['cn'])
|
101
106
|
bgres.each {|g| result << g.cn.first}
|
102
107
|
rescue => e
|
103
108
|
raise Blueauth::BlueError, "BlueGroup Search issue -> #{e.message}"
|
data/lib/blueauth/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zoltan-izso
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: diff-lcs
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.2.5
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.2.5
|
69
83
|
description: Bluepages Authentication for IBMers within IBM's Intranet
|
70
84
|
email:
|
71
85
|
- zoltan.izso@hu.ibm.com
|