-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split `source` parameter into `source_socket_file`, `source_host` and `source_port` parameters. Rename `dest` parameter to `target_` parameters. By splitting the parameters, it's much easier to do proper input validation and build the socket parameters passed to the binary correctly. For instance, IP addresses are supposed to be surrounded by square brackets but hostnames should not. See https://github.com/Tarsnap/spiped/blob/5c13832aeecdad8a655dadcf5413cc504ad99e49/libcperciva/util/sock.c#L253 Replace erb with epp template.
- Loading branch information
1 parent
e9c74fc
commit 2cf20dd
Showing
10 changed files
with
243 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
define spiped::tunnel::client( | ||
$source, | ||
$dest, | ||
$secret, | ||
) { | ||
Variant[Sensitive[String[1]],String[1]] $secret, | ||
|
||
Optional[Stdlib::Unixpath] $source_socket_file = undef, | ||
Optional[Stdlib::Host] $source_host = undef, | ||
Optional[Stdlib::Port] $source_port = undef, | ||
|
||
Optional[Stdlib::Unixpath] $target_socket_file = undef, | ||
Optional[Stdlib::Host] $target_host = undef, | ||
Optional[Stdlib::Port] $target_port = undef, | ||
) | ||
{ | ||
spiped::tunnel { $title: | ||
type => 'client', | ||
source => $source, | ||
dest => $dest, | ||
secret => $secret; | ||
type => 'client', | ||
source_socket_file => $source_socket_file, | ||
source_host => $source_host, | ||
source_port => $source_port, | ||
target_socket_file => $target_socket_file, | ||
target_host => $target_host, | ||
target_port => $target_port, | ||
secret => $secret, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
define spiped::tunnel::server( | ||
$source, | ||
$dest, | ||
$secret, | ||
) { | ||
Variant[Sensitive[String[1]],String[1]] $secret, | ||
|
||
Optional[Stdlib::Unixpath] $source_socket_file = undef, | ||
Optional[Stdlib::Host] $source_host = undef, | ||
Optional[Stdlib::Port] $source_port = undef, | ||
|
||
Optional[Stdlib::Unixpath] $target_socket_file = undef, | ||
Optional[Stdlib::Host] $target_host = undef, | ||
Optional[Stdlib::Port] $target_port = undef, | ||
) | ||
{ | ||
spiped::tunnel { $title: | ||
type => 'server', | ||
source => $source, | ||
dest => $dest, | ||
secret => $secret; | ||
type => 'server', | ||
source_socket_file => $source_socket_file, | ||
source_host => $source_host, | ||
source_port => $source_port, | ||
target_socket_file => $target_socket_file, | ||
target_host => $target_host, | ||
target_port => $target_port, | ||
secret => $secret, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.