ood_core 0.23.2 → 0.23.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9864509d310ba9c2fc6f896595f62e429be829107029a81e91251d10abfd16e7
4
- data.tar.gz: 3f71fbe1c5502068d39f2cba7971e5055a1a64818248df3dab486761357a3c4c
3
+ metadata.gz: 5eeeaa19f116b7edd7e4169b49e0ca74f0e43355d756ef3b3eb14edaf1f9de00
4
+ data.tar.gz: aaa6d9a8ef9a2e1a2e1f7396c27eb101faba8c639cf8b088f5a1e62adbe6e97b
5
5
  SHA512:
6
- metadata.gz: 9ae243f303ccd6910a73009538e59c56a071b742f002182a14bc667006831e5993552bfc662363083db8144c34cd0f1310aff947d1db1f158c3c43f54a14be0f
7
- data.tar.gz: 61581da1191e92f68fadf2735bb05570be7297ee5e0769f20dafb2d6dceda8a5d644ab2b582fd117f2d028a0db9c45d2015e930aaa8b70420c82d5c1a3e81e06
6
+ metadata.gz: f36e3835a742b19e04c699e2913ec09c601c2dd912300615cad119c2ccc71482552690a0050b626f8cf024c13f40510430fb8747942c2bf37e3fa9a5040123d4
7
+ data.tar.gz: 29dfedd6a597f8b794fc5105e74bd0f4a2933ec423a7ad026a5c3ee6f3f531a9cb2b24956140c4afd0606897df22fd34771fbeb6d10fae63e8ba3b778317c6a0
@@ -8,20 +8,21 @@ module OodCore
8
8
  # Build the group acl adapter from a configuration
9
9
  # @param config [#to_h] the configuration for an acl adapter
10
10
  # @option config [Array<#to_s>] :groups The list of groups
11
- # @option config [#to_s] :type ('whitelist') The type of ACL ('whitelist' or 'blacklist')
11
+ # @option config [#to_s] :type ('allowlist') The type of ACL ('allowlist' or 'blocklist')
12
12
  def self.build_group(config)
13
13
  c = config.to_h.symbolize_keys
14
14
 
15
15
  groups = c.fetch(:groups) { raise ArgumentError, "No groups specified. Missing argument: groups" }.map(&:to_s)
16
16
  acl = OodSupport::ACL.new(entries: groups.map { |g| OodSupport::ACLEntry.new principle: g })
17
17
 
18
- type = c.fetch(:type, "whitelist").to_s
19
- if type == "whitelist"
18
+ type = c.fetch(:type, 'allowlist').to_s
19
+ case type
20
+ when 'allowlist', 'whitelist'
20
21
  allow = true
21
- elsif type == "blacklist"
22
+ when 'blocklist', 'blacklist'
22
23
  allow = false
23
24
  else
24
- raise ArgumentError, "Invalid type specified. Valid types: whitelist, blacklist"
25
+ raise ArgumentError, 'Invalid type specified. Valid types: allowlist, blocklist'
25
26
  end
26
27
 
27
28
  Adapters::Group.new(acl: acl, allow: allow)
@@ -90,7 +90,7 @@ module OodCore
90
90
  {
91
91
  adapter: "group",
92
92
  groups: h["data"]["groups"],
93
- type: h["data"]["allow"] ? "whitelist" : "blacklist"
93
+ type: h["data"]["allow"] ? 'allowlist' : 'blocklist'
94
94
  }
95
95
  end
96
96
  end
@@ -26,11 +26,20 @@ module OodCore
26
26
  return cmd, cmd_args if submit_host.to_s.empty?
27
27
 
28
28
  check_host = strict_host_checking ? "yes" : "no"
