kitchen-kerberos 0.1.0 → 0.2.0

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
  SHA1:
3
- metadata.gz: ba3d1382ab93ae9e222f7cb01aef118eab2eb787
4
- data.tar.gz: 64fd4dc68d46e468d76284649d5d22613d8d8053
3
+ metadata.gz: decad0418db0e603e53187c0e35ea51123c89e67
4
+ data.tar.gz: fc7b3f45e7612474805565d72e463d4d618ff5a0
5
5
  SHA512:
6
- metadata.gz: 7507e03e085253ec3753dde1f887d905bcda04e38c0818bb5899c7c2153c3d0ce2ba7b02d4b3f2e5cd24ced5796ada1afbe7a0034146cf64d90b66a04b478038
7
- data.tar.gz: a56e19515d0abecf4e741f6da3585ba808c46884cc342d437eef350b13ac625a4af968ba26450e559cf63486bb42cf0b67508dc06fff4fd82b25c0fc15a809c2
6
+ metadata.gz: 37ef9eadf3992a7aa8c7ad9a521d44249bcf8c5d85cb4a8c3e60f230aa65f194a5e7befe850547160d3d0d6078461e60996b0b553474d5fe12b98b984198d641
7
+ data.tar.gz: d3b23fee0bad400c2cc478c615bd33e2cfec3640d75be602701fb00f7c15e0b7c793c69009983683d15b8c05a1d4b2562eedcda288a37787cbe6a194f7b2b453
@@ -1,5 +1,5 @@
1
1
  module Kitchen
2
2
  module Kerberos
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -36,34 +36,8 @@ module Kitchen
36
36
  # files.
37
37
  #
38
38
  # @author Fletcher Nichol <fnichol@nichol.ca>
39
- class Kerberos < Kitchen::Transport::Base
40
- kitchen_transport_api_version 1
41
-
42
- plugin_version Kitchen::VERSION
43
-
44
- default_config :port, 22
45
- default_config :username, "root"
46
- default_config :keepalive, true
47
- default_config :keepalive_interval, 60
48
- # needs to be one less than the configured sshd_config MaxSessions
49
- default_config :max_ssh_sessions, 9
50
- default_config :connection_timeout, 15
51
- default_config :connection_retries, 5
52
- default_config :connection_retry_sleep, 1
53
- default_config :max_wait_until_ready, 600
54
-
55
- default_config :ssh_gateway, nil
56
- default_config :ssh_gateway_username, nil
57
-
58
- # compression disabled by default for speed
59
- default_config :compression, false
60
- required_config :compression
61
-
62
- default_config :compression_level do |transport|
63
- transport[:compression] == false ? 0 : 6
64
- end
65
-
66
-
39
+ class Kerberos < Kitchen::Transport::Ssh
40
+
67
41
  private
68
42
 
69
43
  # Builds the hash of options needed by the Connection object on
@@ -92,7 +66,7 @@ module Kitchen
92
66
  max_wait_until_ready: data[:max_wait_until_ready],
93
67
  ssh_gateway: data[:ssh_gateway],
94
68
  ssh_gateway_username: data[:ssh_gateway_username],
95
- auth_methods: %w[gssapi-with-mic]
69
+ auth_methods: %w[gssapi-with-mic]
96
70
  }
97
71
 
98
72
  opts[:forward_agent] = data[:forward_agent] if data.key?(:forward_agent)
@@ -0,0 +1,84 @@
1
+ # encoding: utf-8
2
+ #
3
+ # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
4
+ # Author:: Dominik Richter (<dominik.richter@gmail.com>)
5
+ # Author:: Christoph Hartmann (<chris@lollyrock.com>)
6
+ #
7
+ # Copyright (C) 2014, Fletcher Nichol
8
+ #
9
+ # Licensed under the Apache License, Version 2.0 (the "License");
10
+ # you may not use this file except in compliance with the License.
11
+ # You may obtain a copy of the License at
12
+ #
13
+ # http://www.apache.org/licenses/LICENSE-2.0
14
+ #
15
+ # Unless required by applicable law or agreed to in writing, software
16
+ # distributed under the License is distributed on an "AS IS" BASIS,
17
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+
21
+ require 'net/ssh'
22
+ require 'net/scp'
23
+ require 'train/errors'
24
+ require 'train/transports/ssh'
25
+ require 'net/ssh/kerberos'
26
+ module Train::Transports
27
+ # Wrapped exception for any internally raised SSH-related errors.
28
+ #
29
+ # @author Fletcher Nichol <fnichol@nichol.ca>
30
+ class SSHFailed < Train::TransportError; end
31
+ class SSHPTYFailed < Train::TransportError; end
32
+
33
+ # A Transport which uses the SSH protocol to execute commands and transfer
34
+ # files while using gssapi-with-mic authentication
35
+ #
36
+ # @author Fletcher Nichol <fnichol@nichol.ca>
37
+ class Kerberos < Train::Transports::Ssh
38
+ name 'kerberos'
39
+
40
+ private
41
+
42
+ def validate_options(options)
43
+ super(options)
44
+ if options[:pty]
45
+ logger.warn('[SSH] PTY requested: stderr will be merged into stdout')
46
+ end
47
+
48
+ super
49
+ self
50
+ end
51
+
52
+ # Builds the hash of options needed by the Connection object on
53
+ # construction.
54
+ #
55
+ # @param opts [Hash] merged configuration and mutable state data
56
+ # @return [Hash] hash of connection options
57
+ # @api private
58
+ def connection_options(opts)
59
+ {
60
+ logger: logger,
61
+ user_known_hosts_file: '/dev/null',
62
+ paranoid: false,
63
+ hostname: opts[:host],
64
+ port: opts[:port],
65
+ username: opts[:user],
66
+ compression: opts[:compression],
67
+ compression_level: opts[:compression_level],
68
+ keepalive: opts[:keepalive],
69
+ keepalive_interval: opts[:keepalive_interval],
70
+ timeout: opts[:connection_timeout],
71
+ connection_retries: opts[:connection_retries],
72
+ connection_retry_sleep: opts[:connection_retry_sleep],
73
+ max_wait_until_ready: opts[:max_wait_until_ready],
74
+ auth_methods: %w[gssapi-with-mic],
75
+ keys_only: false,
76
+ keys: opts[:key_files],
77
+ password: opts[:password],
78
+ forward_agent: opts[:forward_agent],
79
+ transport_options: opts,
80
+ }
81
+ end
82
+
83
+ end
84
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-kerberos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Osman
@@ -83,6 +83,7 @@ files:
83
83
  - kitchen-kerberos.gemspec
84
84
  - lib/kitchen/kerberos/version.rb
85
85
  - lib/kitchen/transport/kerberos.rb
86
+ - lib/train/transports/kerberos.rb
86
87
  homepage: https://github.com/nwops/kitchen-kerberos
87
88
  licenses:
88
89
  - MIT