netsoul 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.travis.yml +1 -0
- data/.versions.conf +1 -1
- data/bin/netsoul-ruby +2 -2
- data/lib/netsoul/client.rb +8 -5
- data/lib/netsoul/config.rb +3 -0
- data/lib/netsoul/logging.rb +2 -0
- data/lib/netsoul/message.rb +5 -2
- data/lib/netsoul/version.rb +3 -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: f511c891783d06060a8d654ebbdf37c041d620fd
|
4
|
+
data.tar.gz: f63b6c750f8b96ec56fa4157cb26c8ba6fbfe8ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84754812cf7271daf35e82578987f093d197e6d1a94763bb9681ecee6a29a5a230203ead449d6b7c722c118322e106376619d9bde31b8337df7df7604c2ae0ff
|
7
|
+
data.tar.gz: 5132d4dd76c213ff170b4c1973a9dff1ab1eda35a5e08b43288d405226cff93baf02b4d64ae0c39bb97994d6b45c271df5c1fbcbf97a15803f3fa7046cc4094a
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/.versions.conf
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
ruby=2.
|
1
|
+
ruby=2.3.0
|
2
2
|
ruby-gemset=netsoul
|
data/bin/netsoul-ruby
CHANGED
@@ -9,7 +9,7 @@ $stderr.sync = true
|
|
9
9
|
require 'optparse'
|
10
10
|
require 'yaml'
|
11
11
|
|
12
|
-
process_name_string = "#{__FILE__} #{ARGV.join(' ')}".freeze
|
12
|
+
process_name_string = "#{__FILE__} #{ARGV.join(' '.freeze)}".freeze
|
13
13
|
Process.respond_to?(:setproctitle) ? Process.setproctitle(process_name_string) : $PROGRAM_NAME = process_name_string
|
14
14
|
|
15
15
|
options = {}
|
@@ -22,7 +22,7 @@ OptionParser.new do |opts|
|
|
22
22
|
options[:user_opts] = YAML.load_file(file) if File.file?(file)
|
23
23
|
end
|
24
24
|
|
25
|
-
opts.on('-h'.freeze, '--help', 'Display this screen'.freeze) do
|
25
|
+
opts.on('-h'.freeze, '--help'.freeze, 'Display this screen'.freeze) do
|
26
26
|
puts opts
|
27
27
|
exit 42
|
28
28
|
end
|
data/lib/netsoul/client.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: false
|
2
|
+
|
1
3
|
require_relative '../netsoul'
|
2
4
|
require 'socket'
|
3
5
|
|
@@ -16,7 +18,7 @@ module Netsoul
|
|
16
18
|
|
17
19
|
def auth_ag
|
18
20
|
send(Message.auth_ag)
|
19
|
-
fail Netsoul::IdentificationError, 'Identification failed.'.freeze unless get.split(' ')[1] == '002'.freeze
|
21
|
+
fail Netsoul::IdentificationError, 'Identification failed.'.freeze unless get.split(' '.freeze)[1] == '002'.freeze
|
20
22
|
end
|
21
23
|
private :auth_ag
|
22
24
|
|
@@ -26,7 +28,8 @@ module Netsoul
|
|
26
28
|
else
|
27
29
|
send(Message.standard_auth(@config))
|
28
30
|
end
|
29
|
-
fail Netsoul::AuthenticationError, 'Authentication failed. See your config file or environment variables'.freeze
|
31
|
+
fail Netsoul::AuthenticationError, 'Authentication failed. See your config file or environment variables'.freeze \
|
32
|
+
unless get.split(' '.freeze)[1] == '002'.freeze
|
30
33
|
end
|
31
34
|
private :auth_method
|
32
35
|
|
@@ -58,7 +61,7 @@ module Netsoul
|
|
58
61
|
|
59
62
|
def send(str)
|
60
63
|
_, sock = IO.select(nil, [@socket], nil, SOCKET_WRITE_TIMEOUT)
|
61
|
-
fail Netsoul::SocketError, 'Timeout or fail on write socket' if sock.nil? || sock.empty?
|
64
|
+
fail Netsoul::SocketError, 'Timeout or fail on write socket'.freeze if sock.nil? || sock.empty?
|
62
65
|
s = sock.first
|
63
66
|
if s
|
64
67
|
s.puts str
|
@@ -69,13 +72,13 @@ module Netsoul
|
|
69
72
|
|
70
73
|
def get
|
71
74
|
sock, = IO.select([@socket], nil, nil, SOCKET_READ_TIMEOUT)
|
72
|
-
fail Netsoul::SocketError, 'Timeout or fail on read socket' if sock.nil? || sock.empty?
|
75
|
+
fail Netsoul::SocketError, 'Timeout or fail on read socket'.freeze if sock.nil? || sock.empty?
|
73
76
|
res = sock.first.gets
|
74
77
|
if res
|
75
78
|
log :info, "[get ] #{res.chomp}"
|
76
79
|
res
|
77
80
|
else
|
78
|
-
'nothing' # Send some string and permit IO.select to thrown exception if something goes wrong.
|
81
|
+
'nothing'.freeze # Send some string and permit IO.select to thrown exception if something goes wrong.
|
79
82
|
end
|
80
83
|
end
|
81
84
|
|
data/lib/netsoul/config.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: false
|
2
|
+
|
1
3
|
module Netsoul
|
2
4
|
class Config
|
3
5
|
AUTH_METHODS = [:std, :krb5].freeze
|
@@ -45,6 +47,7 @@ module Netsoul
|
|
45
47
|
|
46
48
|
@client_name = ENV['NETSOUL_CLIENT_NAME'] || opts.fetch(:client_name, "(Netsoul-Ruby v#{Netsoul::VERSION}) -> { Christian Kakesa, since 2009}".freeze)
|
47
49
|
end
|
50
|
+
# rubocop:enable all
|
48
51
|
|
49
52
|
def build_user_connection_info(opts = {})
|
50
53
|
return unless opts.is_a?(Hash)
|
data/lib/netsoul/logging.rb
CHANGED
data/lib/netsoul/message.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: false
|
2
|
+
|
1
3
|
require 'base64'
|
2
4
|
require 'digest/md5'
|
3
5
|
require 'uri'
|
@@ -21,6 +23,8 @@ module Netsoul
|
|
21
23
|
|
22
24
|
# :nocov:
|
23
25
|
def _kerberos_get
|
26
|
+
require 'netsoul_kerberos'
|
27
|
+
|
24
28
|
@netsoul_kerberos ||= NetsoulKerberos.new
|
25
29
|
rescue LoadError => e
|
26
30
|
raise Netsoul::Error, "NetsoulKerberos library not found: #{e}.".freeze
|
@@ -34,8 +38,6 @@ module Netsoul
|
|
34
38
|
end
|
35
39
|
|
36
40
|
def kerberos_auth(config)
|
37
|
-
require 'netsoul_kerberos'
|
38
|
-
|
39
41
|
unless _kerberos_get.build_token(config.login, config.unix_password)
|
40
42
|
fail Netsoul::Error, 'Impossible to retrieve the kerberos token.'.freeze
|
41
43
|
end
|
@@ -165,6 +167,7 @@ module Netsoul
|
|
165
167
|
epita: '10.'.freeze
|
166
168
|
}
|
167
169
|
end
|
170
|
+
# rubocop:enable all
|
168
171
|
end
|
169
172
|
end
|
170
173
|
end
|
data/lib/netsoul/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netsoul
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Kakesa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -183,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
183
|
version: '0'
|
184
184
|
requirements: []
|
185
185
|
rubyforge_project:
|
186
|
-
rubygems_version: 2.
|
186
|
+
rubygems_version: 2.5.1
|
187
187
|
signing_key:
|
188
188
|
specification_version: 4
|
189
189
|
summary: Netsoul client and library for ruby.
|