net-sftp 4.0.0 → 4.1.1
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
- checksums.yaml.gz.sig +0 -0
- data/CHANGES.txt +52 -0
- data/README.rdoc +3 -0
- data/lib/net/sftp/operations/dir.rb +5 -4
- data/lib/net/sftp/operations/download.rb +265 -34
- data/lib/net/sftp/operations/file.rb +60 -26
- data/lib/net/sftp/operations/upload.rb +152 -28
- data/lib/net/sftp/protocol/01/attributes.rb +6 -2
- data/lib/net/sftp/protocol/01/base.rb +2 -1
- data/lib/net/sftp/protocol/01/name.rb +1 -1
- data/lib/net/sftp/protocol/03/base.rb +11 -1
- data/lib/net/sftp/protocol/04/attributes.rb +12 -2
- data/lib/net/sftp/protocol/04/base.rb +2 -1
- data/lib/net/sftp/protocol/04/name.rb +23 -14
- data/lib/net/sftp/protocol/05/base.rb +9 -6
- data/lib/net/sftp/protocol/base.rb +10 -2
- data/lib/net/sftp/protocol/bounded_read.rb +25 -0
- data/lib/net/sftp/session.rb +21 -3
- data/lib/net/sftp/version.rb +2 -2
- data/lib/net/sftp.rb +16 -10
- data.tar.gz.sig +2 -1
- metadata +30 -36
- metadata.gz.sig +2 -4
- data/.github/workflows/ci.yml +0 -35
- data/.gitignore +0 -6
- data/Gemfile +0 -15
- data/Manifest +0 -55
- data/Rakefile +0 -53
- data/net-sftp-public_cert.pem +0 -20
- data/net-sftp.gemspec +0 -48
- data/setup.rb +0 -1331
|
@@ -35,25 +35,28 @@ module Net; module SFTP; module Protocol; module V05
|
|
|
35
35
|
def open(path, flags, options)
|
|
36
36
|
flags = normalize_open_flags(flags)
|
|
37
37
|
|
|
38
|
-
sftp_flags
|
|
39
|
-
open = if flags & (IO::CREAT | IO::EXCL) == (IO::CREAT | IO::EXCL)
|
|
38
|
+
sftp_flags = if flags & (IO::CREAT | IO::EXCL) == (IO::CREAT | IO::EXCL)
|
|
40
39
|
FV5::CREATE_NEW
|
|
41
40
|
elsif flags & (IO::CREAT | IO::TRUNC) == (IO::CREAT | IO::TRUNC)
|
|
42
41
|
FV5::CREATE_TRUNCATE
|
|
43
42
|
elsif flags & IO::CREAT == IO::CREAT
|
|
44
43
|
FV5::OPEN_OR_CREATE
|
|
44
|
+
elsif flags & IO::TRUNC == IO::TRUNC
|
|
45
|
+
FV5::TRUNCATE_EXISTING
|
|
45
46
|
else
|
|
46
47
|
FV5::OPEN_EXISTING
|
|
47
48
|
end
|
|
49
|
+
|
|
50
|
+
desired_access = if flags & (IO::WRONLY | IO::RDWR) != 0
|
|
48
51
|
access = ACE::Mask::WRITE_DATA | ACE::Mask::WRITE_ATTRIBUTES
|
|
49
52
|
access |= ACE::Mask::READ_DATA | ACE::Mask::READ_ATTRIBUTES if (flags & IO::RDWR) == IO::RDWR
|
|
50
53
|
if flags & IO::APPEND == IO::APPEND
|
|
51
|
-
|
|
54
|
+
sftp_flags |= FV5::APPEND_DATA
|
|
52
55
|
access |= ACE::Mask::APPEND_DATA
|
|
53
56
|
end
|
|
54
|
-
|
|
57
|
+
access
|
|
55
58
|
else
|
|
56
|
-
|
|
59
|
+
ACE::Mask::READ_DATA | ACE::Mask::READ_ATTRIBUTES
|
|
57
60
|
end
|
|
58
61
|
|
|
59
62
|
attributes = attribute_factory.new(options)
|
|
@@ -63,4 +66,4 @@ module Net; module SFTP; module Protocol; module V05
|
|
|
63
66
|
|
|
64
67
|
end
|
|
65
68
|
|
|
66
|
-
end; end; end; end
|
|
69
|
+
end; end; end; end
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require 'net/ssh/loggable'
|
|
2
2
|
require 'net/sftp/constants'
|
|
3
|
+
require 'net/sftp/protocol/bounded_read'
|
|
3
4
|
|
|
4
5
|
module Net; module SFTP; module Protocol
|
|
5
6
|
|
|
@@ -10,6 +11,7 @@ module Net; module SFTP; module Protocol
|
|
|
10
11
|
include Net::SSH::Loggable
|
|
11
12
|
include Net::SFTP::Constants
|
|
12
13
|
include Net::SFTP::Constants::PacketTypes
|
|
14
|
+
include Net::SFTP::Protocol::BoundedRead
|
|
13
15
|
|
|
14
16
|
# The SFTP session object that acts as client to this protocol instance
|
|
15
17
|
attr_reader :session
|
|
@@ -19,6 +21,7 @@ module Net; module SFTP; module Protocol
|
|
|
19
21
|
@session = session
|
|
20
22
|
self.logger = session.logger
|
|
21
23
|
@request_id_counter = -1
|
|
24
|
+
@request_ids_wrapped = false
|
|
22
25
|
end
|
|
23
26
|
|
|
24
27
|
# Attept to parse the given packet. If the packet is of an unsupported
|
|
@@ -41,10 +44,15 @@ module Net; module SFTP; module Protocol
|
|
|
41
44
|
# A new request identifier will be allocated to this request, and will
|
|
42
45
|
# be returned.
|
|
43
46
|
def send_request(type, *args)
|
|
44
|
-
|
|
47
|
+
begin
|
|
48
|
+
previous_request_id = @request_id_counter
|
|
49
|
+
@request_id_counter = (@request_id_counter + 1) & 0xffffffff
|
|
50
|
+
@request_ids_wrapped = true if previous_request_id == 0xffffffff
|
|
51
|
+
end while @request_ids_wrapped && session.pending_requests.key?(@request_id_counter)
|
|
52
|
+
|
|
45
53
|
session.send_packet(type, :long, @request_id_counter, *args)
|
|
46
54
|
return @request_id_counter
|
|
47
55
|
end
|
|
48
56
|
end
|
|
49
57
|
|
|
50
|
-
end; end; end
|
|
58
|
+
end; end; end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
require 'net/sftp/errors'
|
|
2
|
+
|
|
3
|
+
module Net; module SFTP; module Protocol
|
|
4
|
+
|
|
5
|
+
# Several SFTP structures are a 32-bit item count followed by that many
|
|
6
|
+
# items. Net::SSH::Buffer returns nil instead of raising when a read runs
|
|
7
|
+
# past the end of the data, so a loop over an unchecked count from the
|
|
8
|
+
# server keeps allocating long after the packet is exhausted.
|
|
9
|
+
module BoundedRead
|
|
10
|
+
# Reads an item count from +buffer+ and raises Net::SFTP::Exception if it
|
|
11
|
+
# is missing, or larger than the remaining bytes could hold given that
|
|
12
|
+
# each item takes at least +min_item_size+ bytes.
|
|
13
|
+
def read_bounded_count!(buffer, min_item_size, what)
|
|
14
|
+
count = buffer.read_long
|
|
15
|
+
raise Net::SFTP::Exception, "truncated packet: missing #{what} count" if count.nil?
|
|
16
|
+
|
|
17
|
+
if count > buffer.available / min_item_size
|
|
18
|
+
raise Net::SFTP::Exception, "server sent #{count} #{what} entries in only #{buffer.available} bytes"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
count
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end; end; end
|
data/lib/net/sftp/session.rb
CHANGED
|
@@ -68,6 +68,10 @@ module Net; module SFTP
|
|
|
68
68
|
# the server has not yet responded to will be represented here.
|
|
69
69
|
attr_reader :pending_requests
|
|
70
70
|
|
|
71
|
+
# The extensions the server advertised in its FXP_VERSION packet, as a
|
|
72
|
+
# hash of name => data (e.g. "posix-rename@openssh.com" => "1").
|
|
73
|
+
attr_reader :extensions
|
|
74
|
+
|
|
71
75
|
# Creates a new Net::SFTP instance atop the given Net::SSH connection.
|
|
72
76
|
# This will return immediately, before the SFTP connection has been properly
|
|
73
77
|
# initialized. Once the connection is ready, the given block will be called.
|
|
@@ -81,6 +85,7 @@ module Net; module SFTP
|
|
|
81
85
|
@input = Net::SSH::Buffer.new
|
|
82
86
|
self.logger = session.logger
|
|
83
87
|
@state = :closed
|
|
88
|
+
@extensions = {}
|
|
84
89
|
@pending_requests = {}
|
|
85
90
|
|
|
86
91
|
connect(&block)
|
|
@@ -269,6 +274,10 @@ module Net; module SFTP
|
|
|
269
274
|
# Request object. If a block is given, it will be invoked when the
|
|
270
275
|
# server responds.
|
|
271
276
|
#
|
|
277
|
+
# +data+ is sent as a single request, so it must stay within the
|
|
278
|
+
# server's packet limit (OpenSSH drops the connection on packets over
|
|
279
|
+
# 256 KiB). Net::SFTP::Operations::File#write splits large data for you.
|
|
280
|
+
#
|
|
272
281
|
# request = sftp.write(handle, 0, "hello, world!\n")
|
|
273
282
|
# request.wait
|
|
274
283
|
def write(handle, offset, data, &callback)
|
|
@@ -772,6 +781,7 @@ module Net; module SFTP
|
|
|
772
781
|
when :closed
|
|
773
782
|
@state = :opening
|
|
774
783
|
@channel = session.open_channel(&method(:when_channel_confirmed))
|
|
784
|
+
@input = Net::SSH::Buffer.new
|
|
775
785
|
@packet_length = nil
|
|
776
786
|
@protocol = nil
|
|
777
787
|
@on_ready = Array(block)
|
|
@@ -919,19 +929,27 @@ module Net; module SFTP
|
|
|
919
929
|
# version negotiation, instantiating the appropriate Protocol instance
|
|
920
930
|
# and invoking the callback given to #connect, if any.
|
|
921
931
|
def do_version(packet)
|
|
932
|
+
# Negotiation happens once. A later FXP_VERSION would swap the protocol
|
|
933
|
+
# driver and drop every pending request.
|
|
934
|
+
unless state == :init
|
|
935
|
+
raise Net::SFTP::Exception, "unexpected FXP_VERSION packet while session is #{state}"
|
|
936
|
+
end
|
|
937
|
+
|
|
922
938
|
debug { "negotiating sftp protocol version, mine is #{HIGHEST_PROTOCOL_VERSION_SUPPORTED}" }
|
|
923
939
|
|
|
924
940
|
server_version = packet.read_long
|
|
925
941
|
debug { "server reports sftp version #{server_version}" }
|
|
926
942
|
|
|
927
|
-
|
|
943
|
+
# Servers reply with their own version whatever we offered (OpenSSH
|
|
944
|
+
# always says 3), so cap at the version we offered as well.
|
|
945
|
+
negotiated_version = [server_version, @version, HIGHEST_PROTOCOL_VERSION_SUPPORTED].compact.min
|
|
928
946
|
info { "negotiated version is #{negotiated_version}" }
|
|
929
947
|
|
|
930
|
-
extensions = {}
|
|
948
|
+
@extensions = {}
|
|
931
949
|
until packet.eof?
|
|
932
950
|
name = packet.read_string
|
|
933
951
|
data = packet.read_string
|
|
934
|
-
extensions[name] = data
|
|
952
|
+
@extensions[name] = data
|
|
935
953
|
end
|
|
936
954
|
|
|
937
955
|
@protocol = Protocol.load(self, negotiated_version)
|
data/lib/net/sftp/version.rb
CHANGED
|
@@ -49,10 +49,10 @@ module Net
|
|
|
49
49
|
MAJOR = 4
|
|
50
50
|
|
|
51
51
|
# The minor component of this version of the Net::SFTP library
|
|
52
|
-
MINOR =
|
|
52
|
+
MINOR = 1
|
|
53
53
|
|
|
54
54
|
# The tiny component of this version of the Net::SFTP library
|
|
55
|
-
TINY =
|
|
55
|
+
TINY = 1
|
|
56
56
|
|
|
57
57
|
# The prerelease component of this version of the Net::SFTP library
|
|
58
58
|
# nil allowed
|
data/lib/net/sftp.rb
CHANGED
|
@@ -34,18 +34,24 @@ module Net
|
|
|
34
34
|
# set the SFTP protocol version to be used)
|
|
35
35
|
def self.start(host, user, ssh_options={}, sftp_options={}, &block)
|
|
36
36
|
session = Net::SSH.start(host, user, ssh_options)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
begin
|
|
38
|
+
# We only use a single option here, but this leaves room for more later
|
|
39
|
+
# without breaking the external API.
|
|
40
|
+
version = sftp_options.fetch(:version, nil)
|
|
41
|
+
sftp = Net::SFTP::Session.new(session, version, &block).connect!
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
end
|
|
43
|
+
if block_given?
|
|
44
|
+
sftp.loop
|
|
45
|
+
return nil
|
|
46
|
+
end
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
sftp
|
|
49
|
+
rescue Object
|
|
50
|
+
failed = true
|
|
51
|
+
raise
|
|
52
|
+
ensure
|
|
53
|
+
session.close if block_given? && !failed
|
|
54
|
+
end
|
|
49
55
|
rescue Object => anything
|
|
50
56
|
begin
|
|
51
57
|
session.shutdown!
|
data.tar.gz.sig
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
�_�<.}U�h�y��xx��[�v]
|
|
2
|
+
���G�3�B�E[e��g����_�L���cJ��� M������)�ׅ�����~��uY2�pI����G���8*�k,�up��~��,t�K9q��(6���W��
|
metadata
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: net-sftp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jamis Buck
|
|
8
8
|
- Delano Mandelbaum
|
|
9
9
|
- Miklós Fazekas
|
|
10
|
-
autorequire:
|
|
11
|
-
bindir:
|
|
10
|
+
autorequire:
|
|
11
|
+
bindir: bin
|
|
12
12
|
cert_chain:
|
|
13
13
|
- |
|
|
14
14
|
-----BEGIN CERTIFICATE-----
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQsFADBBMQ8wDQYDVQQDDAZuZXRz
|
|
16
|
+
c2gxGTAXBgoJkiaJk/IsZAEZFglzb2x1dGlvdXMxEzARBgoJkiaJk/IsZAEZFgNj
|
|
17
|
+
b20wHhcNMjYxMDIyMDk1NDI1WhcNMjcxMDIyMDk1NDI1WjBBMQ8wDQYDVQQDDAZu
|
|
18
|
+
ZXRzc2gxGTAXBgoJkiaJk/IsZAEZFglzb2x1dGlvdXMxEzARBgoJkiaJk/IsZAEZ
|
|
19
|
+
FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGJ4TbZ9H+qZ08
|
|
20
|
+
pQfJhPJTHaDCyQvCsKTFrL5O9z3tllQ7B/zksMMM+qFBpNYu9HCcg4yBATacE/PB
|
|
21
|
+
qVVyUrpr6lbH/XwoN5ljXm+bdCfmnjZvTCL2FTE6o+bcnaF0IsJyC0Q2B1fbWdXN
|
|
22
|
+
6Off1ZWoUk6We2BIM1bn6QJLxBpGyYhvOPXsYoqSuzDf2SJDDsWFZ8kV5ON13Ohm
|
|
23
|
+
JbBzn0oD8HF8FuYOewwsC0C1q4w7E5GtvHcQ5juweS7+RKsyDcVcVrLuNzoGRttS
|
|
24
|
+
KP4yMn+TzaXijyjRg7gECfJr3TGASaA4bQsILFGG5dAWcwO4OMrZedR7SHj/o0Kf
|
|
25
|
+
3gL7P0axAgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
|
26
|
+
BBQF8qLA7Z4zg0SJGtUbv3eoQ8tjIzAfBgNVHREEGDAWgRRuZXRzc2hAc29sdXRp
|
|
27
|
+
b3VzLmNvbTAfBgNVHRIEGDAWgRRuZXRzc2hAc29sdXRpb3VzLmNvbTANBgkqhkiG
|
|
28
|
+
9w0BAQsFAAOCAQEAbVrRpiCFmHDMLNU+SCjpg43snWYksQOtejPPTEMdOc9cCmmv
|
|
29
|
+
ctJbaPIySLUgzwFbQDZStDPbLJmIujh0fm5dHp/sDJpvPZ3Mm3FfzWQMJqzBx4uk
|
|
30
|
+
OMx00yJK8VeFrwUViE3zO5raWvw85dUybp25pgaKGW4AA5mJ/2UHqYLc4lefKFKK
|
|
31
|
+
9xFsyYSciMEKyAsUNSNTJzPKUo2vn7TNF/pS0ZL+h8Qkr0A0F0ncfj7uM1kOWjO0
|
|
32
|
+
mMdUtmMoVbjbik3hqkY/18G03c3PoFNpL38VLKuyyROYz1DaCqOaRju3sbOoirD+
|
|
33
|
+
piQTZDCWxeKuX0Iuxq02uxkYHfoGB6In0y3OOQ==
|
|
33
34
|
-----END CERTIFICATE-----
|
|
34
|
-
date:
|
|
35
|
+
date: 2026-10-29 00:00:00.000000000 Z
|
|
35
36
|
dependencies:
|
|
36
37
|
- !ruby/object:Gem::Dependency
|
|
37
38
|
name: net-ssh
|
|
@@ -42,7 +43,7 @@ dependencies:
|
|
|
42
43
|
version: 5.0.0
|
|
43
44
|
- - "<"
|
|
44
45
|
- !ruby/object:Gem::Version
|
|
45
|
-
version:
|
|
46
|
+
version: 9.0.0
|
|
46
47
|
type: :runtime
|
|
47
48
|
prerelease: false
|
|
48
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -52,7 +53,7 @@ dependencies:
|
|
|
52
53
|
version: 5.0.0
|
|
53
54
|
- - "<"
|
|
54
55
|
- !ruby/object:Gem::Version
|
|
55
|
-
version:
|
|
56
|
+
version: 9.0.0
|
|
56
57
|
- !ruby/object:Gem::Dependency
|
|
57
58
|
name: minitest
|
|
58
59
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -90,14 +91,9 @@ extra_rdoc_files:
|
|
|
90
91
|
- LICENSE.txt
|
|
91
92
|
- README.rdoc
|
|
92
93
|
files:
|
|
93
|
-
- ".github/workflows/ci.yml"
|
|
94
|
-
- ".gitignore"
|
|
95
94
|
- CHANGES.txt
|
|
96
|
-
- Gemfile
|
|
97
95
|
- LICENSE.txt
|
|
98
|
-
- Manifest
|
|
99
96
|
- README.rdoc
|
|
100
|
-
- Rakefile
|
|
101
97
|
- lib/net/sftp.rb
|
|
102
98
|
- lib/net/sftp/constants.rb
|
|
103
99
|
- lib/net/sftp/errors.rb
|
|
@@ -120,18 +116,16 @@ files:
|
|
|
120
116
|
- lib/net/sftp/protocol/06/attributes.rb
|
|
121
117
|
- lib/net/sftp/protocol/06/base.rb
|
|
122
118
|
- lib/net/sftp/protocol/base.rb
|
|
119
|
+
- lib/net/sftp/protocol/bounded_read.rb
|
|
123
120
|
- lib/net/sftp/request.rb
|
|
124
121
|
- lib/net/sftp/response.rb
|
|
125
122
|
- lib/net/sftp/session.rb
|
|
126
123
|
- lib/net/sftp/version.rb
|
|
127
|
-
- net-sftp-public_cert.pem
|
|
128
|
-
- net-sftp.gemspec
|
|
129
|
-
- setup.rb
|
|
130
124
|
homepage: https://github.com/net-ssh/net-sftp
|
|
131
125
|
licenses:
|
|
132
126
|
- MIT
|
|
133
127
|
metadata: {}
|
|
134
|
-
post_install_message:
|
|
128
|
+
post_install_message:
|
|
135
129
|
rdoc_options: []
|
|
136
130
|
require_paths:
|
|
137
131
|
- lib
|
|
@@ -139,15 +133,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
139
133
|
requirements:
|
|
140
134
|
- - ">="
|
|
141
135
|
- !ruby/object:Gem::Version
|
|
142
|
-
version: '
|
|
136
|
+
version: '2.6'
|
|
143
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
138
|
requirements:
|
|
145
139
|
- - ">="
|
|
146
140
|
- !ruby/object:Gem::Version
|
|
147
141
|
version: '0'
|
|
148
142
|
requirements: []
|
|
149
|
-
rubygems_version: 3.
|
|
150
|
-
signing_key:
|
|
143
|
+
rubygems_version: 3.3.3
|
|
144
|
+
signing_key:
|
|
151
145
|
specification_version: 3
|
|
152
146
|
summary: A pure Ruby implementation of the SFTP client protocol.
|
|
153
147
|
test_files: []
|
metadata.gz.sig
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
쾷!�#���]l0� �ճo`���ג� �L�$�`�0�T5��ރS����(u�!�M�g-��a�"ױ!=mj���U,��
|
|
4
|
-
�_�VK�V,���R2nM�E~j�������(��
|
|
1
|
+
I�rWi��<��7����1��j�T+��N�2ˬ�pw����ڐ�O����a�EW�5��(�}����tzg�{������*;�[2F�9�M ��0o�'��$�,oO;���4Ru�w,�����$�]��B&�C�v��\$�Äx�
|
|
2
|
+
�M����1��SX��5��bQ�����
|
data/.github/workflows/ci.yml
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
on: [push, pull_request]
|
|
3
|
-
jobs:
|
|
4
|
-
test:
|
|
5
|
-
runs-on: ubuntu-18.04
|
|
6
|
-
continue-on-error: ${{ matrix.flaky }}
|
|
7
|
-
strategy:
|
|
8
|
-
matrix:
|
|
9
|
-
ruby-version: ["2.5", "2.6", "2.7", "3.0", "3.1", "truffleruby-22", "truffleruby-21"]
|
|
10
|
-
flaky: [false]
|
|
11
|
-
include:
|
|
12
|
-
- ruby-version: "ruby-head"
|
|
13
|
-
flaky: true
|
|
14
|
-
- ruby-version: "jruby-9.2"
|
|
15
|
-
flaky: true
|
|
16
|
-
- ruby-version: "jruby-9.3"
|
|
17
|
-
flaky: true
|
|
18
|
-
- ruby-version: "jruby-head"
|
|
19
|
-
flaky: true
|
|
20
|
-
- ruby-version: "truffleruby-head"
|
|
21
|
-
flaky: true
|
|
22
|
-
steps:
|
|
23
|
-
- uses: actions/checkout@v1
|
|
24
|
-
|
|
25
|
-
- name: Set up Ruby ${{ matrix.ruby-version }}
|
|
26
|
-
uses: ruby/setup-ruby@v1
|
|
27
|
-
with:
|
|
28
|
-
ruby-version: ${{ matrix.ruby-version }}
|
|
29
|
-
|
|
30
|
-
- name: Bundle install
|
|
31
|
-
run: |
|
|
32
|
-
gem install bundler
|
|
33
|
-
bundle install
|
|
34
|
-
- name: Run Tests
|
|
35
|
-
run: bundle exec rake test
|
data/.gitignore
DELETED
data/Gemfile
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
# Specify your gem's dependencies in mygem.gemspec
|
|
4
|
-
gemspec
|
|
5
|
-
|
|
6
|
-
# TODO: add to gemspec
|
|
7
|
-
gem "bundler", "~> 2.1"
|
|
8
|
-
gem "rake", "~> 12.0"
|
|
9
|
-
|
|
10
|
-
gem 'byebug', group: %i[development test] if !Gem.win_platform? && RUBY_ENGINE == "ruby"
|
|
11
|
-
|
|
12
|
-
if ENV["CI"]
|
|
13
|
-
gem 'codecov', require: false, group: :test
|
|
14
|
-
gem 'simplecov', require: false, group: :test
|
|
15
|
-
end
|
data/Manifest
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
CHANGELOG.rdoc
|
|
2
|
-
lib/net/sftp/constants.rb
|
|
3
|
-
lib/net/sftp/errors.rb
|
|
4
|
-
lib/net/sftp/operations/dir.rb
|
|
5
|
-
lib/net/sftp/operations/download.rb
|
|
6
|
-
lib/net/sftp/operations/file.rb
|
|
7
|
-
lib/net/sftp/operations/file_factory.rb
|
|
8
|
-
lib/net/sftp/operations/upload.rb
|
|
9
|
-
lib/net/sftp/packet.rb
|
|
10
|
-
lib/net/sftp/protocol/01/attributes.rb
|
|
11
|
-
lib/net/sftp/protocol/01/base.rb
|
|
12
|
-
lib/net/sftp/protocol/01/name.rb
|
|
13
|
-
lib/net/sftp/protocol/02/base.rb
|
|
14
|
-
lib/net/sftp/protocol/03/base.rb
|
|
15
|
-
lib/net/sftp/protocol/04/attributes.rb
|
|
16
|
-
lib/net/sftp/protocol/04/base.rb
|
|
17
|
-
lib/net/sftp/protocol/04/name.rb
|
|
18
|
-
lib/net/sftp/protocol/05/base.rb
|
|
19
|
-
lib/net/sftp/protocol/06/attributes.rb
|
|
20
|
-
lib/net/sftp/protocol/06/base.rb
|
|
21
|
-
lib/net/sftp/protocol/base.rb
|
|
22
|
-
lib/net/sftp/protocol.rb
|
|
23
|
-
lib/net/sftp/request.rb
|
|
24
|
-
lib/net/sftp/response.rb
|
|
25
|
-
lib/net/sftp/session.rb
|
|
26
|
-
lib/net/sftp/version.rb
|
|
27
|
-
lib/net/sftp.rb
|
|
28
|
-
Rakefile
|
|
29
|
-
README.rdoc
|
|
30
|
-
setup.rb
|
|
31
|
-
test/common.rb
|
|
32
|
-
test/protocol/01/test_attributes.rb
|
|
33
|
-
test/protocol/01/test_base.rb
|
|
34
|
-
test/protocol/01/test_name.rb
|
|
35
|
-
test/protocol/02/test_base.rb
|
|
36
|
-
test/protocol/03/test_base.rb
|
|
37
|
-
test/protocol/04/test_attributes.rb
|
|
38
|
-
test/protocol/04/test_base.rb
|
|
39
|
-
test/protocol/04/test_name.rb
|
|
40
|
-
test/protocol/05/test_base.rb
|
|
41
|
-
test/protocol/06/test_attributes.rb
|
|
42
|
-
test/protocol/06/test_base.rb
|
|
43
|
-
test/protocol/test_base.rb
|
|
44
|
-
test/test_all.rb
|
|
45
|
-
test/test_dir.rb
|
|
46
|
-
test/test_download.rb
|
|
47
|
-
test/test_file.rb
|
|
48
|
-
test/test_file_factory.rb
|
|
49
|
-
test/test_packet.rb
|
|
50
|
-
test/test_protocol.rb
|
|
51
|
-
test/test_request.rb
|
|
52
|
-
test/test_response.rb
|
|
53
|
-
test/test_session.rb
|
|
54
|
-
test/test_upload.rb
|
|
55
|
-
Manifest
|
data/Rakefile
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
require "rubygems"
|
|
2
|
-
require "rake"
|
|
3
|
-
require "rake/clean"
|
|
4
|
-
require "rdoc/task"
|
|
5
|
-
require "bundler/gem_tasks"
|
|
6
|
-
|
|
7
|
-
desc "When releasing make sure NET_SSH_BUILDGEM_SIGNED is set"
|
|
8
|
-
task :check_NET_SSH_BUILDGEM_SIGNED do
|
|
9
|
-
raise "NET_SSH_BUILDGEM_SIGNED should be set to release" unless ENV['NET_SSH_BUILDGEM_SIGNED']
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
Rake::Task[:release].enhance [:check_NET_SSH_BUILDGEM_SIGNED]
|
|
13
|
-
Rake::Task[:release].prerequisites.unshift(:check_NET_SSH_BUILDGEM_SIGNED)
|
|
14
|
-
|
|
15
|
-
task :default => ["build"]
|
|
16
|
-
CLEAN.include [ 'pkg', 'rdoc' ]
|
|
17
|
-
name = "net-sftp"
|
|
18
|
-
|
|
19
|
-
require_relative "lib/net/sftp/version"
|
|
20
|
-
version = Net::SFTP::Version::CURRENT
|
|
21
|
-
|
|
22
|
-
namespace :cert do
|
|
23
|
-
desc "Update public cert from private - only run if public is expired"
|
|
24
|
-
task :update_public_when_expired do
|
|
25
|
-
require 'openssl'
|
|
26
|
-
require 'time'
|
|
27
|
-
raw = File.read "net-sftp-public_cert.pem"
|
|
28
|
-
certificate = OpenSSL::X509::Certificate.new raw
|
|
29
|
-
raise Exception, "Not yet expired: #{certificate.not_after}" unless certificate.not_after < Time.now
|
|
30
|
-
sh "gem cert --build netssh@solutious.com --days 365*5 --private-key /mnt/gem/net-ssh-private_key.pem"
|
|
31
|
-
sh "mv gem-public_cert.pem net-sftp-public_cert.pem"
|
|
32
|
-
sh "gem cert --add net-sftp-public_cert.pem"
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
require 'rake/testtask'
|
|
37
|
-
Rake::TestTask.new do |t|
|
|
38
|
-
t.libs = ["lib", "test"]
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
extra_files = %w[LICENSE.txt THANKS.txt CHANGES.txt ]
|
|
42
|
-
RDoc::Task.new do |rdoc|
|
|
43
|
-
rdoc.rdoc_dir = "rdoc"
|
|
44
|
-
rdoc.title = "#{name} #{version}"
|
|
45
|
-
rdoc.generator = 'hanna' # gem install hanna-nouveau
|
|
46
|
-
rdoc.main = 'README.rdoc'
|
|
47
|
-
rdoc.rdoc_files.include("README*")
|
|
48
|
-
rdoc.rdoc_files.include("bin/*.rb")
|
|
49
|
-
rdoc.rdoc_files.include("lib/**/*.rb")
|
|
50
|
-
extra_files.each { |file|
|
|
51
|
-
rdoc.rdoc_files.include(file) if File.exist?(file)
|
|
52
|
-
}
|
|
53
|
-
end
|
data/net-sftp-public_cert.pem
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
|
2
|
-
MIIDQDCCAiigAwIBAgIBATANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpuZXRz
|
|
3
|
-
c2gvREM9c29sdXRpb3VzL0RDPWNvbTAeFw0yMjA5MjIxMTUwMDJaFw0yMzA5MjIx
|
|
4
|
-
MTUwMDJaMCUxIzAhBgNVBAMMGm5ldHNzaC9EQz1zb2x1dGlvdXMvREM9Y29tMIIB
|
|
5
|
-
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxieE22fR/qmdPKUHyYTyUx2g
|
|
6
|
-
wskLwrCkxay+Tvc97ZZUOwf85LDDDPqhQaTWLvRwnIOMgQE2nBPzwalVclK6a+pW
|
|
7
|
-
x/18KDeZY15vm3Qn5p42b0wi9hUxOqPm3J2hdCLCcgtENgdX21nVzejn39WVqFJO
|
|
8
|
-
lntgSDNW5+kCS8QaRsmIbzj17GKKkrsw39kiQw7FhWfJFeTjddzoZiWwc59KA/Bx
|
|
9
|
-
fBbmDnsMLAtAtauMOxORrbx3EOY7sHku/kSrMg3FXFay7jc6BkbbUij+MjJ/k82l
|
|
10
|
-
4o8o0YO4BAnya90xgEmgOG0LCCxRhuXQFnMDuDjK2XnUe0h4/6NCn94C+z9GsQID
|
|
11
|
-
AQABo3sweTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUBfKiwO2e
|
|
12
|
-
M4NEiRrVG793qEPLYyMwHwYDVR0RBBgwFoEUbmV0c3NoQHNvbHV0aW91cy5jb20w
|
|
13
|
-
HwYDVR0SBBgwFoEUbmV0c3NoQHNvbHV0aW91cy5jb20wDQYJKoZIhvcNAQELBQAD
|
|
14
|
-
ggEBABI2ORK5kzUL7uOF0EHI4ECMWxQMiN+pURyGp9u7DU0H8eSdZN52jbUGHzSB
|
|
15
|
-
j7bB6GpqElEWjOe0IbH3vR52IVXq2bOF4P4vFchGAb4OuzJD8aJmrC/SPLHbWBuV
|
|
16
|
-
2GpbRQRJyYPWN6Rt/4EHOxoFnhXOBEB6CGIy0dt7YezycVbzqtHoiI2Qf/bIFJQZ
|
|
17
|
-
mpJAAUBkRiWksE7zrsE5DGK8kL2GVos7f8kdM71zT8p7VBwkMdY277T29TG2xD0D
|
|
18
|
-
66Oev0C3/x89NXqCHkl1JElSzEFbOoxan16z7xNEf2MKcBKGhsYfzWVNyEtJm785
|
|
19
|
-
g+97rn/AuO6dcxJnW2qBGYQa7pQ=
|
|
20
|
-
-----END CERTIFICATE-----
|
data/net-sftp.gemspec
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
require_relative 'lib/net/sftp/version'
|
|
2
|
-
|
|
3
|
-
Gem::Specification.new do |spec|
|
|
4
|
-
spec.name = "net-sftp"
|
|
5
|
-
spec.version = Net::SFTP::Version::STRING
|
|
6
|
-
spec.authors = ["Jamis Buck", "Delano Mandelbaum", "Mikl\u{f3}s Fazekas"]
|
|
7
|
-
spec.email = ["net-ssh@solutious.com"]
|
|
8
|
-
|
|
9
|
-
if ENV['NET_SSH_BUILDGEM_SIGNED']
|
|
10
|
-
spec.cert_chain = ["net-sftp-public_cert.pem"]
|
|
11
|
-
spec.signing_key = "/mnt/gem/net-ssh-private_key.pem"
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
spec.summary = %q{A pure Ruby implementation of the SFTP client protocol.}
|
|
15
|
-
spec.description = %q{A pure Ruby implementation of the SFTP client protocol}
|
|
16
|
-
spec.homepage = "https://github.com/net-ssh/net-sftp"
|
|
17
|
-
spec.license = "MIT"
|
|
18
|
-
spec.required_rubygems_version = Gem::Requirement.new(">= 0") if spec.respond_to? :required_rubygems_version=
|
|
19
|
-
|
|
20
|
-
spec.extra_rdoc_files = [
|
|
21
|
-
"LICENSE.txt",
|
|
22
|
-
"README.rdoc"
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
26
|
-
spec.bindir = "exe"
|
|
27
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
28
|
-
spec.require_paths = ["lib"]
|
|
29
|
-
|
|
30
|
-
if spec.respond_to? :specification_version then
|
|
31
|
-
spec.specification_version = 3
|
|
32
|
-
|
|
33
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
34
|
-
spec.add_runtime_dependency(%q<net-ssh>, [">= 5.0.0", "< 8.0.0"])
|
|
35
|
-
spec.add_development_dependency(%q<minitest>, [">= 5"])
|
|
36
|
-
spec.add_development_dependency(%q<mocha>, [">= 0"])
|
|
37
|
-
else
|
|
38
|
-
spec.add_dependency(%q<net-ssh>, [">= 5.0.0", "< 8.0.0"])
|
|
39
|
-
spec.add_dependency(%q<minitest>, [">= 5"])
|
|
40
|
-
spec.add_dependency(%q<mocha>, [">= 0"])
|
|
41
|
-
end
|
|
42
|
-
else
|
|
43
|
-
spec.add_dependency(%q<net-ssh>, [">= 5.0.0", "< 8.0.0"])
|
|
44
|
-
spec.add_dependency(%q<minitest>, [">= 5"])
|
|
45
|
-
spec.add_dependency(%q<test-unit>, [">= 0"])
|
|
46
|
-
spec.add_dependency(%q<mocha>, [">= 0"])
|
|
47
|
-
end
|
|
48
|
-
end
|