eco-rake 0.3.2 → 0.4.0
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
- data/CHANGELOG.md +63 -1
- data/README.md +10 -0
- data/lib/eco-rake/lib/export/payload.rb +6 -2
- data/lib/eco-rake/lib/files/decrypt.rb +1 -3
- data/lib/eco-rake/lib/task/runner_launch.rb +22 -0
- data/lib/eco-rake/options/forwarding/proxy.rb +4 -1
- data/lib/eco-rake/options/forwarding/rule.rb +3 -1
- data/lib/eco-rake/shell/command.rb +23 -3
- data/lib/eco-rake/shell/gpg.rb +58 -9
- data/lib/eco-rake/version.rb +1 -1
- metadata +6 -20
- data/.gitignore +0 -29
- data/.gitlab-ci.yml +0 -13
- data/.markdownlint.json +0 -4
- data/.rspec +0 -3
- data/.rubocop.yml +0 -100
- data/.ruby-version +0 -1
- data/.yardopts +0 -10
- data/Gemfile +0 -6
- data/Rakefile +0 -27
- data/eco-rake.gemspec +0 -42
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 353d8e00a1f5ed96338ccbd9951ee6bd798531cb96f82e1c8c611cc21462f263
|
|
4
|
+
data.tar.gz: 7477b263eb7234f94b3d3bc15131ff0e90bfe635f843593c29f2b037d5bf364b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 648d75aa71b1dd589474c8298451f8b27a4275603f6a59523d9f2798aca93435458f91d03fe22aa7055dc4362dfcd049b049f87af6fa571e58c290709062488b
|
|
7
|
+
data.tar.gz: bd4491278b7d79ba9d4e2b4a4c7955ce7ce759952122182afdc413d16df8a405da18182892a6af145f310069403aeea9f21cf9f112a885aa54f48c3b49673b69
|
data/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,59 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [0.4.0] - 2026-10-03
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- BREAKING (hence 0.4.0): `Shell::Gpg#decrypt_command` now RUNS gpg and returns its exit status
|
|
12
|
+
(`Integer`) instead of returning a command `String` for the caller to `sh`. Fleet sweep
|
|
13
|
+
2026-10-02: no consumer calls it (the consumers' own `decrypt_command` methods are private
|
|
14
|
+
wrappers of other tools), and the consumers pin `~> 0.3` / `< 0.2`, so none picks this up
|
|
15
|
+
without a deliberate bump.
|
|
16
|
+
|
|
17
|
+
### Security
|
|
18
|
+
|
|
19
|
+
- `Shell::Gpg#decrypt_command` no longer interpolates the gpg passphrase into a shell
|
|
20
|
+
string: the passphrase now travels on the child process' stdin (`--passphrase-fd 0`,
|
|
21
|
+
with `--batch --yes`, plus `--pinentry-mode=loopback` on `gpg >= 2.1`, same version
|
|
22
|
+
detection as before), and the rest of the command is built as an argv array run via
|
|
23
|
+
`Open3.capture2e` -- no shell is ever invoked, so there is no `sh -c`/`cmd /c` quoting
|
|
24
|
+
surface and the passphrase never reaches `argv` (previously visible in the process
|
|
25
|
+
list for the life of the `gpg` child). `Shell::Command#sh_default_block` (the generic
|
|
26
|
+
failure-echo used by `sh_continue`/`sh_exit_on_fail`) now redacts any `--passphrase`/
|
|
27
|
+
`--passphrase-fd` fragment before printing a failed command, and the gpg failure path
|
|
28
|
+
logs a redacted argv instead of a raw command string, closing the log leak an
|
|
29
|
+
internal secrets-in-commands audit found alongside the argv exposure. `decrypt_command`'s return value changed
|
|
30
|
+
from a shell-command `String` (the vulnerability itself) to the process exit status
|
|
31
|
+
(`Integer`) -- `Lib::Files::Decrypt#task` was updated accordingly; any other caller
|
|
32
|
+
relying on the old `String` return should check for this.
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- Gemspec `spec.files` allowlisted by ROOT DIRECTORY (`lib/`) rather than by full path, so any
|
|
37
|
+
non-`.rb` file added under `lib/` shipped silently. `spec.files` is now a full-path allowlist
|
|
38
|
+
-- `lib/**/*.rb` plus `README.md` / `CHANGELOG.md` / `LICENSE` at the root -- intersected
|
|
39
|
+
with `git ls-files`. Also dropped the dead `spec.bindir` / `spec.executables` clause: it read
|
|
40
|
+
`spec.files` before that was ever assigned (always empty regardless of `exe/` contents), and
|
|
41
|
+
`exe/` itself carries no tracked files today, so a bare directory-prefix executables clause
|
|
42
|
+
was the same disguised-denylist defect this standard forbids. `spec/packaging_spec.rb` pins
|
|
43
|
+
the allowlist so this cannot regress silently again. Standard:
|
|
44
|
+
`governance/gem-packaging-and-publish-gate` in ep-ai-standards.
|
|
45
|
+
|
|
46
|
+
## [0.3.5] - 2026-07-17
|
|
47
|
+
|
|
48
|
+
### Added
|
|
49
|
+
|
|
50
|
+
- `Lib::Task::RunnerLaunch#notify_exception` — a base exception notifier for task
|
|
51
|
+
runners. Honours the standard `eco-rake` suppression convention (`-no-email` and
|
|
52
|
+
`-simulate` suppress the email unless `-notify` forces it). Provides a single
|
|
53
|
+
chokepoint so per-runner subclasses no longer need their own copy (the copies
|
|
54
|
+
omitted the `no_email` guard, which leaked exception emails to customers during
|
|
55
|
+
`-no-email` runs).
|
|
56
|
+
|
|
57
|
+
## [0.3.4] - 2026-04-xx
|
|
6
58
|
|
|
7
59
|
### Added
|
|
8
60
|
|
|
@@ -10,6 +62,16 @@ All notable changes to this project will be documented in this file.
|
|
|
10
62
|
|
|
11
63
|
### Fixed
|
|
12
64
|
|
|
65
|
+
## [0.3.3] - 2026-04-15
|
|
66
|
+
|
|
67
|
+
### Added
|
|
68
|
+
|
|
69
|
+
- new option `no-sftp-pull` for data extracts.
|
|
70
|
+
|
|
71
|
+
### Fixed
|
|
72
|
+
|
|
73
|
+
- upgraded `rake-commander`
|
|
74
|
+
|
|
13
75
|
## [0.3.2] - 2025-11-22
|
|
14
76
|
|
|
15
77
|
### Fixed
|
data/README.md
CHANGED
|
@@ -27,3 +27,13 @@ See {file:CHANGELOG.md} for a list of changes.
|
|
|
27
27
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
28
28
|
|
|
29
29
|
For more info on available `Rake` tasks: `rake -T`
|
|
30
|
+
|
|
31
|
+
<!-- audit-status:start -->
|
|
32
|
+
### Fleet audit status
|
|
33
|
+
|
|
34
|
+
This repo is under the Fleet Audit & Amendment Programme (FAAP). No audit run yet -- this is the notice MR; the first `granular`-tier run populates this block with counts by severity and status.
|
|
35
|
+
|
|
36
|
+
Guidelines (read before any change): `docs/audits/guidelines.md`
|
|
37
|
+
Deviations register: `docs/audits/deviations.md`
|
|
38
|
+
Run index: `docs/audits/README.md`
|
|
39
|
+
<!-- audit-status:end -->
|
|
@@ -20,7 +20,8 @@ class EcoRake
|
|
|
20
20
|
col_sep: ->(sep) { "-col-sep #{sep}" },
|
|
21
21
|
multi_sep: ->(sep) { "-multi-sep #{sep}" },
|
|
22
22
|
full: ->(full) { full ? nil : '-delta' },
|
|
23
|
-
asat: ->(asat) { "-asatdate #{asat}" }
|
|
23
|
+
asat: ->(asat) { "-asatdate #{asat}" },
|
|
24
|
+
sftp_pull: ->(pull) { pull ? '' : '-no-sftp-pull' }
|
|
24
25
|
}.freeze
|
|
25
26
|
|
|
26
27
|
attr_const :mail_to
|
|
@@ -56,6 +57,9 @@ class EcoRake
|
|
|
56
57
|
value&.iso8601
|
|
57
58
|
end
|
|
58
59
|
|
|
60
|
+
str_desc = 'Whether or not to pull data files from the SFTP.'
|
|
61
|
+
option '-l', '--[no-]sftp-pull', TrueClass, default: true, desc: str_desc
|
|
62
|
+
|
|
59
63
|
option '-m', '--no-email', TrueClass, desc: 'Do not notify', default: false
|
|
60
64
|
|
|
61
65
|
str_desc = 'Notify (even if dry-run or not remote)'
|
|
@@ -91,7 +95,7 @@ class EcoRake
|
|
|
91
95
|
end
|
|
92
96
|
|
|
93
97
|
def export_registers
|
|
94
|
-
forward_command('-extract-registers', :multi_sep)
|
|
98
|
+
forward_command('-extract-registers', :multi_sep, :sftp_pull)
|
|
95
99
|
end
|
|
96
100
|
|
|
97
101
|
def export_pack
|
|
@@ -17,9 +17,7 @@ class EcoRake
|
|
|
17
17
|
target_files.each do |file|
|
|
18
18
|
delete_file(gpg_to_csv_filename(file))
|
|
19
19
|
|
|
20
|
-
stat =
|
|
21
|
-
decrypt_command(file, ignore_mdc_error: ignore_mdc_error)
|
|
22
|
-
)
|
|
20
|
+
stat = decrypt_command(file, ignore_mdc_error: ignore_mdc_error)
|
|
23
21
|
|
|
24
22
|
status = stat unless stat.zero?
|
|
25
23
|
end
|
|
@@ -79,6 +79,28 @@ class EcoRake
|
|
|
79
79
|
|
|
80
80
|
private
|
|
81
81
|
|
|
82
|
+
# Default exception notifier for task runners.
|
|
83
|
+
#
|
|
84
|
+
# Honours the same suppression convention as the rest of `eco-rake`
|
|
85
|
+
# (see `Export::Payload`, `People::SyncLaunch`): `-no-email` and
|
|
86
|
+
# `-simulate` suppress the notification unless `-notify` forces it.
|
|
87
|
+
# This is the single chokepoint so per-runner subclasses do not need to
|
|
88
|
+
# re-implement (and drop) the `no_email` guard — the bug that leaked
|
|
89
|
+
# exception emails to customers during `-no-email` runs.
|
|
90
|
+
#
|
|
91
|
+
# Requires the subclass to expose `mail_to` (e.g. via `attr_const :mail_to`).
|
|
92
|
+
# @param err [Exception, nil] the raised error (nil ⇒ clean exit 0).
|
|
93
|
+
def notify_exception(err)
|
|
94
|
+
exit 0 unless err
|
|
95
|
+
exit 1 if options[:simulate] && !options[:notify]
|
|
96
|
+
exit 1 if options[:no_email] && !options[:notify]
|
|
97
|
+
exit 1 unless respond_to?(:mail_to, true) && (inbox = mail_to)
|
|
98
|
+
|
|
99
|
+
subject = "There was an exception on #{options[:task]}"
|
|
100
|
+
email(enviro: target_enviro, to: inbox, subject: subject, body: err.to_s)
|
|
101
|
+
exit 1
|
|
102
|
+
end
|
|
103
|
+
|
|
82
104
|
def command(*args)
|
|
83
105
|
cmd = [ruby_runner]
|
|
84
106
|
cmd.push(*forward_options(:enviro, :space, :simulate, :no_email, :notify))
|
|
@@ -15,12 +15,14 @@ class EcoRake
|
|
|
15
15
|
pklass = parent.is_a?(Class)? parent : parent.class
|
|
16
16
|
msg = "Expecting parent to be RakeCommander::Options::Class. Given: #{pklass}"
|
|
17
17
|
raise ArgumentError, msg unless parent.is_a?(Class) && parent <= RakeCommander::Options
|
|
18
|
+
|
|
18
19
|
@parent = parent
|
|
19
20
|
@rules = {}
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
def each(&block)
|
|
23
24
|
return to_enum(:each) unless block_given?
|
|
25
|
+
|
|
24
26
|
@rules.values.each(&block)
|
|
25
27
|
end
|
|
26
28
|
|
|
@@ -83,8 +85,9 @@ class EcoRake
|
|
|
83
85
|
raise ArgumentError, msg unless (opt = option(rule.sym)) || !require_option
|
|
84
86
|
|
|
85
87
|
rule.sym = opt&.name
|
|
86
|
-
if existing_rule = self[rule.sym]
|
|
88
|
+
if (existing_rule = self[rule.sym])
|
|
87
89
|
return false unless override
|
|
90
|
+
|
|
88
91
|
puts "Warning: Overriding forwarding '#{existing_rule.desc}'" if warning
|
|
89
92
|
end
|
|
90
93
|
|
|
@@ -17,6 +17,7 @@ class EcoRake
|
|
|
17
17
|
raise ArgumentError, msg unless RULE_TYPES.any? {|type| rule.is_a?(type)}
|
|
18
18
|
msg = "Accepted Symbol rules are: :#{SYMBOL_TYPES.join(', :')}. Given :#{rule}"
|
|
19
19
|
raise ArgumentError, msg if rule.is_a?(Symbol) && SYMBOL_TYPES.none? {|type| rule == type}
|
|
20
|
+
|
|
20
21
|
@parent = parent
|
|
21
22
|
@sym = sym
|
|
22
23
|
@rule = rule
|
|
@@ -37,12 +38,13 @@ class EcoRake
|
|
|
37
38
|
end
|
|
38
39
|
|
|
39
40
|
# @note
|
|
40
|
-
# 1.
|
|
41
|
+
# 1. Retrieves value from parsed options results by using the option name, short or sym.
|
|
41
42
|
# 2. It then applies the rule on it.
|
|
42
43
|
# @param option_results [Hash] the parsed option results.
|
|
43
44
|
# @return [NilClass, Value] the value that the rule returns, `nil` if rule inactive/not-applicable.
|
|
44
45
|
def apply(option_results)
|
|
45
46
|
return nil unless active?(option_results)
|
|
47
|
+
|
|
46
48
|
opt = option
|
|
47
49
|
return nil unless opt || rule != :mirror
|
|
48
50
|
|
|
@@ -3,6 +3,13 @@ class EcoRake
|
|
|
3
3
|
module Command
|
|
4
4
|
include Rake::DSL
|
|
5
5
|
|
|
6
|
+
# Patterns matched against a command string/argv-joined-string and redacted
|
|
7
|
+
# before it is ever logged or echoed (defence in depth: callers should not be
|
|
8
|
+
# passing secrets into `comm`/`sh` at all, but this guards against it anyway).
|
|
9
|
+
REDACT_PATTERNS = [
|
|
10
|
+
/--passphrase(?:-fd)?\s+\S+/i
|
|
11
|
+
].freeze
|
|
12
|
+
|
|
6
13
|
# It double quotes a string (escapes the double quotes)
|
|
7
14
|
# @param str [String]
|
|
8
15
|
# @return [String]
|
|
@@ -27,6 +34,18 @@ class EcoRake
|
|
|
27
34
|
array_cmd(base, *options).join(join)
|
|
28
35
|
end
|
|
29
36
|
|
|
37
|
+
# Redacts any known secret-bearing fragment from a command string before it is
|
|
38
|
+
# logged or echoed anywhere.
|
|
39
|
+
# @param comm [String]
|
|
40
|
+
# @return [String]
|
|
41
|
+
def redact_command(comm)
|
|
42
|
+
str = comm.to_s
|
|
43
|
+
REDACT_PATTERNS.each do |pattern|
|
|
44
|
+
str = str.gsub(pattern) {|match| "#{match.split(/\s+/).first} [REDACTED]" }
|
|
45
|
+
end
|
|
46
|
+
str
|
|
47
|
+
end
|
|
48
|
+
|
|
30
49
|
# @param continue [Boolean] whether it should continue when one failed.
|
|
31
50
|
# @param arr [Array<String>] array of commands to be run
|
|
32
51
|
def sh_chain(cmds, continue: false, &block)
|
|
@@ -47,7 +66,7 @@ class EcoRake
|
|
|
47
66
|
# @note if doesn't raise (prevents) a RuntimeError
|
|
48
67
|
# @param comm [String] the command line
|
|
49
68
|
def sh_exit_on_fail(comm)
|
|
50
|
-
callback = middlewared_callback(sh_default_block(comm)) do |ok,
|
|
69
|
+
callback = middlewared_callback(sh_default_block(comm)) do |ok, _res|
|
|
51
70
|
next if ok
|
|
52
71
|
|
|
53
72
|
exit(1)
|
|
@@ -56,7 +75,8 @@ class EcoRake
|
|
|
56
75
|
end
|
|
57
76
|
|
|
58
77
|
# Returns the default block for `sh` native method.
|
|
59
|
-
# @note it wraps `block` if given
|
|
78
|
+
# @note it wraps `block` if given. The echoed command is redacted (see
|
|
79
|
+
# {#redact_command}) so a secret accidentally carried in `comm` is never printed.
|
|
60
80
|
# @return [Proc]
|
|
61
81
|
def sh_default_block(comm)
|
|
62
82
|
proc do |ok, res|
|
|
@@ -64,7 +84,7 @@ class EcoRake
|
|
|
64
84
|
|
|
65
85
|
unless ok
|
|
66
86
|
msg = "Command failed (status = #{res.exitstatus})"
|
|
67
|
-
puts "#{msg}\n * #{comm}"
|
|
87
|
+
puts "#{msg}\n * #{redact_command(comm)}"
|
|
68
88
|
end
|
|
69
89
|
|
|
70
90
|
res.exitstatus
|
data/lib/eco-rake/shell/gpg.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'open3'
|
|
2
|
+
|
|
1
3
|
class EcoRake
|
|
2
4
|
module Shell
|
|
3
5
|
module Gpg
|
|
@@ -5,32 +7,79 @@ class EcoRake
|
|
|
5
7
|
include EcoRake::Shell::Files
|
|
6
8
|
|
|
7
9
|
GPG_VERSION_REGEX = /^gpg.*?gnupg.*?(?<maj>\d+)\.(?<min>\d+)\./i
|
|
10
|
+
PASSPHRASE_REDACTED = '[REDACTED]'.freeze
|
|
8
11
|
|
|
9
12
|
# @note
|
|
10
13
|
# 1. The ENV var `GPG_KEY` specifies the `passphrase` to be able to use the
|
|
11
14
|
# private gpg key (suppsedly installed in the user's local `gpg keyring`).
|
|
12
15
|
# 2. Depending on the `gpg` version, the option to prevent the interactive passphrase to prompt
|
|
13
16
|
# is different. This is the reason why we check what is the option for a `loopback`
|
|
17
|
+
# 3. The passphrase is **never** placed in `argv` (visible in the process list) nor logged:
|
|
18
|
+
# it is streamed to the child process' `stdin` via `--passphrase-fd 0`, and the logged
|
|
19
|
+
# argv has the passphrase slot redacted (see {#decrypt_argv}).
|
|
14
20
|
# @param gpg_file [String] the file meant to be decrypted.
|
|
15
|
-
# @
|
|
21
|
+
# @param gpg_key [String] the passphrase, streamed via stdin (never put in argv or logs).
|
|
22
|
+
# @param ignore_mdc_error [Boolean]
|
|
23
|
+
# @return [Integer] the process exit status (`0` on success)
|
|
16
24
|
def decrypt_command(gpg_file, gpg_key: ENV['GPG_KEY'], ignore_mdc_error: false)
|
|
25
|
+
argv = decrypt_argv(gpg_file, ignore_mdc_error: ignore_mdc_error)
|
|
26
|
+
run_gpg(argv, passphrase: gpg_key)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
private
|
|
30
|
+
|
|
31
|
+
# Builds the `gpg` decrypt command as an **argv array** (never a shell string).
|
|
32
|
+
# @note the passphrase is deliberately **not** included here: it travels via stdin
|
|
33
|
+
# (`--passphrase-fd 0`), so it never reaches argv (process list) or any log of this array.
|
|
34
|
+
# @param gpg_file [String] the file meant to be decrypted.
|
|
35
|
+
# @param ignore_mdc_error [Boolean]
|
|
36
|
+
# @return [Array<String>] the argv (command + arguments), passphrase-free
|
|
37
|
+
def decrypt_argv(gpg_file, ignore_mdc_error: false)
|
|
17
38
|
csv_file = gpg_to_csv_filename(gpg_file)
|
|
18
39
|
no_error = ignore_mdc_error ? '--ignore-mdc-error' : nil
|
|
19
40
|
|
|
20
|
-
loopback =
|
|
41
|
+
loopback = nil
|
|
21
42
|
loopback = '--pinentry-mode=loopback' if gpg_version_gte?(major: 2, minor: 1)
|
|
22
43
|
|
|
23
|
-
|
|
44
|
+
array_cmd(
|
|
45
|
+
'gpg',
|
|
46
|
+
'--batch', '--yes',
|
|
24
47
|
no_error, loopback,
|
|
25
|
-
'--passphrase',
|
|
26
|
-
'-o',
|
|
27
|
-
'-d',
|
|
28
|
-
|
|
48
|
+
'--passphrase-fd', '0',
|
|
49
|
+
'-o', csv_file,
|
|
50
|
+
'-d', gpg_file
|
|
51
|
+
)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Runs a `gpg` argv array, streaming `passphrase` to the child's stdin.
|
|
55
|
+
# @note never logs or echoes `passphrase`; only the redacted argv is logged.
|
|
56
|
+
# @param argv [Array<String>] command + arguments, as built by {#decrypt_argv}.
|
|
57
|
+
# @param passphrase [String]
|
|
58
|
+
# @return [Integer] the process exit status (`0` on success)
|
|
59
|
+
def run_gpg(argv, passphrase:)
|
|
60
|
+
stdout_err, status = Open3.capture2e(*argv, stdin_data: passphrase.to_s)
|
|
61
|
+
|
|
62
|
+
exitstatus = status.exitstatus
|
|
63
|
+
unless status.success?
|
|
64
|
+
msg = "Command failed (status = #{exitstatus})"
|
|
65
|
+
puts "#{msg}\n * #{redact_argv(argv).join(' ')}\n#{stdout_err}"
|
|
66
|
+
end
|
|
29
67
|
|
|
30
|
-
|
|
68
|
+
exitstatus
|
|
31
69
|
end
|
|
32
70
|
|
|
33
|
-
|
|
71
|
+
# Redacts any secret-bearing slot from a `gpg` argv array before it is logged.
|
|
72
|
+
# @note `--passphrase-fd 0` carries no secret value itself (the secret travels via
|
|
73
|
+
# stdin, not argv), but this also redacts a legacy `--passphrase <value>` pair
|
|
74
|
+
# defensively, in case any caller still builds one.
|
|
75
|
+
# @param argv [Array<String>] command + arguments
|
|
76
|
+
# @return [Array<String>] a redacted copy, safe to log
|
|
77
|
+
def redact_argv(argv)
|
|
78
|
+
argv.each_with_index.map do |arg, i|
|
|
79
|
+
prev = i.zero? ? nil : argv[i - 1]
|
|
80
|
+
prev == '--passphrase' ? PASSPHRASE_REDACTED : arg
|
|
81
|
+
end
|
|
82
|
+
end
|
|
34
83
|
|
|
35
84
|
# TODO: use a common end point from `Command`
|
|
36
85
|
def shell_gpg_version
|
data/lib/eco-rake/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eco-rake
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oscar Segura Samper
|
|
8
|
-
|
|
9
|
-
bindir: exe
|
|
8
|
+
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rake
|
|
@@ -150,14 +149,14 @@ dependencies:
|
|
|
150
149
|
requirements:
|
|
151
150
|
- - "~>"
|
|
152
151
|
- !ruby/object:Gem::Version
|
|
153
|
-
version: 0.4.
|
|
152
|
+
version: 0.4.3
|
|
154
153
|
type: :runtime
|
|
155
154
|
prerelease: false
|
|
156
155
|
version_requirements: !ruby/object:Gem::Requirement
|
|
157
156
|
requirements:
|
|
158
157
|
- - "~>"
|
|
159
158
|
- !ruby/object:Gem::Version
|
|
160
|
-
version: 0.4.
|
|
159
|
+
version: 0.4.3
|
|
161
160
|
- !ruby/object:Gem::Dependency
|
|
162
161
|
name: sendgrid-ruby
|
|
163
162
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -172,26 +171,15 @@ dependencies:
|
|
|
172
171
|
- - "~>"
|
|
173
172
|
- !ruby/object:Gem::Version
|
|
174
173
|
version: 6.7.0
|
|
175
|
-
description:
|
|
176
174
|
email:
|
|
177
175
|
- oscar@ecoportal.co.nz
|
|
178
176
|
executables: []
|
|
179
177
|
extensions: []
|
|
180
178
|
extra_rdoc_files: []
|
|
181
179
|
files:
|
|
182
|
-
- ".gitignore"
|
|
183
|
-
- ".gitlab-ci.yml"
|
|
184
|
-
- ".markdownlint.json"
|
|
185
|
-
- ".rspec"
|
|
186
|
-
- ".rubocop.yml"
|
|
187
|
-
- ".ruby-version"
|
|
188
|
-
- ".yardopts"
|
|
189
180
|
- CHANGELOG.md
|
|
190
|
-
- Gemfile
|
|
191
181
|
- LICENSE
|
|
192
182
|
- README.md
|
|
193
|
-
- Rakefile
|
|
194
|
-
- eco-rake.gemspec
|
|
195
183
|
- lib/eco-rake.rb
|
|
196
184
|
- lib/eco-rake/base.rb
|
|
197
185
|
- lib/eco-rake/base/method_helpers.rb
|
|
@@ -260,7 +248,6 @@ licenses:
|
|
|
260
248
|
- MIT
|
|
261
249
|
metadata:
|
|
262
250
|
rubygems_mfa_required: 'true'
|
|
263
|
-
post_install_message:
|
|
264
251
|
rdoc_options: []
|
|
265
252
|
require_paths:
|
|
266
253
|
- lib
|
|
@@ -275,8 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
275
262
|
- !ruby/object:Gem::Version
|
|
276
263
|
version: '0'
|
|
277
264
|
requirements: []
|
|
278
|
-
rubygems_version:
|
|
279
|
-
signing_key:
|
|
265
|
+
rubygems_version: 4.0.8
|
|
280
266
|
specification_version: 4
|
|
281
267
|
summary: A set of helpers to build re-usable `rake` integration helpers.
|
|
282
268
|
test_files: []
|
data/.gitignore
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# env files
|
|
2
|
-
.env*
|
|
3
|
-
|
|
4
|
-
# core development-only executables
|
|
5
|
-
/bin/raked*
|
|
6
|
-
|
|
7
|
-
# it's a gem, ignore the lockfile
|
|
8
|
-
Gemfile.lock
|
|
9
|
-
|
|
10
|
-
# build artifacts
|
|
11
|
-
*.gem
|
|
12
|
-
/.bundle/
|
|
13
|
-
/vendor/bundle
|
|
14
|
-
/spec/reports/
|
|
15
|
-
/tmp/
|
|
16
|
-
/pkg/
|
|
17
|
-
|
|
18
|
-
# docs
|
|
19
|
-
/.yardoc
|
|
20
|
-
/_yardoc/
|
|
21
|
-
/coverage/
|
|
22
|
-
/doc/
|
|
23
|
-
|
|
24
|
-
# rspec failure tracking
|
|
25
|
-
.rspec_status
|
|
26
|
-
scratch.rb
|
|
27
|
-
|
|
28
|
-
/.byebug_history
|
|
29
|
-
.solargraph.yml
|
data/.gitlab-ci.yml
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# You can override the included template(s) by including variable overrides
|
|
2
|
-
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
|
|
3
|
-
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
|
|
4
|
-
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
|
|
5
|
-
# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings
|
|
6
|
-
# Note that environment variables can be set in several places
|
|
7
|
-
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
|
|
8
|
-
stages:
|
|
9
|
-
- test
|
|
10
|
-
sast:
|
|
11
|
-
stage: test
|
|
12
|
-
include:
|
|
13
|
-
- template: Security/SAST.gitlab-ci.yml
|
data/.markdownlint.json
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
AllCops:
|
|
2
|
-
TargetRubyVersion: 3.2
|
|
3
|
-
NewCops: enable
|
|
4
|
-
|
|
5
|
-
Metrics/ClassLength:
|
|
6
|
-
Max: 500
|
|
7
|
-
Metrics/ModuleLength:
|
|
8
|
-
Max: 300
|
|
9
|
-
Metrics/MethodLength:
|
|
10
|
-
Max: 50
|
|
11
|
-
Metrics/AbcSize:
|
|
12
|
-
Max: 30
|
|
13
|
-
Metrics/ParameterLists:
|
|
14
|
-
Max: 5
|
|
15
|
-
CountKeywordArgs: false
|
|
16
|
-
Metrics/BlockLength:
|
|
17
|
-
CountAsOne: ['array', 'heredoc', 'method_call']
|
|
18
|
-
Max: 50
|
|
19
|
-
Metrics/CyclomaticComplexity:
|
|
20
|
-
Max: 30
|
|
21
|
-
Metrics/PerceivedComplexity:
|
|
22
|
-
Max: 30
|
|
23
|
-
|
|
24
|
-
Style/AccessorGrouping:
|
|
25
|
-
Enabled: false
|
|
26
|
-
Style/ConditionalAssignment:
|
|
27
|
-
Enabled: false
|
|
28
|
-
Style/BlockDelimiters:
|
|
29
|
-
BracesRequiredMethods: ['log']
|
|
30
|
-
AllowedPatterns: ['proc', 'new']
|
|
31
|
-
Style/HashSyntax:
|
|
32
|
-
EnforcedShorthandSyntax: either
|
|
33
|
-
EnforcedStyle: no_mixed_keys
|
|
34
|
-
Style/ArgumentsForwarding:
|
|
35
|
-
UseAnonymousForwarding: false
|
|
36
|
-
Style/ClassAndModuleChildren:
|
|
37
|
-
Enabled: false
|
|
38
|
-
Style/FrozenStringLiteralComment:
|
|
39
|
-
Enabled: false
|
|
40
|
-
Style/StringLiterals:
|
|
41
|
-
Enabled: false
|
|
42
|
-
Style/StringLiteralsInInterpolation:
|
|
43
|
-
Enabled: false
|
|
44
|
-
Style/Documentation:
|
|
45
|
-
Enabled: false
|
|
46
|
-
Style/CommentedKeyword:
|
|
47
|
-
Enabled: false
|
|
48
|
-
Style/MultilineBlockChain:
|
|
49
|
-
Enabled: false
|
|
50
|
-
Style/AndOr:
|
|
51
|
-
Enabled: false
|
|
52
|
-
Style/Alias:
|
|
53
|
-
EnforcedStyle: prefer_alias_method
|
|
54
|
-
Style/FetchEnvVar:
|
|
55
|
-
Enabled: false
|
|
56
|
-
Style/RegexpLiteral:
|
|
57
|
-
EnforcedStyle: mixed
|
|
58
|
-
AllowInnerSlashes: true
|
|
59
|
-
|
|
60
|
-
Layout/HashAlignment:
|
|
61
|
-
EnforcedColonStyle: table
|
|
62
|
-
EnforcedHashRocketStyle: table
|
|
63
|
-
Layout/LeadingCommentSpace:
|
|
64
|
-
Enabled: false
|
|
65
|
-
AllowGemfileRubyComment: true
|
|
66
|
-
Layout/ParameterAlignment:
|
|
67
|
-
Enabled: false
|
|
68
|
-
Layout/MultilineMethodDefinitionBraceLayout:
|
|
69
|
-
EnforcedStyle: symmetrical
|
|
70
|
-
Layout/LineLength:
|
|
71
|
-
Enabled: true
|
|
72
|
-
Layout/SpaceInsideHashLiteralBraces:
|
|
73
|
-
Enabled: false
|
|
74
|
-
Layout/SpaceInsideBlockBraces:
|
|
75
|
-
Enabled: false
|
|
76
|
-
Layout/SpaceAroundOperators:
|
|
77
|
-
Enabled: false
|
|
78
|
-
Layout/ExtraSpacing:
|
|
79
|
-
AllowForAlignment: true
|
|
80
|
-
AllowBeforeTrailingComments: true
|
|
81
|
-
Layout/AccessModifierIndentation:
|
|
82
|
-
EnforcedStyle: indent
|
|
83
|
-
Layout/DotPosition:
|
|
84
|
-
EnforcedStyle: trailing
|
|
85
|
-
Layout/MultilineMethodCallIndentation:
|
|
86
|
-
EnforcedStyle: indented
|
|
87
|
-
Layout/FirstHashElementIndentation:
|
|
88
|
-
Enabled: false
|
|
89
|
-
Layout/EmptyLineAfterGuardClause:
|
|
90
|
-
Enabled: false
|
|
91
|
-
|
|
92
|
-
Naming/VariableNumber:
|
|
93
|
-
EnforcedStyle: snake_case
|
|
94
|
-
CheckSymbols: false
|
|
95
|
-
Naming/MethodParameterName:
|
|
96
|
-
AllowedNames: ['x', 'y', 'i', 'j', 'id', 'io', 'to']
|
|
97
|
-
Naming/RescuedExceptionsVariableName:
|
|
98
|
-
Enabled: false
|
|
99
|
-
Naming/BlockForwarding:
|
|
100
|
-
Enabled: false
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.2.2
|
data/.yardopts
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
require "bundler/gem_tasks"
|
|
2
|
-
require "rspec/core/rake_task"
|
|
3
|
-
require "yard"
|
|
4
|
-
require "redcarpet"
|
|
5
|
-
|
|
6
|
-
desc "run the specs"
|
|
7
|
-
RSpec::Core::RakeTask.new(:spec)
|
|
8
|
-
|
|
9
|
-
desc "run rspec showing backtrace"
|
|
10
|
-
RSpec::Core::RakeTask.new(:spec_trace) do |task|
|
|
11
|
-
task.rspec_opts = ['--backtrace']
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
desc "run rspec stopping on first fail, and show backtrace"
|
|
15
|
-
RSpec::Core::RakeTask.new(:spec_fast) do |task|
|
|
16
|
-
task.rspec_opts = ['--fail-fast', '--backtrace']
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
# default task name is yard
|
|
20
|
-
desc "Yard: generate all the documentation"
|
|
21
|
-
YARD::Rake::YardocTask.new(:doc) do |t|
|
|
22
|
-
#t.files = ['lib/**/*.rb']
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
task default: [:spec]
|
|
26
|
-
task rspec_trace: :spec_trace
|
|
27
|
-
task rspec_fast: :spec_fast
|
data/eco-rake.gemspec
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# rubocop:disable Gemspec/DevelopmentDependencies
|
|
2
|
-
lib = File.expand_path('lib', __dir__)
|
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
|
|
5
|
-
require 'eco-rake/version'
|
|
6
|
-
|
|
7
|
-
Gem::Specification.new do |spec|
|
|
8
|
-
spec.name = 'eco-rake'
|
|
9
|
-
spec.version = EcoRake::VERSION
|
|
10
|
-
spec.authors = ['Oscar Segura Samper']
|
|
11
|
-
spec.email = ['oscar@ecoportal.co.nz']
|
|
12
|
-
|
|
13
|
-
spec.summary = 'A set of helpers to build re-usable `rake` integration helpers.'
|
|
14
|
-
spec.homepage = 'https://www.ecoportal.com'
|
|
15
|
-
spec.licenses = %w[MIT]
|
|
16
|
-
|
|
17
|
-
spec.bindir = 'exe'
|
|
18
|
-
spec.executables = spec.files.grep(/^exe\//) { |f| File.basename(f) }
|
|
19
|
-
|
|
20
|
-
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
21
|
-
|
|
22
|
-
spec.required_ruby_version = '>= 3.2.2'
|
|
23
|
-
|
|
24
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
25
|
-
f.match(/^(test|spec|features)\//)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
spec.require_paths = ['lib']
|
|
29
|
-
|
|
30
|
-
spec.add_development_dependency 'rake', '>= 13.0.6', '< 14'
|
|
31
|
-
spec.add_development_dependency 'redcarpet', '>= 3.6.0', '< 4'
|
|
32
|
-
spec.add_development_dependency 'rspec', '>= 3.10.0', '< 4'
|
|
33
|
-
spec.add_development_dependency 'yard', '>= 0.9.34', '< 1'
|
|
34
|
-
|
|
35
|
-
spec.add_dependency 'aws-sdk-ses', '~> 1', '>= 1.58.0'
|
|
36
|
-
spec.add_dependency 'dotenv', '~> 3'
|
|
37
|
-
spec.add_dependency 'nokogiri', '>= 1.13', '< 1.17'
|
|
38
|
-
spec.add_dependency 'rake-commander', '~> 0.4.2'
|
|
39
|
-
spec.add_dependency 'sendgrid-ruby', '~> 6.7.0'
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
# rubocop:enable Gemspec/DevelopmentDependencies
|