From 381facb1584413b96908399db28f9a838e9c10ad Mon Sep 17 00:00:00 2001 From: Joe Haig Date: Tue, 6 Jan 2026 12:44:42 -0600 Subject: [PATCH 1/3] Chore: Add New Ruby Versions To CI --- .github/workflows/linting.yml | 9 ++++++--- .github/workflows/testing.yml | 6 +++--- .ruby-version | 2 +- Gemfile.lock | 2 +- chamber.gemspec | 2 +- lib/chamber/filters/decryption_filter.rb | 2 +- spec/lib/chamber/commands/show_spec.rb | 6 +++++- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 86268ca..07270e0 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -47,7 +47,7 @@ jobs: - name: "Build Ruby" uses: "ruby/setup-ruby@v1" with: - ruby-version: 2.7 + ruby-version: 3.2 - name: "Build Node" @@ -59,9 +59,12 @@ jobs: run: > gem install --no-document rubocop - rubocop-rspec - rubocop-rails + rubocop-capybara + rubocop-factory_bot rubocop-performance + rubocop-rails + rubocop-rspec + rubocop-thread_safety - name: "Install Node Modules" run: > diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 0124e03..a7e3776 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -12,12 +12,12 @@ jobs: runs-on: "ubuntu-latest" strategy: + fail-fast: false matrix: ruby: - - "2.7" - - "3.0" - - "3.1" - "3.2" + - "3.3" + - "3.4" - "ruby-head" continue-on-error: ${{ endsWith(matrix.ruby, 'head') }} diff --git a/.ruby-version b/.ruby-version index 49cdd66..351227f 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.6 +3.2.4 diff --git a/Gemfile.lock b/Gemfile.lock index cbfcf1a..f7ef439 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -66,4 +66,4 @@ DEPENDENCIES timecop (~> 0.0) BUNDLED WITH - 2.3.24 + 2.4.2 diff --git a/chamber.gemspec b/chamber.gemspec index 9dd2835..6638d54 100644 --- a/chamber.gemspec +++ b/chamber.gemspec @@ -29,7 +29,7 @@ Gem::Specification.new do |spec| 'wiki_uri' => 'https://github.com/thekompanee/chamber/wiki', } - spec.required_ruby_version = '>= 2.7.5' + spec.required_ruby_version = '>= 3.2.4' spec.add_dependency 'thor', [">= 0.20.3", "< 2.0"] diff --git a/lib/chamber/filters/decryption_filter.rb b/lib/chamber/filters/decryption_filter.rb index c9bca48..ff9e93a 100644 --- a/lib/chamber/filters/decryption_filter.rb +++ b/lib/chamber/filters/decryption_filter.rb @@ -82,7 +82,7 @@ def decrypt(key, value) decryption_keys.each do |decryption_key| return method.decrypt(key, value, decryption_key) - rescue OpenSSL::PKey::RSAError + rescue ::OpenSSL::PKey::RSAError, ::Psych::SyntaxError next end diff --git a/spec/lib/chamber/commands/show_spec.rb b/spec/lib/chamber/commands/show_spec.rb index c443509..da0fdce 100644 --- a/spec/lib/chamber/commands/show_spec.rb +++ b/spec/lib/chamber/commands/show_spec.rb @@ -40,7 +40,11 @@ module Commands end it 'can return values formatted as a hash' do - expect(Show.call(**options)) + # Ruby 3.4's PP changed how hashrockets were rendered (it added spaces + # around the hashrockets). So, until Ruby 3.3 is EOL and no longer suppored, + # this (the gsubs) are the workaround so that the test passes on all Ruby + # versions in CI. + expect(Show.call(**options).gsub(' => ', '=>').gsub(' =>', '=>')) .to eql( <<~HEREDOC.chomp) {"my_setting"=>"my_value", From e1037b7f4e34ec3da6470767ca1bcfba315de6fb Mon Sep 17 00:00:00 2001 From: Joe Haig Date: Tue, 6 Jan 2026 12:49:00 -0600 Subject: [PATCH 2/3] Add: New Dependencies For Ruby 3.4+ --- Gemfile.lock | 6 ++++++ chamber.gemspec | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index f7ef439..668b6f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,6 +2,9 @@ PATH remote: . specs: chamber (3.1.1) + base64 (~> 0.3) + bigdecimal (~> 4.0) + mutex_m (~> 0.3) thor (>= 0.20.3, < 2.0) GEM @@ -21,6 +24,8 @@ GEM tzinfo (~> 1.1) arel (6.0.4) awesome_print (1.9.2) + base64 (0.3.0) + bigdecimal (4.0.1) builder (3.2.4) concurrent-ruby (1.2.2) diff-lcs (1.5.0) @@ -30,6 +35,7 @@ GEM i18n (0.9.5) concurrent-ruby (~> 1.0) minitest (5.11.3) + mutex_m (0.3.0) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) diff --git a/chamber.gemspec b/chamber.gemspec index 6638d54..cfe7a72 100644 --- a/chamber.gemspec +++ b/chamber.gemspec @@ -31,6 +31,10 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.2.4' + spec.add_dependency 'base64', ["~> 0.3"] + spec.add_dependency 'bigdecimal', ["~> 4.0"] + spec.add_dependency 'mutex_m', ["~> 0.3"] + spec.add_dependency 'thor', [">= 0.20.3", "< 2.0"] spec.add_development_dependency 'rspec', ["~> 3.5"] From af0c5c069fc682c0eb867bfd274b5bc2cb742fb7 Mon Sep 17 00:00:00 2001 From: Jeff Felchner Date: Tue, 6 Jan 2026 16:59:05 -0600 Subject: [PATCH 3/3] Chore: Upgrade Rubocop --- .github/workflows/linting.yml | 6 +- .rubocop_capybara.yml | 13 +- .rubocop_core.yml | 159 +++++++++++++++++- .rubocop_factory_bot.yml | 2 +- .rubocop_performance.yml | 10 +- .rubocop_rspec.yml | 13 +- .rubocop_rspec_rails.yml | 2 +- .rubocop_thread_safety.yml | 2 +- lib/chamber/binary/runner.rb | 16 +- lib/chamber/commands/securable.rb | 2 +- lib/chamber/commands/secure.rb | 2 +- lib/chamber/commands/unsecure.rb | 2 +- lib/chamber/encryption_methods/ssl.rb | 4 +- lib/chamber/file_set.rb | 16 +- lib/chamber/files/signature.rb | 10 +- lib/chamber/filters/decryption_filter.rb | 4 +- lib/chamber/filters/encryption_filter.rb | 6 +- .../filters/failed_decryption_filter.rb | 2 +- lib/chamber/filters/insecure_filter.rb | 6 +- lib/chamber/instance.rb | 24 ++- lib/chamber/key_pair.rb | 2 +- lib/chamber/keys/decryption.rb | 2 +- lib/chamber/keys/encryption.rb | 2 +- lib/chamber/namespace_set.rb | 2 - lib/chamber/rubinius_fix.rb | 2 +- lib/chamber/settings.rb | 42 ++--- spec/lib/chamber/commands/secure_spec.rb | 4 +- spec/lib/chamber/commands/show_spec.rb | 4 +- spec/lib/chamber/commands/sign_spec.rb | 4 +- spec/lib/chamber/commands/unsecure_spec.rb | 4 +- spec/lib/chamber/commands/verify_spec.rb | 4 +- spec/lib/chamber/file_set_spec.rb | 6 +- .../chamber/filters/decryption_filter_spec.rb | 32 ++-- .../chamber/filters/encryption_filter_spec.rb | 6 +- .../filters/environment_filter_spec.rb | 22 +-- .../chamber/filters/insecure_filter_spec.rb | 2 +- 36 files changed, 296 insertions(+), 145 deletions(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 07270e0..74f43ea 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -176,6 +176,6 @@ jobs: run: | yamllint -f "github" -d ".yamllint" . - - name: "Run Remark" - run: | - remark --ignore-path .markdownlintignore --silently-ignore **/*.md .**/*.md + # - name: "Run Remark" + # run: | + # remark --ignore-path .markdownlintignore --silently-ignore **/*.md .**/*.md diff --git a/.rubocop_capybara.yml b/.rubocop_capybara.yml index 2e658bd..6a8d23b 100644 --- a/.rubocop_capybara.yml +++ b/.rubocop_capybara.yml @@ -1,10 +1,13 @@ --- -# Last updated to 2.21.0 +# Last updated to 2.22.1 -require: +plugins: - 'rubocop-capybara' +Capybara/AmbiguousClick: + Enabled: true + Capybara/ClickLinkOrButtonStyle: Enabled: true EnforcedStyle: 'link_or_button' @@ -12,6 +15,9 @@ Capybara/ClickLinkOrButtonStyle: Capybara/CurrentPathExpectation: Enabled: true +Capybara/FindAllFirst: + Enabled: true + Capybara/MatchStyle: Enabled: true @@ -19,6 +25,9 @@ Capybara/NegationMatcher: Enabled: true EnforcedStyle: 'have_no' +Capybara/NegationMatcherAfterVisit: + Enabled: true + Capybara/RedundantWithinFind: Enabled: true diff --git a/.rubocop_core.yml b/.rubocop_core.yml index e5300b6..96e18ef 100644 --- a/.rubocop_core.yml +++ b/.rubocop_core.yml @@ -1,6 +1,6 @@ --- -# Last updated to rubocop 1.66.0 +# Last updated to rubocop 1.82.1 AllCops: Include: @@ -136,6 +136,11 @@ Gemspec/AddRuntimeDependency: Include: - '**/*.gemspec' +Gemspec/AttributeAssignment: + Enabled: true + Include: + - '**/*.gemspec' + Gemspec/DependencyVersion: Enabled: true EnforcedStyle: 'required' @@ -325,6 +330,9 @@ Layout/EmptyLineAfterMagicComment: Layout/EmptyLineAfterMultilineCondition: Enabled: true +Layout/EmptyLinesAfterModuleInclusion: + Enabled: true + Layout/EmptyLinesAroundAttributeAccessor: Enabled: true AllowAliasSyntax: false @@ -422,6 +430,7 @@ Layout/FirstMethodArgumentLineBreak: # bar) Enabled: false AllowMultilineFinalElement: false + AllowedMethods: [] Layout/FirstMethodParameterLineBreak: # Disallows: def my_method(foo, @@ -464,6 +473,10 @@ Layout/InitialIndentation: Layout/LeadingCommentSpace: Enabled: true + AllowDoxygenCommentStyle: false + AllowGemfileRubyComment: true + AllowRBSInlineAnnotation: false + AllowSteepAnnotation: false Layout/LeadingEmptyLines: Enabled: true @@ -487,7 +500,8 @@ Layout/LineLength: Max: 90 AllowHeredoc: true AllowURI: true - IgnoreCopDirectives: true + AllowCopDirectives: true + AllowRBSInlineAnnotation: false AllowedPatterns: - "\\s+raise_error\\([^)]+\\)$" # raise_error(LongClassName) - "^(\\s+|.*)'[^']+'\\s+=\\>\\s+'[^']+',$" # 'foo' => 'really_long_string', @@ -744,6 +758,9 @@ Lint/AmbiguousRange: Lint/AmbiguousRegexpLiteral: Enabled: true +Lint/ArrayLiteralInRegexp: + Enabled: true + Lint/AssignmentInCondition: Enabled: true AllowSafeAssignment: true @@ -768,12 +785,18 @@ Lint/ConstantDefinitionInBlock: Lint/ConstantOverwrittenInRescue: Enabled: true +Lint/ConstantReassignment: + Enabled: true + Lint/ConstantResolution: Enabled: false Only: [] Ignore: - 'ENV' +Lint/CopDirectiveSyntax: + Enabled: true + Lint/Debugger: Enabled: true @@ -793,6 +816,7 @@ Lint/DuplicateBranch: Enabled: true IgnoreLiteralBranches: true IgnoreConstantBranches: true + IgnoreDuplicateElseBranch: true Lint/DuplicateElsifCondition: Enabled: true @@ -818,6 +842,9 @@ Lint/DuplicateRequire: Lint/DuplicateRescueException: Enabled: true +Lint/DuplicateSetElement: + Enabled: true + Lint/EachWithObjectArgument: Enabled: true @@ -881,6 +908,9 @@ Lint/FormatParameterMismatch: Lint/HashCompareByIdentity: Enabled: true +Lint/HashNewWithKeywordArgumentsAsDefault: + Enabled: true + Lint/HeredocMethodCallPosition: Enabled: true @@ -974,6 +1004,9 @@ Lint/NumberConversion: Lint/NumberedParameterAssignment: Enabled: true +Lint/NumericOperationWithConstantResult: + Enabled: true + Lint/OrAssignmentToConstant: Enabled: true @@ -1015,6 +1048,7 @@ Lint/RedundantRequireStatement: Lint/RedundantSafeNavigation: Enabled: true + InferNonNilReceiver: true AllowedMethods: - 'eql?' - 'equal?' @@ -1030,6 +1064,9 @@ Lint/RedundantSplatExpansion: Lint/RedundantStringCoercion: Enabled: true +Lint/RedundantTypeConversion: + Enabled: true + Lint/RedundantWithIndex: Enabled: true @@ -1089,6 +1126,9 @@ Lint/ShadowedException: Lint/ShadowingOuterLocalVariable: Enabled: true +Lint/SharedMutableDefault: + Enabled: true + Lint/StructNewOverride: Enabled: true @@ -1096,6 +1136,9 @@ Lint/SuppressedException: Enabled: true AllowComments: true +Lint/SuppressedExceptionInNumberConversion: + Enabled: true + Lint/SymbolConversion: Enabled: true @@ -1119,6 +1162,9 @@ Lint/TripleQuotes: Lint/UnderscorePrefixedVariableName: Enabled: true +Lint/UnescapedBracketInRegexp: + Enabled: true + Lint/UnexpectedBlockArity: Enabled: true Methods: @@ -1155,6 +1201,7 @@ Lint/UnusedMethodArgument: AllowUnusedKeywordArguments: true IgnoreEmptyMethods: true IgnoreNotImplementedMethods: true + NotImplementedExceptions: [] Lint/UriEscapeUnescape: Enabled: true @@ -1168,6 +1215,15 @@ Lint/UselessAccessModifier: Lint/UselessAssignment: Enabled: true +Lint/UselessConstantScoping: + Enabled: true + +Lint/UselessDefaultValueArgument: + Enabled: true + +Lint/UselessDefined: + Enabled: true + Lint/UselessElseWithoutRescue: Enabled: true @@ -1177,6 +1233,9 @@ Lint/UselessMethodDefinition: Lint/UselessNumericOperation: Enabled: true +Lint/UselessOr: + Enabled: true + Lint/UselessRescue: Enabled: true @@ -1284,6 +1343,7 @@ Metrics/MethodLength: CountComments: false Max: 30 AllowedMethods: [] + AllowedPatterns: [] CountAsOne: - 'array' - 'hash' @@ -1377,6 +1437,10 @@ Naming/MethodName: Enabled: true EnforcedStyle: 'snake_case' AllowedPatterns: [] + ForbiddenIdentifiers: + - '__id__' + - '__send__' + ForbiddenPatterns: [] Naming/MethodParameterName: Enabled: true @@ -1400,22 +1464,35 @@ Naming/MethodParameterName: - 'to' ForbiddenNames: [] -Naming/PredicateName: +Naming/PredicateMethod: + Enabled: true + Mode: 'aggressive' + AllowedMethods: + - 'call' + AllowedPatterns: [] + AllowBangMethods: false + WaywardPredicates: + - 'nonzero?' + +Naming/PredicatePrefix: Enabled: true AllowedMethods: - 'is_a?' ForbiddenPrefixes: + - 'does_' + - 'have_' - 'is_' - 'was_' - - 'have_' MethodDefinitionMacros: - 'define_method' - 'define_singleton_method' NamePrefix: - - 'is_' - - 'was_' + - 'does_' - 'has_' - 'have_' + - 'is_' + - 'was_' + UseSorbetSigs: false Exclude: - '/**/spec/**/*.rb' @@ -1427,6 +1504,9 @@ Naming/VariableName: Enabled: true EnforcedStyle: 'snake_case' AllowedIdentifiers: [] + AllowedPatterns: [] + ForbiddenIdentifiers: [] + ForbiddenPatterns: [] Naming/VariableNumber: Enabled: true @@ -1490,6 +1570,7 @@ Style/AccessModifierDeclarations: EnforcedStyle: 'group' AllowModifiersOnSymbols: true AllowModifiersOnAttrs: true + AllowModifiersOnAliasMethod: true Style/AccessorGrouping: Enabled: true @@ -1499,6 +1580,9 @@ Style/Alias: Enabled: true EnforcedStyle: 'prefer_alias' +Style/AmbiguousEndlessMethodDefinition: + Enabled: true + Style/AndOr: Enabled: true EnforcedStyle: 'always' @@ -1516,7 +1600,6 @@ Style/ArgumentsForwarding: - 'options' - 'opts' RedundantRestArgumentNames: - - 'args' - 'arguments' Style/ArrayCoercion: @@ -1532,6 +1615,9 @@ Style/ArrayJoin: Style/ArrayIntersect: Enabled: true +Style/ArrayIntersectWithSingleElement: + Enabled: true + Style/AsciiComments: Enabled: true AllowedChars: @@ -1553,6 +1639,9 @@ Style/BeginBlock: Style/BisectedAttrAccessor: Enabled: true +Style/BitwisePredicate: + Enabled: true + Style/BlockComments: Enabled: true @@ -1579,6 +1668,8 @@ Style/CharacterLiteral: Style/ClassAndModuleChildren: Enabled: true EnforcedStyle: 'nested' + EnforcedStyleForClasses: null + EnforcedStyleForModules: null Style/ClassCheck: Enabled: true @@ -1616,12 +1707,18 @@ Style/CollectionMethods: member?: 'include?' reduce: 'inject' +Style/CollectionQuerying: + Enabled: true + Style/ColonMethodCall: Enabled: true Style/ColonMethodDefinition: Enabled: true +Style/CombinableDefined: + Enabled: true + Style/CombinableLoops: Enabled: true @@ -1645,6 +1742,9 @@ Style/CommentedKeyword: Exclude: - '/**/Gemfile' +Style/ComparableBetween: + Enabled: true + Style/ComparableClamp: Enabled: true @@ -1672,6 +1772,9 @@ Style/DataInheritance: Style/DefWithParentheses: Enabled: true +Style/DigChain: + Enabled: true + Style/Dir: Enabled: true @@ -1727,6 +1830,10 @@ Style/EmptyMethod: Enabled: true EnforcedStyle: 'compact' +Style/EmptyStringInsideInterpolation: + Enabled: true + EnforcedStyle: 'trailing_conditional' + Style/Encoding: Enabled: true @@ -1762,13 +1869,20 @@ Style/ExactRegexpMatch: Style/FetchEnvVar: Enabled: true AllowedVars: [] + DefaultToNil: true Style/FileEmpty: Enabled: true +Style/FileNull: + Enabled: true + Style/FileRead: Enabled: true +Style/FileTouch: + Enabled: true + Style/FileWrite: Enabled: true @@ -1824,10 +1938,16 @@ Style/HashEachMethods: Style/HashExcept: Enabled: true +Style/HashFetchChain: + Enabled: true + Style/HashLikeCase: Enabled: true MinBranchesCount: 1 +Style/HashSlice: + Enabled: true + Style/HashSyntax: Enabled: true EnforcedStyle: 'ruby19' @@ -1926,6 +2046,16 @@ Style/IpAddresses: - '/**/spec/**/factories/**/*.rb' - '/**/spec/factories.rb' +Style/ItAssignment: + Enabled: true + +Style/ItBlockParameter: + Enabled: true + EnforcedStyle: 'disallow' + +Style/KeywordArgumentsMerging: + Enabled: true + Style/KeywordParametersOrder: Enabled: true @@ -1972,6 +2102,7 @@ Style/MethodCallWithArgsParentheses: - 'puts' AllowedPatterns: [] IncludedMacros: [] + IncludedMacroPatterns: [] Style/MethodCallWithoutArgsParentheses: Enabled: true @@ -2012,6 +2143,9 @@ Style/ModuleFunction: Enabled: true EnforcedStyle: 'module_function' +Style/ModuleMemberExistenceCheck: + Enabled: true + Style/MultilineBlockChain: Enabled: true Exclude: @@ -2096,6 +2230,7 @@ Style/Next: Enabled: true EnforcedStyle: 'skip_modifier_ifs' MinBodyLength: 3 + AllowConsecutiveConditionals: false Style/NilComparison: Enabled: true @@ -2227,6 +2362,9 @@ Style/RedundantArgument: Style/RedundantArrayConstructor: Enabled: true +Style/RedundantArrayFlatten: + Enabled: true + Style/RedundantAssignment: Enabled: true @@ -2266,6 +2404,9 @@ Style/RedundantFileExtensionInRequire: Style/RedundantFilterChain: Enabled: true +Style/RedundantFormat: + Enabled: true + Style/RedundantFreeze: Enabled: true @@ -2356,6 +2497,10 @@ Style/SafeNavigation: - 'try!' - 'try' +Style/SafeNavigationChainLength: + Enabled: true + Max: 2 + Style/Sample: Enabled: true diff --git a/.rubocop_factory_bot.yml b/.rubocop_factory_bot.yml index a0d8c1f..9c47c47 100644 --- a/.rubocop_factory_bot.yml +++ b/.rubocop_factory_bot.yml @@ -2,7 +2,7 @@ # Last updated to 2.26.1 -require: +plugins: - 'rubocop-factory_bot' FactoryBot/AssociationStyle: diff --git a/.rubocop_performance.yml b/.rubocop_performance.yml index cf6bbbf..b3939fb 100644 --- a/.rubocop_performance.yml +++ b/.rubocop_performance.yml @@ -1,8 +1,8 @@ --- -# Last updated to 1.22.1 +# Last updated to 1.26.1 -require: +plugins: - 'rubocop-performance' ################################################################################ @@ -148,6 +148,9 @@ Performance/Squeeze: Performance/StartWith: Enabled: true +Performance/StringBytesize: + Enabled: true + Performance/StringIdentifierArgument: Enabled: true @@ -170,3 +173,6 @@ Performance/UnfreezeString: Performance/UriDefaultParser: Enabled: true + +Performance/ZipWithoutBlock: + Enabled: true diff --git a/.rubocop_rspec.yml b/.rubocop_rspec.yml index d127382..d0afd99 100644 --- a/.rubocop_rspec.yml +++ b/.rubocop_rspec.yml @@ -1,8 +1,8 @@ --- -# Last updated to 3.0.5 +# Last updated to 3.7.0 -require: +plugins: - 'rubocop-rspec' RSpec/AlignLeftLetBrace: @@ -120,8 +120,6 @@ RSpec/EmptyLineAfterHook: RSpec/EmptyLineAfterSubject: Enabled: true - Exclude: - - '**/factories/*.rb' RSpec/EmptyMetadata: Enabled: true @@ -193,6 +191,9 @@ RSpec/ImplicitSubject: Enabled: true EnforcedStyle: 'single_statement_only' +RSpec/IncludeExamples: + Enabled: true + RSpec/IndexedLet: Enabled: true AllowedIdentifiers: [] @@ -221,6 +222,9 @@ RSpec/LeadingSubject: RSpec/LeakyConstantDeclaration: Enabled: true +RSpec/LeakyLocalVariable: + Enabled: true + RSpec/LetBeforeExamples: Enabled: true @@ -395,7 +399,6 @@ RSpec/VariableName: RSpec/VerifiedDoubleReference: Enabled: true - EnforcedStyle: 'string' RSpec/VerifiedDoubles: Enabled: true diff --git a/.rubocop_rspec_rails.yml b/.rubocop_rspec_rails.yml index a742053..50a7160 100644 --- a/.rubocop_rspec_rails.yml +++ b/.rubocop_rspec_rails.yml @@ -2,7 +2,7 @@ # Last updated to 2.29.0 -require: +plugins: - 'rubocop-rspec_rails' RSpecRails/AvoidSetupHook: diff --git a/.rubocop_thread_safety.yml b/.rubocop_thread_safety.yml index 25f2059..971bd17 100644 --- a/.rubocop_thread_safety.yml +++ b/.rubocop_thread_safety.yml @@ -2,7 +2,7 @@ # Last updated to 0.5.1 -require: +plugins: - 'rubocop-thread_safety' ThreadSafety/ClassAndModuleAttributes: diff --git a/lib/chamber/binary/runner.rb b/lib/chamber/binary/runner.rb index 1c3c4c1..108e1d6 100644 --- a/lib/chamber/binary/runner.rb +++ b/lib/chamber/binary/runner.rb @@ -75,7 +75,7 @@ class Runner < Thor 'Useful for debugging.' def show - puts Commands::Show.call(**options.transform_keys(&:to_sym).merge(shell: self)) + puts Commands::Show.call(**options.transform_keys(&:to_sym), shell: self) end ################################################################################ @@ -83,7 +83,7 @@ def show desc 'files', 'Lists the settings files which are parsed with the given options' def files - puts Commands::Files.call(**options.transform_keys(&:to_sym).merge(shell: self)) + puts Commands::Files.call(**options.transform_keys(&:to_sym), shell: self) end ################################################################################ @@ -113,7 +113,7 @@ def files 'destination of the comparison' def compare - Commands::Compare.call(**options.transform_keys(&:to_sym).merge(shell: self)) + Commands::Compare.call(**options.transform_keys(&:to_sym), shell: self) end ################################################################################ @@ -133,7 +133,7 @@ def compare 'what values would be encrypted' def secure - Commands::Secure.call(**options.transform_keys(&:to_sym).merge(shell: self)) + Commands::Secure.call(**options.transform_keys(&:to_sym), shell: self) end ################################################################################ @@ -148,7 +148,7 @@ def secure 'what values would be decrypted' def unsecure - Commands::Unsecure.call(**options.transform_keys(&:to_sym).merge(shell: self)) + Commands::Unsecure.call(**options.transform_keys(&:to_sym), shell: self) end ################################################################################ @@ -167,9 +167,9 @@ def unsecure def sign if options[:verify] - Commands::Verify.call(**options.transform_keys(&:to_sym).merge(shell: self)) + Commands::Verify.call(**options.transform_keys(&:to_sym), shell: self) else - Commands::Sign.call(**options.transform_keys(&:to_sym).merge(shell: self)) + Commands::Sign.call(**options.transform_keys(&:to_sym), shell: self) end end @@ -183,7 +183,7 @@ def sign default: false def init - Commands::Initialize.call(**options.transform_keys(&:to_sym).merge(shell: self)) + Commands::Initialize.call(**options.transform_keys(&:to_sym), shell: self) end end end diff --git a/lib/chamber/commands/securable.rb b/lib/chamber/commands/securable.rb index 5835968..52d6692 100644 --- a/lib/chamber/commands/securable.rb +++ b/lib/chamber/commands/securable.rb @@ -11,7 +11,7 @@ def initialize(only_sensitive: nil, **args) ignored_settings_options = args .merge(files: ignored_settings_filepaths) - .reject { |k, _v| k == 'basepath' } + .except('basepath') self.ignored_settings_instance = Chamber::Instance.new(**ignored_settings_options) self.current_settings_instance = Chamber::Instance.new(**args) self.only_sensitive = only_sensitive diff --git a/lib/chamber/commands/secure.rb b/lib/chamber/commands/secure.rb index 3a1347b..7c18c2b 100644 --- a/lib/chamber/commands/secure.rb +++ b/lib/chamber/commands/secure.rb @@ -27,7 +27,7 @@ def call private def disable_warnings - $stderr = ::File.open('/dev/null', 'w') + $stderr = ::File.open(::File::NULL, 'w') yield diff --git a/lib/chamber/commands/unsecure.rb b/lib/chamber/commands/unsecure.rb index 59a5e10..768cd5a 100644 --- a/lib/chamber/commands/unsecure.rb +++ b/lib/chamber/commands/unsecure.rb @@ -27,7 +27,7 @@ def call private def disable_warnings - $stderr = ::File.open('/dev/null', 'w') + $stderr = ::File.open(::File::NULL, 'w') yield diff --git a/lib/chamber/encryption_methods/ssl.rb b/lib/chamber/encryption_methods/ssl.rb index 953c537..25a0342 100644 --- a/lib/chamber/encryption_methods/ssl.rb +++ b/lib/chamber/encryption_methods/ssl.rb @@ -5,7 +5,7 @@ module Chamber module EncryptionMethods class Ssl - BASE64_STRING_PATTERN = %r{[A-Za-z0-9+/#]*={0,2}}.freeze + BASE64_STRING_PATTERN = %r{[A-Za-z0-9+/#]*={0,2}} LARGE_DATA_STRING_PATTERN = / \A (#{BASE64_STRING_PATTERN}) @@ -14,7 +14,7 @@ class Ssl \# (#{BASE64_STRING_PATTERN}) \z - /x.freeze + /x def self.encrypt(_settings_key, value, encryption_keys) # rubocop:disable Metrics/AbcSize value = YAML.dump(value) diff --git a/lib/chamber/file_set.rb b/lib/chamber/file_set.rb index ebd190c..97119f9 100644 --- a/lib/chamber/file_set.rb +++ b/lib/chamber/file_set.rb @@ -293,15 +293,13 @@ def namespaced_files end def relevant_namespaced_files - file_holder = [] - - namespaces.each do |namespace| - file_holder << namespaced_files.select do |file| - file.basename.fnmatch? "*-#{namespace}.???" - end - end - - file_holder.flatten + namespaces + .map { |namespace| + namespaced_files.select do |file| + file.basename.fnmatch? "*-#{namespace}.???" + end + } + .flatten end end end diff --git a/lib/chamber/files/signature.rb b/lib/chamber/files/signature.rb index f1f79dc..8ba5acc 100644 --- a/lib/chamber/files/signature.rb +++ b/lib/chamber/files/signature.rb @@ -8,14 +8,14 @@ module Chamber module Files class Signature SIGNATURE_HEADER = '-----BEGIN CHAMBER SIGNATURE-----' - SIGNATURE_HEADER_PATTERN = /-----BEGIN\sCHAMBER\sSIGNATURE-----/.freeze + SIGNATURE_HEADER_PATTERN = /-----BEGIN\sCHAMBER\sSIGNATURE-----/ SIGNATURE_FOOTER = '-----END CHAMBER SIGNATURE-----' - SIGNATURE_FOOTER_PATTERN = /-----END\sCHAMBER\sSIGNATURE-----/.freeze + SIGNATURE_FOOTER_PATTERN = /-----END\sCHAMBER\sSIGNATURE-----/ SIGNATURE_IN_FILE_PATTERN = / #{SIGNATURE_HEADER_PATTERN}\n # Header (.*)\n # Signature Body #{SIGNATURE_FOOTER_PATTERN} # Footer - /x.freeze + /x attr_accessor :settings_content, :settings_filename, @@ -77,8 +77,8 @@ def encoded_signature_content @encoded_signature_content ||= signature_filename .read .match(SIGNATURE_IN_FILE_PATTERN) do |match| - match[1] - end + match[1] + end end def signature_content diff --git a/lib/chamber/filters/decryption_filter.rb b/lib/chamber/filters/decryption_filter.rb index ff9e93a..db85ba5 100644 --- a/lib/chamber/filters/decryption_filter.rb +++ b/lib/chamber/filters/decryption_filter.rb @@ -14,7 +14,7 @@ module Filters class DecryptionFilter using ::Chamber::Refinements::DeepDup - BASE64_STRING_PATTERN = %r{\A[A-Za-z0-9+/]{342}==\z}.freeze + BASE64_STRING_PATTERN = %r{\A[A-Za-z0-9+/]{342}==\z} LARGE_DATA_STRING_PATTERN = %r{ \A # Beginning of String ( @@ -29,7 +29,7 @@ class DecryptionFilter [A-Za-z0-9+/#]*={0,2} # Base64 Encoded Data ) \z # End of String - }x.freeze + }x attr_accessor :data, :secure_key_token diff --git a/lib/chamber/filters/encryption_filter.rb b/lib/chamber/filters/encryption_filter.rb index ebfef26..3860b15 100644 --- a/lib/chamber/filters/encryption_filter.rb +++ b/lib/chamber/filters/encryption_filter.rb @@ -12,8 +12,8 @@ module Filters class EncryptionFilter using ::Chamber::Refinements::DeepDup - BASE64_STRING_PATTERN = %r{\A[A-Za-z0-9+/]{342}==\z}.freeze - BASE64_SUBSTRING_PATTERN = %r{[A-Za-z0-9+/#]*={0,2}}.freeze + BASE64_STRING_PATTERN = %r{\A[A-Za-z0-9+/]{342}==\z} + BASE64_SUBSTRING_PATTERN = %r{[A-Za-z0-9+/#]*={0,2}} LARGE_DATA_STRING_PATTERN = / \A (#{BASE64_SUBSTRING_PATTERN}) @@ -22,7 +22,7 @@ class EncryptionFilter \# (#{BASE64_SUBSTRING_PATTERN}) \z - /x.freeze + /x attr_accessor :data, :secure_key_token diff --git a/lib/chamber/filters/failed_decryption_filter.rb b/lib/chamber/filters/failed_decryption_filter.rb index 6f6cae4..525c6a0 100644 --- a/lib/chamber/filters/failed_decryption_filter.rb +++ b/lib/chamber/filters/failed_decryption_filter.rb @@ -8,7 +8,7 @@ module Filters class FailedDecryptionFilter using ::Chamber::Refinements::DeepDup - BASE64_STRING_PATTERN = %r{\A[A-Za-z0-9+/]{342}==\z}.freeze + BASE64_STRING_PATTERN = %r{\A[A-Za-z0-9+/]{342}==\z} attr_accessor :data, :secure_key_token diff --git a/lib/chamber/filters/insecure_filter.rb b/lib/chamber/filters/insecure_filter.rb index d37f8bc..784444d 100644 --- a/lib/chamber/filters/insecure_filter.rb +++ b/lib/chamber/filters/insecure_filter.rb @@ -5,8 +5,8 @@ module Chamber module Filters class InsecureFilter < SecureFilter - BASE64_STRING_PATTERN = %r{\A[A-Za-z0-9+/]{342}==\z}.freeze - BASE64_SUBSTRING_PATTERN = %r{[A-Za-z0-9+/#]*={0,2}}.freeze + BASE64_STRING_PATTERN = %r{\A[A-Za-z0-9+/]{342}==\z} + BASE64_SUBSTRING_PATTERN = %r{[A-Za-z0-9+/#]*={0,2}} LARGE_DATA_STRING_PATTERN = / \A (#{BASE64_SUBSTRING_PATTERN}) @@ -15,7 +15,7 @@ class InsecureFilter < SecureFilter \# (#{BASE64_SUBSTRING_PATTERN}) \z - /x.freeze + /x protected diff --git a/lib/chamber/instance.rb b/lib/chamber/instance.rb index 9b5d538..1558fe6 100644 --- a/lib/chamber/instance.rb +++ b/lib/chamber/instance.rb @@ -71,11 +71,10 @@ def encrypt(data, **args) Settings .new( - **config.merge( - settings: data, - pre_filters: [Filters::EncryptionFilter], - post_filters: [], - ), + **config, + settings: data, + pre_filters: [Filters::EncryptionFilter], + post_filters: [], ) .to_hash end @@ -85,14 +84,13 @@ def decrypt(data, **args) Settings .new( - **config.merge( - settings: data, - pre_filters: [Filters::NamespaceFilter], - post_filters: [ - Filters::DecryptionFilter, - Filters::FailedDecryptionFilter, - ], - ), + **config, + settings: data, + pre_filters: [Filters::NamespaceFilter], + post_filters: [ + Filters::DecryptionFilter, + Filters::FailedDecryptionFilter, + ], ) .to_hash end diff --git a/lib/chamber/key_pair.rb b/lib/chamber/key_pair.rb index 6ef00b2..610124a 100644 --- a/lib/chamber/key_pair.rb +++ b/lib/chamber/key_pair.rb @@ -77,7 +77,7 @@ def encryption_cipher def base_key_filename @base_key_filename ||= [ '.chamber', - namespace ? namespace.tr('-.', '') : nil, + namespace&.tr('-.', ''), ] .compact .join('.') diff --git a/lib/chamber/keys/decryption.rb b/lib/chamber/keys/decryption.rb index 2e41ae3..905ad7b 100644 --- a/lib/chamber/keys/decryption.rb +++ b/lib/chamber/keys/decryption.rb @@ -13,7 +13,7 @@ class Decryption < Chamber::Keys::Base (\w+) # Namespace \.pem # Extension \z # End of Filename - /x.freeze + /x private diff --git a/lib/chamber/keys/encryption.rb b/lib/chamber/keys/encryption.rb index aad1e30..f5c1081 100644 --- a/lib/chamber/keys/encryption.rb +++ b/lib/chamber/keys/encryption.rb @@ -13,7 +13,7 @@ class Encryption < Chamber::Keys::Base (\w+) # Namespace \.pub\.pem # Extension \z # End of Filename - /x.freeze + /x private diff --git a/lib/chamber/namespace_set.rb b/lib/chamber/namespace_set.rb index a3708d4..5f802a9 100644 --- a/lib/chamber/namespace_set.rb +++ b/lib/chamber/namespace_set.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'set' - ### # Internal: Respresents a set of namespaces which will be processed by Chamber # at various stages when settings are loaded. diff --git a/lib/chamber/rubinius_fix.rb b/lib/chamber/rubinius_fix.rb index bcb1fd7..fa274ba 100644 --- a/lib/chamber/rubinius_fix.rb +++ b/lib/chamber/rubinius_fix.rb @@ -2,7 +2,7 @@ require 'pathname' -unless Pathname.instance_methods.include?(:write) +unless Pathname.method_defined?(:write) class Pathname def write(*args) IO.write @path, *args # rubocop:disable Security/IoMethods diff --git a/lib/chamber/settings.rb b/lib/chamber/settings.rb index fde9f63..7a5eb57 100644 --- a/lib/chamber/settings.rb +++ b/lib/chamber/settings.rb @@ -48,7 +48,6 @@ def initialize( settings: {}, **_args ) - ::Chamber::Refinements::Enumerable.deep_validate_keys(settings, &:to_s) self.decryption_keys = (decryption_keys || {}).transform_keys(&:to_s) @@ -272,41 +271,36 @@ def dig(*args) end def securable - Settings.new(**metadata.merge( - settings: raw_data, - pre_filters: [Filters::SecureFilter], - )) + Settings.new(**metadata, + settings: raw_data, + pre_filters: [Filters::SecureFilter]) end def secure - Settings.new(**metadata.merge( - settings: raw_data, - pre_filters: [Filters::EncryptionFilter], - post_filters: [Filters::TranslateSecureKeysFilter], - )) + Settings.new(**metadata, + settings: raw_data, + pre_filters: [Filters::EncryptionFilter], + post_filters: [Filters::TranslateSecureKeysFilter]) end def decrypted - Settings.new(**metadata.merge( - settings: raw_data, - post_filters: [Filters::DecryptionFilter], - )) + Settings.new(**metadata, + settings: raw_data, + post_filters: [Filters::DecryptionFilter]) end def encrypted - Settings.new(**metadata.merge( - settings: raw_data, - pre_filters: [Filters::EncryptionFilter], - post_filters: [], - )) + Settings.new(**metadata, + settings: raw_data, + pre_filters: [Filters::EncryptionFilter], + post_filters: []) end def insecure - Settings.new(**metadata.merge( - settings: raw_data, - pre_filters: [Filters::InsecureFilter], - post_filters: [Filters::TranslateSecureKeysFilter], - )) + Settings.new(**metadata, + settings: raw_data, + pre_filters: [Filters::InsecureFilter], + post_filters: [Filters::TranslateSecureKeysFilter]) end protected diff --git a/spec/lib/chamber/commands/secure_spec.rb b/spec/lib/chamber/commands/secure_spec.rb index 65e2efd..381e497 100644 --- a/spec/lib/chamber/commands/secure_spec.rb +++ b/spec/lib/chamber/commands/secure_spec.rb @@ -20,11 +20,11 @@ module Commands end before(:each) do - ::FileUtils.mkdir_p settings_directory unless ::File.exist? settings_directory + ::FileUtils.mkdir_p settings_directory end after(:each) do - ::FileUtils.rm_rf(settings_directory) if ::File.exist? settings_directory + ::FileUtils.rm_rf(settings_directory) end it 'can return values formatted as environment variables' do diff --git a/spec/lib/chamber/commands/show_spec.rb b/spec/lib/chamber/commands/show_spec.rb index da0fdce..07c51d1 100644 --- a/spec/lib/chamber/commands/show_spec.rb +++ b/spec/lib/chamber/commands/show_spec.rb @@ -17,7 +17,7 @@ module Commands end it 'can return values formatted as environment variables' do - expect(Show.call(**options.merge(as_env: true))) + expect(Show.call(**options, as_env: true)) .to eql( <<~HEREDOC.chomp) ANOTHER_LEVEL_LEVEL_THREE_A_SCALAR="hello" @@ -32,7 +32,7 @@ module Commands end it 'can return values filtered by whether or not they are secure' do - expect(Show.call(**options.merge(as_env: true, only_sensitive: true))) + expect(Show.call(**options, as_env: true, only_sensitive: true)) .to eql( <<~HEREDOC.chomp) MY_SECURE_SETTINGS="my_secure_value" diff --git a/spec/lib/chamber/commands/sign_spec.rb b/spec/lib/chamber/commands/sign_spec.rb index 0e9550f..6e2f3b3 100644 --- a/spec/lib/chamber/commands/sign_spec.rb +++ b/spec/lib/chamber/commands/sign_spec.rb @@ -23,11 +23,11 @@ module Commands end before(:each) do - ::FileUtils.mkdir_p settings_directory unless ::File.exist? settings_directory + ::FileUtils.mkdir_p settings_directory end after(:each) do - ::FileUtils.rm_rf(settings_directory) if ::File.exist? settings_directory + ::FileUtils.rm_rf(settings_directory) end it 'can generate signature files', :time_mock do diff --git a/spec/lib/chamber/commands/unsecure_spec.rb b/spec/lib/chamber/commands/unsecure_spec.rb index 31fc772..82aeb0e 100644 --- a/spec/lib/chamber/commands/unsecure_spec.rb +++ b/spec/lib/chamber/commands/unsecure_spec.rb @@ -20,11 +20,11 @@ module Commands end before(:each) do - ::FileUtils.mkdir_p settings_directory unless ::File.exist? settings_directory + ::FileUtils.mkdir_p settings_directory end after(:each) do - ::FileUtils.rm_rf(settings_directory) if ::File.exist? settings_directory + ::FileUtils.rm_rf(settings_directory) end it 'can return values formatted as environment variables' do diff --git a/spec/lib/chamber/commands/verify_spec.rb b/spec/lib/chamber/commands/verify_spec.rb index 2ba0de0..80025e0 100644 --- a/spec/lib/chamber/commands/verify_spec.rb +++ b/spec/lib/chamber/commands/verify_spec.rb @@ -23,11 +23,11 @@ module Commands end before(:each) do - ::FileUtils.mkdir_p settings_directory unless ::File.exist? settings_directory + ::FileUtils.mkdir_p settings_directory end after(:each) do - ::FileUtils.rm_rf(settings_directory) if ::File.exist? settings_directory + ::FileUtils.rm_rf(settings_directory) end it 'can generate signature files', :time_mock do diff --git a/spec/lib/chamber/file_set_spec.rb b/spec/lib/chamber/file_set_spec.rb index f144bcd..e02a630 100644 --- a/spec/lib/chamber/file_set_spec.rb +++ b/spec/lib/chamber/file_set_spec.rb @@ -7,11 +7,11 @@ module Chamber describe FileSet do before(:each) do - ::FileUtils.mkdir('/tmp/settings') unless ::File.exist?('/tmp/settings') - ::FileUtils.mkdir('/tmp/dash-set') unless ::File.exist?('/tmp/dash-set') + ::FileUtils.mkdir_p('/tmp/settings') + ::FileUtils.mkdir_p('/tmp/dash-set') end - after(:each) { ::FileUtils.rm_rf('/tmp/settings') if ::File.exist?('/tmp/settings') } + after(:each) { ::FileUtils.rm_rf('/tmp/settings') } it 'can consider directories containing YAML files' do ::File.new('/tmp/settings/some_settings_file.yml', 'w+') diff --git a/spec/lib/chamber/filters/decryption_filter_spec.rb b/spec/lib/chamber/filters/decryption_filter_spec.rb index 7008516..6d231ff 100644 --- a/spec/lib/chamber/filters/decryption_filter_spec.rb +++ b/spec/lib/chamber/filters/decryption_filter_spec.rb @@ -9,7 +9,7 @@ module Filters it 'attempts multiple keys to decrypt values' do allow(EncryptionMethods::PublicKey).to receive(:decrypt).and_call_original - filtered_settings = \ + filtered_settings = DecryptionFilter .execute( secure_key_prefix: '_secure_', @@ -59,7 +59,7 @@ module Filters end it 'attempts to decrypt values which are marked as "secure"' do - filtered_settings = \ + filtered_settings = DecryptionFilter .execute( secure_key_prefix: '_secure_', @@ -81,7 +81,7 @@ module Filters end it 'corrects decrypt values which contain multiline strings' do - filtered_settings = \ + filtered_settings = DecryptionFilter .execute( secure_key_prefix: '_secure_', @@ -125,7 +125,7 @@ module Filters end it 'does not attempt to decrypt values which are not marked as "secure"' do - filtered_settings = \ + filtered_settings = DecryptionFilter .execute( secure_key_prefix: '_secure_', @@ -154,7 +154,7 @@ module Filters end it 'does not attempt to decrypt values even if they are prefixed with "secure"' do - filtered_settings = \ + filtered_settings = DecryptionFilter .execute( secure_key_prefix: '_secure_', @@ -184,7 +184,7 @@ module Filters end it 'does not attempt to decrypt values even if they are not properly encoded' do - filtered_settings = \ + filtered_settings = DecryptionFilter .execute( secure_key_prefix: '_secure_', @@ -214,7 +214,7 @@ module Filters end it 'does not attempt to decrypt values if it guesses that they are not encrpyted' do - filtered_settings = \ + filtered_settings = DecryptionFilter .execute(secure_key_prefix: '_secure_', data: { @@ -228,7 +228,7 @@ module Filters end it 'simply returns the encrypted string if there is no decryption key' do - filtered_settings = \ + filtered_settings = DecryptionFilter .execute( secure_key_prefix: '_secure_', @@ -257,7 +257,7 @@ module Filters end it 'can decrypt a complex object' do - filtered_settings = \ + filtered_settings = DecryptionFilter .execute( secure_key_prefix: '_secure_', @@ -280,7 +280,7 @@ module Filters end it 'can decrypt a number that has not been yamlled' do - filtered_settings = \ + filtered_settings = DecryptionFilter .execute( secure_key_prefix: '_secure_', @@ -302,7 +302,7 @@ module Filters end it 'can decrypt a string that has not been yamlled' do - filtered_settings = \ + filtered_settings = DecryptionFilter .execute( secure_key_prefix: '_secure_', @@ -324,7 +324,7 @@ module Filters end it 'can decrypt a Regex/Complex Object via Public Key' do - filtered_settings = \ + filtered_settings = DecryptionFilter .execute( secure_key_prefix: '_secure_', @@ -348,7 +348,7 @@ module Filters end it 'can decrypt a Regex/Complex Object via SSL' do - filtered_settings = \ + filtered_settings = DecryptionFilter .execute( secure_key_prefix: '_secure_', @@ -378,7 +378,7 @@ module Filters end it 'can decrypt a Date' do - filtered_settings = \ + filtered_settings = DecryptionFilter .execute( secure_key_prefix: '_secure_', @@ -401,7 +401,7 @@ module Filters end it 'can decrypt a Time' do - filtered_settings = \ + filtered_settings = DecryptionFilter .execute( secure_key_prefix: '_secure_', @@ -481,7 +481,7 @@ module Filters end it 'can decrypt large encrypted data' do - filtered_settings = \ + filtered_settings = DecryptionFilter .execute( secure_key_prefix: '_secure_', diff --git a/spec/lib/chamber/filters/encryption_filter_spec.rb b/spec/lib/chamber/filters/encryption_filter_spec.rb index eae48b4..dc1c3ec 100644 --- a/spec/lib/chamber/filters/encryption_filter_spec.rb +++ b/spec/lib/chamber/filters/encryption_filter_spec.rb @@ -135,7 +135,7 @@ module Filters end it 'does not attempt to encrypt normal values if it guesses that they are already encrypted' do - filtered_settings = \ + filtered_settings = EncryptionFilter .execute( secure_key_prefix: '_secure_', @@ -166,7 +166,7 @@ module Filters end it 'does not attempt to encrypt large values if it guesses that they are already encrypted' do - filtered_settings = \ + filtered_settings = EncryptionFilter .execute( secure_key_prefix: '_secure_', @@ -223,7 +223,7 @@ module Filters end it 'can encrypt long multiline strings' do - filtered_settings = \ + filtered_settings = EncryptionFilter .execute( secure_key_prefix: '_secure_', diff --git a/spec/lib/chamber/filters/environment_filter_spec.rb b/spec/lib/chamber/filters/environment_filter_spec.rb index 57566af..2409f9a 100644 --- a/spec/lib/chamber/filters/environment_filter_spec.rb +++ b/spec/lib/chamber/filters/environment_filter_spec.rb @@ -20,7 +20,7 @@ module Filters }, }) - test_setting = \ + test_setting = filtered_data['test_setting_group']['test_setting_level']['test_setting'] expect(test_setting).to eql 'value 2' @@ -46,7 +46,7 @@ module Filters }, }) - test_setting = \ + test_setting = filtered_data['test_setting_group']['test_setting_level']['test_setting'] expect(test_setting).to eql [4, 5, 6] @@ -62,7 +62,7 @@ module Filters }, }) - test_setting = \ + test_setting = filtered_data['test_setting_group']['test_setting_level']['test_setting'] expect(test_setting).to eql %w{4 5 6} @@ -109,7 +109,7 @@ module Filters }, }) - another_setting = \ + another_setting = filtered_data['test_setting_group']['test_setting_level']['another_setting'] expect(another_setting).to eql 'value 3' @@ -131,7 +131,7 @@ module Filters }, }) - test_setting = \ + test_setting = filtered_data['test_setting_group']['test_setting_level']['test_setting'] expect(test_setting).to be nil @@ -147,7 +147,7 @@ module Filters }, }) - test_setting = \ + test_setting = filtered_data['test_setting_group']['test_setting_level']['test_setting'] expect(test_setting).to be nil @@ -169,7 +169,7 @@ module Filters }, }) - test_setting = \ + test_setting = filtered_data['test_setting_group']['test_setting_level']['test_setting'] expect(test_setting).to be 2 @@ -217,7 +217,7 @@ module Filters }, }) - test_setting = \ + test_setting = filtered_data['test_setting_group']['test_setting_level']['test_setting'] expect(test_setting).to be 2.3 @@ -266,7 +266,7 @@ module Filters }, }) - test_setting = \ + test_setting = filtered_data['test_setting_group']['test_setting_level']['test_setting'] expect(test_setting).to eql Time.utc(2018, 1, 1, 12, 0, 0) @@ -370,7 +370,7 @@ module Filters }, }) - test_setting = \ + test_setting = filtered_data['test_setting_group']['test_setting_level']['test_setting'] expect(test_setting).to be 1 @@ -388,7 +388,7 @@ module Filters }, }) - test_setting = \ + test_setting = filtered_data['test_setting_group']['test_setting_level']['test_setting'] expect(test_setting).to eql '2' diff --git a/spec/lib/chamber/filters/insecure_filter_spec.rb b/spec/lib/chamber/filters/insecure_filter_spec.rb index 32196c4..b5f4fac 100644 --- a/spec/lib/chamber/filters/insecure_filter_spec.rb +++ b/spec/lib/chamber/filters/insecure_filter_spec.rb @@ -42,7 +42,7 @@ module Filters end it 'does not return values which are encrypted' do - filtered_settings = \ + filtered_settings = InsecureFilter .execute( secure_key_prefix: '_secure_',