29
- args = ['-o', 'BatchMode=yes', '-o', 'UserKnownHostsFile=/dev/null', '-o', "StrictHostKeyChecking=#{check_host}", "#{submit_host}"]
29
+
30
+ # Have to OodCore::Job::Adapters::Helper.ssh_port instead of self.ssh_port due to test failure
31
+ args = ['-p', OodCore::Job::Adapters::Helper.ssh_port, '-o', 'BatchMode=yes', '-o', 'UserKnownHostsFile=/dev/null', '-o', "StrictHostKeyChecking=#{check_host}", "#{submit_host}"]
30
32
  env.each{|key, value| args.push("export #{key}=#{value};")}
31
33
 
32
34
  return 'ssh', args + [cmd] + cmd_args
33
35
  end
36
+
37
+ # Allows for Non-Standard Port usage in ssh commands
38
+ # To set ENV["OOD_SSH_PORT"], add assignment in /etc/ood/config/nginx_stage.yml
39
+ def self.ssh_port
40
+ return ENV["OOD_SSH_PORT"].nil? ? "22" : "#{ENV['OOD_SSH_PORT'].to_i.to_s}"
41
+ end
42
+
34
43
  end
35
44
  end
36
45
  end
@@ -58,7 +58,6 @@ class OodCore::Job::Adapters::LinuxHost::Launcher
58
58
  # @param script [OodCore::Job::Script] The script object defining the work
59
59
  def start_remote_session(script)
60
60
  cmd = ssh_cmd(submit_host(script), ['/usr/bin/env', 'bash'])
61
-
62
61
  session_name = unique_session_name
63
62
  output = call(*cmd, stdin: wrapped_script(script, session_name))
64
63
  hostname = parse_hostname(output)
@@ -122,15 +121,18 @@ class OodCore::Job::Adapters::LinuxHost::Launcher
122
121
  # @param destination_host [#to_s] the destination host you wish to ssh into
123
122
  # @param cmd [Array<#to_s>] the command to be executed on the destination host
124
123
  def ssh_cmd(destination_host, cmd)
124
+
125
125
  if strict_host_checking
126
126
  [
127
127
  'ssh', '-t',
128
+ '-p', OodCore::Job::Adapters::Helper.ssh_port,
128
129
  '-o', 'BatchMode=yes',
129
130
  "#{username}@#{destination_host}"
130
131
  ].concat(cmd)
131
132
  else
132
133
  [
133
134
  'ssh', '-t',
135
+ '-p', OodCore::Job::Adapters::Helper.ssh_port,
134
136
  '-o', 'BatchMode=yes',
135
137
  '-o', 'UserKnownHostsFile=/dev/null',
136
138
  '-o', 'StrictHostKeyChecking=no',
@@ -291,4 +293,5 @@ class OodCore::Job::Adapters::LinuxHost::Launcher
291
293
  line.match(/^(([\w+]|[a-zA-Z0-9][\w*-]*\.))*$/)
292
294
  end.compact.last.to_s
293
295
  end
296
+
294
297
  end
@@ -104,12 +104,14 @@ class OodCore::Job::Adapters::LinuxSystemd::Launcher
104
104
  if strict_host_checking
105
105
  [
106
106
  'ssh', '-t',
107
+ '-p', OodCore::Job::Adapters::Helper.ssh_port,
107
108
  '-o', 'BatchMode=yes',
108
109
  "#{username}@#{destination_host}"
109
110
  ].concat(cmd)
110
111
  else
111
112
  [
112
113
  'ssh', '-t',
114
+ '-p', OodCore::Job::Adapters::Helper.ssh_port,
113
115
  '-o', 'BatchMode=yes',
114
116
  '-o', 'UserKnownHostsFile=/dev/null',
115
117
  '-o', 'StrictHostKeyChecking=no',
@@ -1,4 +1,4 @@
1
1
  module OodCore
2
2
  # The current version of {OodCore}
3
- VERSION = "0.23.2"
3
+ VERSION = "0.23.3"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ood_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.2
4
+ version: 0.23.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Franz
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2023-02-02 00:00:00.000000000 Z
13
+ date: 2023-02-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ood_support