aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobosila Victor <victor.bobosila@puppet.com>2021-10-04 12:16:24 +0300
committerGitHub <noreply@github.com>2021-10-04 12:16:24 +0300
commitefd4d1b3213336c4f7f4a04fb5075a0ce1682fa6 (patch)
tree3fd2f83f284b673ea19187b395101e1663171cf8
parent9a54482d64ef21e8b6b1063845a96b1a72cd8f3c (diff)
parentb2565ef72fd744e31cc3e3836dc5b69e193fa88c (diff)
downloadpuppet-sshkeys_core-efd4d1b3213336c4f7f4a04fb5075a0ce1682fa6.tar.gz
puppet-sshkeys_core-efd4d1b3213336c4f7f4a04fb5075a0ce1682fa6.tar.bz2
Merge pull request #48 from GabrielNagy/MODULES-11197/pdk-update
(MODULES-11197) Update to pdk-templates 2.2.0
-rw-r--r--.devcontainer/Dockerfile6
-rw-r--r--.devcontainer/devcontainer.json23
-rw-r--r--.github/workflows/auto_release.yml84
-rw-r--r--.github/workflows/release.yml47
-rw-r--r--.gitignore1
-rw-r--r--.pdkignore5
-rw-r--r--.rubocop.yml424
-rw-r--r--.sync.yml69
-rw-r--r--Gemfile58
-rw-r--r--REFERENCE.md195
-rw-r--r--Rakefile44
-rw-r--r--lib/puppet/type/ssh_authorized_key.rb22
-rw-r--r--lib/puppet/type/sshkey.rb16
-rw-r--r--metadata.json6
-rw-r--r--rakelib/commits.rake26
-rw-r--r--spec/acceptance/tests/resource/ssh_authorized_key/create_spec.rb4
-rw-r--r--spec/integration/provider/ssh_authorized_key_spec.rb12
-rw-r--r--spec/integration/provider/sshkey_spec.rb2
-rw-r--r--spec/lib/puppet_spec/files.rb2
-rw-r--r--spec/spec_helper.rb20
-rw-r--r--spec/unit/provider/sshkey/parsed_spec.rb2
-rw-r--r--spec/unit/type/ssh_authorized_key_spec.rb52
22 files changed, 848 insertions, 272 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
new file mode 100644
index 0000000..12ed4ff
--- /dev/null
+++ b/.devcontainer/Dockerfile
@@ -0,0 +1,6 @@
+FROM puppet/pdk:latest
+
+# [Optional] Uncomment this section to install additional packages.
+# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
+# && apt-get -y install --no-install-recommends <your-package-list-here>
+
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 0000000..f1a55dc
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,23 @@
+// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
+// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet
+{
+ "name": "Puppet Development Kit (Community)",
+ "dockerFile": "Dockerfile",
+
+ // Set *default* container specific settings.json values on container create.
+ "settings": {
+ "terminal.integrated.shell.linux": "/bin/bash"
+ },
+
+ // Add the IDs of extensions you want installed when the container is created.
+ "extensions": [
+ "puppet.puppet-vscode",
+ "rebornix.Ruby"
+ ]
+
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
+ // "forwardPorts": [],
+
+ // Use 'postCreateCommand' to run commands after the container is created.
+ // "postCreateCommand": "pdk --version",
+}
diff --git a/.github/workflows/auto_release.yml b/.github/workflows/auto_release.yml
new file mode 100644
index 0000000..e028483
--- /dev/null
+++ b/.github/workflows/auto_release.yml
@@ -0,0 +1,84 @@
+name: "Auto release"
+
+on:
+ workflow_dispatch:
+
+env:
+ HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
+ HONEYCOMB_DATASET: litmus tests
+ CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+jobs:
+ auto_release:
+ name: "Automatic release prep"
+ runs-on: ubuntu-20.04
+
+ steps:
+ - name: "Honeycomb: Start recording"
+ uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
+ with:
+ apikey: ${{ env.HONEYCOMB_WRITEKEY }}
+ dataset: ${{ env.HONEYCOMB_DATASET }}
+ job-status: ${{ job.status }}
+
+ - name: "Honeycomb: start first step"
+ run: |
+ echo STEP_ID="auto-release" >> $GITHUB_ENV
+ echo STEP_START=$(date +%s) >> $GITHUB_ENV
+
+ - name: "Checkout Source"
+ if: ${{ github.repository_owner == 'puppetlabs' }}
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+
+ - name: "PDK Release prep"
+ uses: docker://puppet/iac_release:ci
+ with:
+ args: 'release prep --force'
+ env:
+ CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: "Get Version"
+ if: ${{ github.repository_owner == 'puppetlabs' }}
+ id: gv
+ run: |
+ echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
+
+ - name: "Commit changes"
+ if: ${{ github.repository_owner == 'puppetlabs' }}
+ run: |
+ git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
+ git config --local user.name "GitHub Action"
+ git add .
+ git commit -m "Release prep v${{ steps.gv.outputs.ver }}"
+
+ - name: Create Pull Request
+ id: cpr
+ uses: puppetlabs/peter-evans-create-pull-request@v3
+ if: ${{ github.repository_owner == 'puppetlabs' }}
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ commit-message: "Release prep v${{ steps.gv.outputs.ver }}"
+ branch: "release-prep"
+ delete-branch: true
+ title: "Release prep v${{ steps.gv.outputs.ver }}"
+ body: |
+ Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}.
+ Please verify before merging:
+ - [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green
+ - [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests
+ - [ ] Ensure the [changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) version and [metadata](https://github.com/${{ github.repository }}/blob/release-prep/metadata.json) version match
+ labels: "maintenance"
+
+ - name: PR outputs
+ if: ${{ github.repository_owner == 'puppetlabs' }}
+ run: |
+ echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
+ echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
+
+ - name: "Honeycomb: Record finish step"
+ if: ${{ always() }}
+ run: |
+ buildevents step $TRACE_ID $STEP_ID $STEP_START 'Finished auto release workflow'
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..1509f6e
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,47 @@
+name: "Publish module"
+
+on:
+ workflow_dispatch:
+
+jobs:
+ create-github-release:
+ name: Deploy GitHub Release
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+ with:
+ ref: ${{ github.ref }}
+ clean: true
+ fetch-depth: 0
+ - name: Get Version
+ id: gv
+ run: |
+ echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
+ - name: Create Release
+ uses: actions/create-release@v1
+ id: create_release
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: "v${{ steps.gv.outputs.ver }}"
+ draft: false
+ prerelease: false
+
+ deploy-forge:
+ name: Deploy to Forge
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+ with:
+ ref: ${{ github.ref }}
+ clean: true
+ - name: "PDK Build"
+ uses: docker://puppet/pdk:nightly
+ with:
+ args: 'build'
+ - name: "Push to Forge"
+ uses: docker://puppet/pdk:nightly
+ with:
+ args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force'
diff --git a/.gitignore b/.gitignore
index 2767022..988dcbb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,3 +25,4 @@
.project
.envrc
/inventory.yaml
+/spec/fixtures/litmus_inventory.yaml
diff --git a/.pdkignore b/.pdkignore
index e6215cd..c538bea 100644
--- a/.pdkignore
+++ b/.pdkignore
@@ -25,13 +25,16 @@
.project
.envrc
/inventory.yaml
+/spec/fixtures/litmus_inventory.yaml
/appveyor.yml
+/.editorconfig
/.fixtures.yml
/Gemfile
/.gitattributes
/.gitignore
/.gitlab-ci.yml
/.pdkignore
+/.puppet-lint.rc
/Rakefile
/rakelib/
/.rspec
@@ -40,3 +43,5 @@
/.yardopts
/spec/
/.vscode/
+/.sync.yml
+/.devcontainer/
diff --git a/.rubocop.yml b/.rubocop.yml
index f3b0b61..cbf6ac1 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,12 +1,12 @@
---
require:
+- rubocop-performance
- rubocop-rspec
-- rubocop-i18n
AllCops:
DisplayCopNames: true
- TargetRubyVersion: '2.1'
+ TargetRubyVersion: '2.4'
Include:
- - "./**/*.rb"
+ - "**/*.rb"
Exclude:
- bin/*
- ".vendor/**/*"
@@ -18,16 +18,9 @@ AllCops:
- "**/Puppetfile"
- "**/Vagrantfile"
- "**/Guardfile"
-Metrics/LineLength:
+Layout/LineLength:
Description: People have wide screens, use them.
Max: 200
-GetText:
- Enabled: false
-GetText/DecorateString:
- Description: We don't want to decorate test output.
- Exclude:
- - spec/**/*
- Enabled: false
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
@@ -36,6 +29,9 @@ RSpec/BeforeAfterAll:
RSpec/HookArgument:
Description: Prefer explicit :each argument, matching existing module's style
EnforcedStyle: each
+RSpec/DescribeSymbol:
+ Exclude:
+ - spec/unit/facter/**/*.rb
Style/BlockDelimiters:
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
be consistent then.
@@ -68,17 +64,17 @@ Style/TrailingCommaInArguments:
Description: Prefer always trailing comma on multiline argument lists. This makes
diffs, and re-ordering nicer.
EnforcedStyleForMultiline: comma
-Style/TrailingCommaInLiteral:
+Style/TrailingCommaInArrayLiteral:
Description: Prefer always trailing comma on multiline literals. This makes diffs,
and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/SymbolArray:
Description: Using percent style obscures symbolic intent of array's contents.
EnforcedStyle: brackets
-RSpec/NamedSubject:
- Enabled: false
RSpec/SubjectStub:
Enabled: false
+RSpec/NamedSubject:
+ Enabled: false
Style/Documentation:
Exclude:
- lib/puppet/parser/functions/**/*
@@ -89,26 +85,170 @@ RSpec/MessageSpies:
EnforcedStyle: receive
Style/WordArray:
EnforcedStyle: brackets
+Performance/AncestorsInclude:
+ Enabled: true
+Performance/BigDecimalWithNumericArgument:
+ Enabled: true
+Performance/BlockGivenWithExplicitBlock:
+ Enabled: true
+Performance/CaseWhenSplat:
+ Enabled: true
+Performance/ConstantRegexp:
+ Enabled: true
+Performance/MethodObjectAsBlock:
+ Enabled: true
+Performance/RedundantSortBlock:
+ Enabled: true
+Performance/RedundantStringChars:
+ Enabled: true
+Performance/ReverseFirst:
+ Enabled: true
+Performance/SortReverse:
+ Enabled: true
+Performance/Squeeze:
+ Enabled: true
+Performance/StringInclude:
+ Enabled: true
+Performance/Sum:
+ Enabled: true
Style/CollectionMethods:
Enabled: true
Style/MethodCalledOnDoEndBlock:
Enabled: true
Style/StringMethods:
Enabled: true
-GetText/DecorateFunctionMessage:
+Bundler/InsecureProtocolSource:
+ Enabled: false
+Gemspec/DuplicatedAssignment:
+ Enabled: false
+Gemspec/OrderedDependencies:
+ Enabled: false
+Gemspec/RequiredRubyVersion:
+ Enabled: false
+Gemspec/RubyVersionGlobalsUsage:
Enabled: false
-GetText/DecorateStringFormattingUsingInterpolation:
+Layout/ArgumentAlignment:
Enabled: false
-GetText/DecorateStringFormattingUsingPercent:
+Layout/BeginEndAlignment:
+ Enabled: false
+Layout/ClosingHeredocIndentation:
+ Enabled: false
+Layout/EmptyComment:
+ Enabled: false
+Layout/EmptyLineAfterGuardClause:
+ Enabled: false
+Layout/EmptyLinesAroundArguments:
+ Enabled: false
+Layout/EmptyLinesAroundAttributeAccessor:
Enabled: false
Layout/EndOfLine:
Enabled: false
-Layout/IndentHeredoc:
+Layout/FirstArgumentIndentation:
+ Enabled: false
+Layout/HashAlignment:
+ Enabled: false
+Layout/HeredocIndentation:
+ Enabled: false
+Layout/LeadingEmptyLines:
+ Enabled: false
+Layout/SpaceAroundMethodCallOperator:
+ Enabled: false
+Layout/SpaceInsideArrayLiteralBrackets:
+ Enabled: false
+Layout/SpaceInsideReferenceBrackets:
+ Enabled: false
+Lint/BigDecimalNew:
+ Enabled: false
+Lint/BooleanSymbol:
+ Enabled: false
+Lint/ConstantDefinitionInBlock:
+ Enabled: false
+Lint/DeprecatedOpenSSLConstant:
+ Enabled: false
+Lint/DisjunctiveAssignmentInConstructor:
+ Enabled: false
+Lint/DuplicateElsifCondition:
+ Enabled: false
+Lint/DuplicateRequire:
+ Enabled: false
+Lint/DuplicateRescueException:
+ Enabled: false
+Lint/EmptyConditionalBody:
+ Enabled: false
+Lint/EmptyFile:
+ Enabled: false
+Lint/ErbNewArguments:
+ Enabled: false
+Lint/FloatComparison:
+ Enabled: false
+Lint/HashCompareByIdentity:
+ Enabled: false
+Lint/IdentityComparison:
+ Enabled: false
+Lint/InterpolationCheck:
+ Enabled: false
+Lint/MissingCopEnableDirective:
+ Enabled: false
+Lint/MixedRegexpCaptureTypes:
+ Enabled: false
+Lint/NestedPercentLiteral:
+ Enabled: false
+Lint/NonDeterministicRequireOrder:
+ Enabled: false
+Lint/OrderedMagicComments:
+ Enabled: false
+Lint/OutOfRangeRegexpRef:
+ Enabled: false
+Lint/RaiseException:
+ Enabled: false
+Lint/RedundantCopEnableDirective:
+ Enabled: false
+Lint/RedundantRequireStatement:
+ Enabled: false
+Lint/RedundantSafeNavigation:
+ Enabled: false
+Lint/RedundantWithIndex:
+ Enabled: false
+Lint/RedundantWithObject:
+ Enabled: false
+Lint/RegexpAsCondition:
+ Enabled: false
+Lint/ReturnInVoidContext:
+ Enabled: false
+Lint/SafeNavigationConsistency:
+ Enabled: false
+Lint/SafeNavigationWithEmpty:
+ Enabled: false
+Lint/SelfAssignment:
+ Enabled: false
+Lint/SendWithMixinArgument:
+ Enabled: false
+Lint/ShadowedArgument:
+ Enabled: false
+Lint/StructNewOverride:
+ Enabled: false
+Lint/ToJSON:
+ Enabled: false
+Lint/TopLevelReturnWithArgument:
+ Enabled: false
+Lint/TrailingCommaInAttributeDeclaration:
+ Enabled: false
+Lint/UnreachableLoop:
+ Enabled: false
+Lint/UriEscapeUnescape:
+ Enabled: false
+Lint/UriRegexp:
+ Enabled: false
+Lint/UselessMethodDefinition:
+ Enabled: false
+Lint/UselessTimes:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/BlockLength:
Enabled: false
+Metrics/BlockNesting:
+ Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/CyclomaticComplexity:
@@ -121,19 +261,265 @@ Metrics/ParameterLists:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
+Migration/DepartmentName:
+ Enabled: false
+Naming/AccessorMethodName:
+ Enabled: false
+Naming/BlockParameterName:
+ Enabled: false
+Naming/HeredocDelimiterCase:
+ Enabled: false
+Naming/HeredocDelimiterNaming:
+ Enabled: false
+Naming/MemoizedInstanceVariableName:
+ Enabled: false
+Naming/MethodParameterName:
+ Enabled: false
+Naming/RescuedExceptionsVariableName:
+ Enabled: false
+Naming/VariableNumber:
+ Enabled: false
+Performance/BindCall:
+ Enabled: false
+Performance/DeletePrefix:
+ Enabled: false
+Performance/DeleteSuffix:
+ Enabled: false
+Performance/InefficientHashSearch:
+ Enabled: false
+Performance/UnfreezeString:
+ Enabled: false
+Performance/UriDefaultParser:
+ Enabled: false
+RSpec/Be:
+ Enabled: false
+RSpec/Capybara/CurrentPathExpectation:
+ Enabled: false
+RSpec/Capybara/FeatureMethods:
+ Enabled: false
+RSpec/Capybara/VisibilityMatcher:
+ Enabled: false
+RSpec/ContextMethod:
+ Enabled: false
+RSpec/ContextWording:
+ Enabled: false
RSpec/DescribeClass:
Enabled: false
+RSpec/EmptyHook:
+ Enabled: false
+RSpec/EmptyLineAfterExample:
+ Enabled: false
+RSpec/EmptyLineAfterExampleGroup:
+ Enabled: false
+RSpec/EmptyLineAfterHook:
+ Enabled: false
RSpec/ExampleLength:
Enabled: false
-RSpec/MessageExpectation:
+RSpec/ExampleWithoutDescription:
+ Enabled: false
+RSpec/ExpectChange:
+ Enabled: false
+RSpec/ExpectInHook:
+ Enabled: false
+RSpec/FactoryBot/AttributeDefinedStatically:
+ Enabled: false
+RSpec/FactoryBot/CreateList:
+ Enabled: false
+RSpec/FactoryBot/FactoryClassName:
+ Enabled: false
+RSpec/HooksBeforeExamples:
+ Enabled: false
+RSpec/ImplicitBlockExpectation:
+ Enabled: false
+RSpec/ImplicitSubject:
+ Enabled: false
+RSpec/LeakyConstantDeclaration:
+ Enabled: false
+RSpec/LetBeforeExamples:
+ Enabled: false
+RSpec/MissingExampleGroupArgument:
Enabled: false
RSpec/MultipleExpectations:
Enabled: false
+RSpec/MultipleMemoizedHelpers:
+ Enabled: false
+RSpec/MultipleSubjects:
+ Enabled: false
RSpec/NestedGroups:
Enabled: false
+RSpec/PredicateMatcher:
+ Enabled: false
+RSpec/ReceiveCounts:
+ Enabled: false
+RSpec/ReceiveNever:
+ Enabled: false
+RSpec/RepeatedExampleGroupBody:
+ Enabled: false
+RSpec/RepeatedExampleGroupDescription:
+ Enabled: false
+RSpec/RepeatedIncludeExample:
+ Enabled: false
+RSpec/ReturnFromStub:
+ Enabled: false
+RSpec/SharedExamples:
+ Enabled: false
+RSpec/StubbedMock:
+ Enabled: false
+RSpec/UnspecifiedException:
+ Enabled: false
+RSpec/VariableDefinition:
+ Enabled: false
+RSpec/VoidExpect:
+ Enabled: false
+RSpec/Yield:
+ Enabled: false
+Security/Open:
+ Enabled: false
+Style/AccessModifierDeclarations:
+ Enabled: false
+Style/AccessorGrouping:
+ Enabled: false
Style/AsciiComments:
Enabled: false
+Style/BisectedAttrAccessor:
+ Enabled: false
+Style/CaseLikeIf:
+ Enabled: false
+Style/ClassEqualityComparison:
+ Enabled: false
+Style/ColonMethodDefinition:
+ Enabled: false
+Style/CombinableLoops:
+ Enabled: false
+Style/CommentedKeyword:
+ Enabled: false
+Style/Dir:
+ Enabled: false
+Style/DoubleCopDisableDirective:
+ Enabled: false
+Style/EmptyBlockParameter:
+ Enabled: false
+Style/EmptyLambdaParameter:
+ Enabled: false
+Style/Encoding:
+ Enabled: false
+Style/EvalWithLocation:
+ Enabled: false
+Style/ExpandPathArguments:
+ Enabled: false
+Style/ExplicitBlockArgument:
+ Enabled: false
+Style/ExponentialNotation:
+ Enabled: false
+Style/FloatDivision:
+ Enabled: false
+Style/FrozenStringLiteralComment:
+ Enabled: false
+Style/GlobalStdStream:
+ Enabled: false
+Style/HashAsLastArrayItem:
+ Enabled: false
+Style/HashLikeCase:
+ Enabled: false
+Style/HashTransformKeys:
+ Enabled: false
+Style/HashTransformValues:
+ Enabled: false
Style/IfUnlessModifier:
Enabled: false
+Style/KeywordParametersOrder:
+ Enabled: false
+Style/MinMax:
+ Enabled: false
+Style/MixinUsage:
+ Enabled: false
+Style/MultilineWhenThen:
+ Enabled: false
+Style/NegatedUnless:
+ Enabled: false
+Style/NumericPredicate:
+ Enabled: false
+Style/OptionalBooleanParameter:
+ Enabled: false
+Style/OrAssignment:
+ Enabled: false
+Style/RandomWithOffset:
+ Enabled: false
+Style/RedundantAssignment:
+ Enabled: false
+Style/RedundantCondition:
+ Enabled: false
+Style/RedundantConditional:
+ Enabled: false
+Style/RedundantFetchBlock:
+ Enabled: false
+Style/RedundantFileExtensionInRequire:
+ Enabled: false
+Style/RedundantRegexpCharacterClass:
+ Enabled: false
+Style/RedundantRegexpEscape:
+ Enabled: false
+Style/RedundantSelfAssignment:
+ Enabled: false
+Style/RedundantSort:
+ Enabled: false
+Style/RescueStandardError:
+ Enabled: false
+Style/SingleArgumentDig:
+ Enabled: false
+Style/SlicingWithRange:
+ Enabled: false
+Style/SoleNestedConditional:
+ Enabled: false
+Style/StderrPuts:
+ Enabled: false
+Style/StringConcatenation:
+ Enabled: false
+Style/Strip:
+ Enabled: false
Style/SymbolProc:
Enabled: false
+Style/TrailingBodyOnClass:
+ Enabled: false
+Style/TrailingBodyOnMethodDefinition:
+ Enabled: false
+Style/TrailingBodyOnModule:
+ Enabled: false
+Style/TrailingCommaInHashLiteral:
+ Enabled: false
+Style/TrailingMethodEndStatement:
+ Enabled: false
+Style/UnpackFirst:
+ Enabled: false
+Lint/DuplicateBranch:
+ Enabled: false
+Lint/DuplicateRegexpCharacterClassElement:
+ Enabled: false
+Lint/EmptyBlock:
+ Enabled: false
+Lint/EmptyClass:
+ Enabled: false
+Lint/NoReturnInBeginEndBlocks:
+ Enabled: false
+Lint/ToEnumArguments:
+ Enabled: false
+Lint/UnexpectedBlockArity:
+ Enabled: false
+Lint/UnmodifiedReduceAccumulator:
+ Enabled: false
+Performance/CollectionLiteralInLoop:
+ Enabled: false
+Style/ArgumentsForwarding:
+ Enabled: false
+Style/CollectionCompact:
+ Enabled: false
+Style/DocumentDynamicEvalDefinition:
+ Enabled: false
+Style/NegatedIfElseCondition:
+ Enabled: false
+Style/NilLambda:
+ Enabled: false
+Style/RedundantArgument:
+ Enabled: false
+Style/SwapValues:
+ Enabled: false
diff --git a/.sync.yml b/.sync.yml
index 7d5b1a6..fef7671 100644
--- a/.sync.yml
+++ b/.sync.yml
@@ -1,54 +1,45 @@
---
+.rubocop.yml:
+ default_configs:
+ RSpec/SubjectStub:
+ Enabled: false
+ RSpec/NamedSubject:
+ Enabled: false
+ Style/Documentation:
+ Exclude:
+ - lib/puppet/parser/functions/**/*
+ - spec/**/*
+ - lib/puppet/type/**
+ - lib/puppet/provider/**
Gemfile:
optional:
- ':development':
- - gem: 'github_changelog_generator'
- git: 'https://github.com/skywinder/github-changelog-generator'
- ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
- condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
- required:
- ':system_tests':
- - gem: 'puppet-module-posix-system-r#{minor_version}'
- platforms: ruby
- - gem: 'puppet-module-win-system-r#{minor_version}'
- platforms:
- - mswin
- - mingw
- - x64_mingw
+ ":development":
- gem: beaker
- version: '~> 3.13'
+ version: '~> 4.30'
from_env: BEAKER_VERSION
- gem: beaker-abs
from_env: BEAKER_ABS_VERSION
- version: '~> 0.1'
+ version: '~> 0.9'
- gem: beaker-pe
- gem: beaker-hostgenerator
from_env: BEAKER_HOSTGENERATOR_VERSION
- gem: beaker-rspec
from_env: BEAKER_RSPEC_VERSION
- ':development':
- - gem: puppet-strings
-
-Rakefile:
- changelog_version_tag_pattern: '%s'
- requires:
- - puppet-lint/tasks/puppet-lint
-
-.rubocop.yml:
- default_configs:
- RSpec/NamedSubject:
- Enabled: false
- Style/Documentation:
- Exclude:
- - lib/puppet/parser/functions/**/*
- - spec/**/*
- - lib/puppet/type/**
- - lib/puppet/provider/**
+ - gem: beaker-puppet
+ from_env: BEAKER_PUPPET_VERSION
+ version: '~> 1.22'
+ - gem: github_changelog_generator
+ - gem: beaker-module_install_helper
+ - gem: beaker-puppet_install_helper
+ - gem: nokogiri
-.gitlab-ci.yml:
+appveyor.yml:
delete: true
-
.travis.yml:
- remove_includes:
- - env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
- rvm: 2.1.9
+ delete: true
+.github/workflows/auto_release.yml:
+ unmanaged: false
+.github/workflows/release.yml:
+ unmanaged: false
+.gitlab-ci.yml:
+ delete: true
diff --git a/Gemfile b/Gemfile
index 5c87918..26f0def 100644
--- a/Gemfile
+++ b/Gemfile
@@ -17,41 +17,27 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')
group :development do
- gem "parallel_tests", '>= 2.14.1', '< 2.14.3', require: false
- gem "metadata-json-lint", '>= 2.0.2', '< 3.0.0', require: false
- gem "rspec-puppet-facts", '~> 1.10.0', require: false
- gem "rspec_junit_formatter", '~> 0.2', require: false
- gem "rubocop", '~> 0.49.0', require: false
- gem "rubocop-rspec", '~> 1.16.0', require: false
- gem "rubocop-i18n", '~> 1.2.0', require: false
- gem "puppetlabs_spec_helper", '>= 2.9.0', '< 3.0.0', require: false
- gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
- gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
- gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
- gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
- gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
- gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
- gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
- gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
- gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
- gem "puppet-strings", require: false
- gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
-end
-
-group :system_tests do
- gem "puppet-module-posix-system-r#{minor_version}", '~> 0.5', require: false, platforms: [:ruby]
- gem "puppet-module-win-system-r#{minor_version}", '~> 0.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
- gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4')
- gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.5')
+ gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
+ gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
+ gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 2.8.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
+ gem "puppet-module-posix-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
+ gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
+ gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
+ gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
+ gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4.30')
+ gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.9')
gem "beaker-pe", require: false
gem "beaker-hostgenerator"
gem "beaker-rspec"
- gem "beaker-puppet", *location_for(ENV['BEAKER_PUPPET_VERSION'] || '~> 1.0')
+ gem "beaker-puppet", *location_for(ENV['BEAKER_PUPPET_VERSION'] || '~> 1.22')
+ gem "github_changelog_generator", require: false
+ gem "beaker-module_install_helper", require: false
+ gem "beaker-puppet_install_helper", require: false
+ gem "nokogiri", require: false
end
-
-group :release do
- gem "puppet-blacksmith", '~> 3.4', require: false
- gem "pdk", '~> 2.0', platforms: [:ruby]
+group :system_tests do
+ gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
+ gem "puppet-module-win-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
end
puppet_version = ENV['PUPPET_GEM_VERSION']
@@ -68,16 +54,6 @@ gems['puppet'] = location_for(puppet_version)
gems['facter'] = location_for(facter_version) if facter_version
gems['hiera'] = location_for(hiera_version) if hiera_version
-if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
- # If we're using a Puppet gem on Windows which handles its own win32-xxx gem
- # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
- gems['win32-dir'] = ['<= 0.4.9', require: false]
- gems['win32-eventlog'] = ['<= 0.6.5', require: false]
- gems['win32-process'] = ['<= 0.7.5', require: false]
- gems['win32-security'] = ['<= 0.2.5', require: false]
- gems['win32-service'] = ['0.8.8', require: false]
-end
-
gems.each do |gem_name, gem_params|
gem gem_name, *gem_params
end
diff --git a/REFERENCE.md b/REFERENCE.md
index 1e6b933..82340d0 100644
--- a/REFERENCE.md
+++ b/REFERENCE.md
@@ -1,38 +1,24 @@
# Reference
-## Resource types
-* [`ssh_authorized_key`](#ssh_authorized_key): Manages SSH authorized keys. Currently only type 2 keys are supported. In their native habitat, SSH keys usually appear as a single long lin
-* [`sshkey`](#sshkey): Installs and manages ssh host keys. By default, this type will install keys into `/etc/ssh/ssh_known_hosts`. To manage ssh keys in a differe
-## Resource types
+<!-- DO NOT EDIT: This document was generated by Puppet Strings -->
-### ssh_authorized_key
+## Table of Contents
-Manages SSH authorized keys. Currently only type 2 keys are supported.
+### Resource types
-In their native habitat, SSH keys usually appear as a single long line, in
-the format `<TYPE> <KEY> <NAME/COMMENT>`. This resource type requires you
-to split that line into several attributes. Thus, a key that appears in
-your `~/.ssh/id_rsa.pub` file like this...
+* [`ssh_authorized_key`](#ssh_authorized_key): Manages SSH authorized keys. Currently only type 2 keys are supported.
+* [`sshkey`](#sshkey): Installs and manages ssh host keys.
- ssh-rsa AAAAB3Nza[...]qXfdaQ== nick@magpie.example.com
+## Resource types
-...would translate to the following resource:
+### <a name="ssh_authorized_key"></a>`ssh_authorized_key`
- ssh_authorized_key { 'nick@magpie.example.com':
- ensure => present,
- user => 'nick',
- type => 'ssh-rsa',
- key => 'AAAAB3Nza[...]qXfdaQ==',
- }
+In their native habitat, SSH keys usually appear as a single long line, in
+the format `<TYPE> <KEY> <NAME/COMMENT>`. This resource type requires you
+to split that line into several attributes.
To ensure that only the currently approved keys are present, you can purge
-unmanaged SSH keys on a per-user basis. Do this with the `user` resource
-type's `purge_ssh_keys` attribute:
-
- user { 'nick':
- ensure => present,
- purge_ssh_keys => true,
- }
+unmanaged SSH keys on a per-user basis.
This will remove any keys in `~/.ssh/authorized_keys` that aren't being
managed with `ssh_authorized_key` resources. See the documentation of the
@@ -42,26 +28,48 @@ managed with `ssh_authorized_key` resources. See the documentation of the
SSH key should be installed, the `ssh_authorized_key` resource will autorequire
that user.
+#### Examples
-#### Properties
+##### Thus, a key that appears in your `~/.ssh/id_rsa.pub` file like this...
-The following properties are available in the `ssh_authorized_key` type.
+```puppet
-##### `ensure`
+ssh-rsa AAAAB3Nza[...]qXfdaQ== nick@magpie.example.com
+```
-Valid values: present, absent
+##### ...would translate to the following resource:
-The basic property that the resource should be in.
+```puppet
-Default value: present
+ssh_authorized_key { 'nick@magpie.example.com':
+ ensure => present,
+ user => 'nick',
+ type => 'ssh-rsa',
+ key => 'AAAAB3Nza[...]qXfdaQ==',
+}
+```
-##### `type`
+##### Do this with the `user` resource type's `purge_ssh_keys` attribute:
-Valid values: ssh-dss, ssh-rsa, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, ssh-ed25519, dsa, ed25519, rsa
+```puppet
-Aliases: "dsa"=>"ssh-dss", "ed25519"=>"ssh-ed25519", "rsa"=>"ssh-rsa"
+user { 'nick':
+ ensure => present,
+ purge_ssh_keys => true,
+}
+```
-The encryption type used.
+#### Properties
+
+The following properties are available in the `ssh_authorized_key` type.
+
+##### `ensure`
+
+Valid values: `present`, `absent`
+
+The basic property that the resource should be in.
+
+Default value: `present`
##### `key`
@@ -75,10 +83,20 @@ other attributes):
* Key identifiers / comments, such as 'joe@joescomputer.local' --- put these in
the `name` attribute/resource title.
-##### `user`
+##### `options`
-The user account in which the SSH key should be installed. The resource
-will autorequire this user if it is being managed as a `user` resource.
+Key options; see sshd(8) for possible values. Multiple values
+should be specified as an array. For example, you could use the
+following to install a SSH CA that allows someone with the
+'superuser' principal to log in as root
+
+ ssh_authorized_key { 'Company SSH CA':
+ ensure => present,
+ user => 'root',
+ type => 'ssh-ed25519',
+ key => 'AAAAC3NzaC[...]CeA5kG',
+ options => [ 'cert-authority', 'principals=\"superuser\"' ],
+ }
##### `target`
@@ -88,28 +106,41 @@ are stored in a non-standard location, for instance when not in
`~user/.ssh/authorized_keys`. The parent directory must be present
if the target is in a privileged path.
-Default value: absent
+Default value: `absent`
-##### `options`
+##### `type`
-Key options; see sshd(8) for possible values. Multiple values
-should be specified as an array. For example, you could use the
-following to install a SSH CA that allows someone with the
-'superuser' principal to log in as root
+Valid values: `ssh-dss`, `ssh-rsa`, `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, `ecdsa-sha2-nistp521`, `ssh-ed25519`, `sk-ecdsa-sha2-nistp256@openssh.com`, `sk-ssh-ed25519@openssh.com`, `ssh-rsa-cert-v01@openssh.com`, `ssh-ed25519-cert-v01@openssh.com`, `ssh-dss-cert-v01@openssh.com`, `ecdsa-sha2-nistp256-cert-v01@openssh.com`, `ecdsa-sha2-nistp384-cert-v01@openssh.com`, `ecdsa-sha2-nistp521-cert-v01@openssh.com`, `dsa`, `ed25519`, `rsa`, `ecdsa-sk`, `ed25519-sk`
- ssh_authorized_key { 'Company SSH CA':
- ensure => present,
- user => 'root',
- type => 'ssh-ed25519',
- key => 'AAAAC3NzaC[...]CeA5kG',
- options => [ 'cert-authority', 'principals="superuser"' ],
- }
+Aliases: `"dsa"=>"ssh-dss", "ed25519"=>"ssh-ed25519", "rsa"=>"ssh-rsa", "ecdsa-sk"=>"sk-ecdsa-sha2-nistp256@openssh.com", "ed25519-sk"=>"sk-ssh-ed25519@openssh.com"`
+
+The encryption type used.
+
+##### `user`
+
+The user account in which the SSH key should be installed. The resource
+will autorequire this user if it is being managed as a `user` resource.
#### Parameters
The following parameters are available in the `ssh_authorized_key` type.
-##### `name`
+* [`drop_privileges`](#drop_privileges)
+* [`name`](#name)
+* [`provider`](#provider)
+
+##### <a name="drop_privileges"></a>`drop_privileges`
+
+Valid values: ``true``, ``false``, `yes`, `no`
+
+Whether to drop privileges when writing the key file. This is
+useful for creating files in paths not writable by the target user. Note
+the possible security implications of managing file ownership and
+permissions as a privileged user.
+
+Default value: ``true``
+
+##### <a name="name"></a>`name`
namevar
@@ -120,23 +151,17 @@ Due to internal limitations, this must be unique across all user accounts;
if you want to specify one key for multiple users, you must use a different
comment for each instance.
-##### `drop_privileges`
-
-Whether to drop privileges when writing the key file. This is
-useful for creating files in paths not writable by the target user. Note
-the possible security implications of managing file ownership and
-permissions as a privileged user.
-
-Default value: `true`
+##### <a name="provider"></a>`provider`
-### sshkey
+The specific backend to use for this `ssh_authorized_key` resource. You will seldom need to specify this --- Puppet will
+usually discover the appropriate provider for your platform.
-Installs and manages ssh host keys. By default, this type will
-install keys into `/etc/ssh/ssh_known_hosts`. To manage ssh keys in a
-different `known_hosts` file, such as a user's personal `known_hosts`,
-pass its path to the `target` parameter. See the `ssh_authorized_key`
-type to manage authorized keys.
+### <a name="sshkey"></a>`sshkey`
+By default, this type will install keys into `/etc/ssh/ssh_known_hosts`.
+To manage ssh keys in a different `known_hosts` file, such as a user's personal
+`known_hosts`, pass its path to the `target` parameter. See the
+`ssh_authorized_key` type to manage authorized keys.
#### Properties
@@ -144,19 +169,16 @@ The following properties are available in the `sshkey` type.
##### `ensure`
-Valid values: present, absent
+Valid values: `present`, `absent`
The basic property that the resource should be in.
-Default value: present
-
-##### `type`
-
-Valid values: ssh-dss, ssh-ed25519, ssh-rsa, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, dsa, ed25519, rsa
+Default value: `present`
-Aliases: "dsa"=>"ssh-dss", "ed25519"=>"ssh-ed25519", "rsa"=>"ssh-rsa"
+##### `host_aliases`
-The encryption type used. Probably ssh-dss or ssh-rsa.
+Any aliases the host might have. Multiple values must be
+specified as an array.
##### `key`
@@ -170,11 +192,6 @@ other attributes):
* Key identifiers / comments, such as 'joescomputer.local' --- put these in
the `name` attribute/resource title.
-##### `host_aliases`
-
-Any aliases the host might have. Multiple values must be
-specified as an array.
-
##### `target`
The file in which to store the ssh key. Only used by
@@ -184,10 +201,28 @@ the `parsed` provider.
The following parameters are available in the `sshkey` type.
-##### `name`
+* [`name`](#name)
+* [`provider`](#provider)
+* [`type`](#type)
+
+##### <a name="name"></a>`name`
namevar
The host name that the key is associated with.
+##### <a name="provider"></a>`provider`
+
+The specific backend to use for this `sshkey` resource. You will seldom need to specify this --- Puppet will usually
+discover the appropriate provider for your platform.
+
+##### <a name="type"></a>`type`
+
+Valid values: `ssh-dss`, `ssh-ed25519`, `ssh-rsa`, `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, `ecdsa-sha2-nistp521`, `sk-ecdsa-sha2-nistp256@openssh.com`, `sk-ssh-ed25519@openssh.com`, `dsa`, `ed25519`, `rsa`, `ecdsa-sk`, `ed25519-sk`
+
+namevar
+
+Aliases: `"dsa"=>"ssh-dss", "ed25519"=>"ssh-ed25519", "rsa"=>"ssh-rsa", "ecdsa-sk"=>"sk-ecdsa-sha2-nistp256@openssh.com", "ed25519-sk"=>"sk-ssh-ed25519@openssh.com"`
+
+The encryption type used. Probably ssh-dss or ssh-rsa.
diff --git a/Rakefile b/Rakefile
index 6d53503..2906c15 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,10 +1,12 @@
+# frozen_string_literal: true
+
+require 'bundler'
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any?
require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any?
-require 'puppet-lint/tasks/puppet-lint'
def changelog_user
return unless Rake.application.top_level_tasks.include? "changelog"
@@ -33,7 +35,7 @@ end
def changelog_future_release
return unless Rake.application.top_level_tasks.include? "changelog"
- returnVal = "%s" % JSON.load(File.read('metadata.json'))['version']
+ returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version']
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator future_release:#{returnVal}"
returnVal
@@ -51,7 +53,7 @@ if Bundler.rubygems.find_name('github_changelog_generator').any?
config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)."
config.add_pr_wo_labels = true
config.issues = false
- config.merge_prefix = "### UNCATEGORIZED PRS; GO LABEL THEM"
+ config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
config.configure_sections = {
"Changed" => {
"prefix" => "### Changed",
@@ -59,11 +61,11 @@ if Bundler.rubygems.find_name('github_changelog_generator').any?
},
"Added" => {
"prefix" => "### Added",
- "labels" => ["feature", "enhancement"],
+ "labels" => ["enhancement", "feature"],
},
"Fixed" => {
"prefix" => "### Fixed",
- "labels" => ["bugfix"],
+ "labels" => ["bug", "documentation", "bugfix"],
},
}
end
@@ -71,42 +73,16 @@ else
desc 'Generate a Changelog from GitHub'
task :changelog do
raise <<EOM
-The changelog tasks depends on unreleased features of the github_changelog_generator gem.
+The changelog tasks depends on recent features of the github_changelog_generator gem.
Please manually add it to your .sync.yml for now, and run `pdk update`:
---
Gemfile:
optional:
':development':
- gem: 'github_changelog_generator'
- git: 'https://github.com/skywinder/github-changelog-generator'
- ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
- condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
+ version: '~> 1.15'
+ condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
EOM
end
end
-desc "verify that commit messages match CONTRIBUTING.md requirements"
-task(:commits) do
- # This rake task looks at the summary from every commit from this branch not
- # in the branch targeted for a PR.
- commit_range = 'HEAD^..HEAD'
- puts "Checking commits #{commit_range}"
- %x{git log --no-merges --pretty=%s #{commit_range}}.each_line do |commit_summary|
- # This regex tests for the currently supported commit summary tokens.
- # The exception tries to explain it in more full.
- if /^\((maint|packaging|doc|docs|modules-\d+)\)|revert/i.match(commit_summary).nil?
- raise "\n\n\n\tThis commit summary didn't match CONTRIBUTING.md guidelines:\n" \
- "\n\t\t#{commit_summary}\n" \
- "\tThe commit summary (i.e. the first line of the commit message) should start with one of:\n" \
- "\t\t(MODULES-<digits>) # this is most common and should be a ticket at tickets.puppet.com\n" \
- "\t\t(docs)\n" \
- "\t\t(docs)(DOCUMENT-<digits>)\n" \
- "\t\t(packaging)\n"
- "\t\t(maint)\n" \
- "\n\tThis test for the commit summary is case-insensitive.\n\n\n"
- else
- puts "#{commit_summary}"
- end
- puts "...passed"
- end
-end
diff --git a/lib/puppet/type/ssh_authorized_key.rb b/lib/puppet/type/ssh_authorized_key.rb
index 9749e29..701dfe5 100644
--- a/lib/puppet/type/ssh_authorized_key.rb
+++ b/lib/puppet/type/ssh_authorized_key.rb
@@ -2,16 +2,17 @@ require 'puppet/parameter/boolean'
module Puppet
Type.newtype(:ssh_authorized_key) do
- @doc = "Manages SSH authorized keys. Currently only type 2 keys are supported.
+ @doc = "@summary Manages SSH authorized keys. Currently only type 2 keys are supported.
In their native habitat, SSH keys usually appear as a single long line, in
the format `<TYPE> <KEY> <NAME/COMMENT>`. This resource type requires you
- to split that line into several attributes. Thus, a key that appears in
- your `~/.ssh/id_rsa.pub` file like this...
+ to split that line into several attributes.
+
+ @example Thus, a key that appears in your `~/.ssh/id_rsa.pub` file like this...
ssh-rsa AAAAB3Nza[...]qXfdaQ== nick@magpie.example.com
- ...would translate to the following resource:
+ @example ...would translate to the following resource:
ssh_authorized_key { 'nick@magpie.example.com':
ensure => present,
@@ -21,8 +22,9 @@ module Puppet
}
To ensure that only the currently approved keys are present, you can purge
- unmanaged SSH keys on a per-user basis. Do this with the `user` resource
- type's `purge_ssh_keys` attribute:
+ unmanaged SSH keys on a per-user basis.
+
+ @example Do this with the `user` resource type's `purge_ssh_keys` attribute:
user { 'nick':
ensure => present,
@@ -86,7 +88,7 @@ module Puppet
the `name` attribute/resource title."
validate do |value|
- raise Puppet::Error, _('Key must not contain whitespace: %{value}') % { value: value } if value =~ %r{\s}
+ raise Puppet::Error, _('Key must not contain whitespace: %{value}') % { value: value } if %r{\s}.match?(value)
end
end
@@ -110,10 +112,10 @@ module Puppet
return nil unless resource[:user]
begin
- return File.expand_path("~#{resource[:user]}/.ssh/authorized_keys")
+ File.expand_path("~#{resource[:user]}/.ssh/authorized_keys")
rescue
Puppet.debug 'The required user is not yet present on the system'
- return nil
+ nil
end
end
@@ -169,7 +171,7 @@ module Puppet
sk-ecdsa-sha2-nistp256@openssh.com|sk-ssh-ed25519@openssh.com|
ssh-rsa-cert-v01@openssh.com|ssh-ed25519-cert-v01@openssh.com|
ssh-dss-cert-v01@openssh.com|ecdsa-sha2-nistp256-cert-v01@openssh.com|
- ecdsa-sha2-nistp384-cert-v01@openssh.com|ecdsa-sha2-nistp521-cert-v01@openssh.com)\s+([^ ]+)\s*(.*)$}x
+ ecdsa-sha2-nistp384-cert-v01@openssh.com|ecdsa-sha2-nistp521-cert-v01@openssh.com)\s+([^ ]+)\s*(.*)$}x.freeze
def self.keyline_regex
REGEX
end
diff --git a/lib/puppet/type/sshkey.rb b/lib/puppet/type/sshkey.rb
index 6e603a2..11d6cef 100644
--- a/lib/puppet/type/sshkey.rb
+++ b/lib/puppet/type/sshkey.rb
@@ -1,10 +1,10 @@
module Puppet
Type.newtype(:sshkey) do
- @doc = "Installs and manages ssh host keys. By default, this type will
- install keys into `/etc/ssh/ssh_known_hosts`. To manage ssh keys in a
- different `known_hosts` file, such as a user's personal `known_hosts`,
- pass its path to the `target` parameter. See the `ssh_authorized_key`
- type to manage authorized keys."
+ @doc = "@summary Installs and manages ssh host keys.
+ By default, this type will install keys into `/etc/ssh/ssh_known_hosts`.
+ To manage ssh keys in a different `known_hosts` file, such as a user's personal
+ `known_hosts`, pass its path to the `target` parameter. See the
+ `ssh_authorized_key` type to manage authorized keys."
ensurable
@@ -82,10 +82,10 @@ module Puppet
end
validate do |value|
- if value =~ %r{\s}
+ if %r{\s}.match?(value)
raise Puppet::Error, _('Aliases cannot include whitespace')
end
- if value =~ %r{,}
+ if %r{,}.match?(value)
raise Puppet::Error, _('Aliases must be provided as an array, not a comma-separated list')
end
end
@@ -97,7 +97,7 @@ module Puppet
isnamevar
validate do |value|
- raise Puppet::Error, _('Resourcename cannot include whitespaces') if value =~ %r{\s}
+ raise Puppet::Error, _('Resourcename cannot include whitespaces') if %r{\s}.match?(value)
raise Puppet::Error, _('No comma in resourcename allowed. If you want to specify aliases use the host_aliases property') if value.include?(',')
end
end
diff --git a/metadata.json b/metadata.json
index 6544786..0841674 100644
--- a/metadata.json
+++ b/metadata.json
@@ -57,7 +57,7 @@
"version_requirement": ">= 6.0.0 < 8.0.0"
}
],
- "pdk-version": "1.14.0",
- "template-url": "https://github.com/puppetlabs/pdk-templates#1.14.0",
- "template-ref": "1.14.0-0-g1bf3a4e"
+ "pdk-version": "2.2.0",
+ "template-url": "https://github.com/puppetlabs/pdk-templates#2.2.0",
+ "template-ref": "tags/2.2.0-0-g2381db6"
}
diff --git a/rakelib/commits.rake b/rakelib/commits.rake
new file mode 100644
index 0000000..42eb209
--- /dev/null
+++ b/rakelib/commits.rake
@@ -0,0 +1,26 @@
+desc "verify that commit messages match CONTRIBUTING.md requirements"
+task(:commits) do
+ # This rake task looks at the summary from every commit from this branch not
+ # in the branch targeted for a PR.
+ commit_range = 'HEAD^..HEAD'
+ puts "Checking commits #{commit_range}"
+ %x{git log --no-merges --pretty=%s #{commit_range}}.each_line do |commit_summary|
+ # This regex tests for the currently supported commit summary tokens.
+ # The exception tries to explain it in more full.
+ if /^Release prep|\((maint|packaging|doc|docs|modules-\d+)\)|revert/i.match(commit_summary).nil?
+ raise "\n\n\n\tThis commit summary didn't match CONTRIBUTING.md guidelines:\n" \
+ "\n\t\t#{commit_summary}\n" \
+ "\tThe commit summary (i.e. the first line of the commit message) should start with one of:\n" \
+ "\t\t(MODULES-<digits>) # this is most common and should be a ticket at tickets.puppet.com\n" \
+ "\t\t(docs)\n" \
+ "\t\t(docs)(DOCUMENT-<digits>)\n" \
+ "\t\t(packaging)\n"
+ "\t\t(maint)\n" \
+ "\t\tRelease prep v<tag>\n" \
+ "\n\tThis test for the commit summary is case-insensitive.\n\n\n"
+ else
+ puts "#{commit_summary}"
+ end
+ puts "...passed"
+ end
+end
diff --git a/spec/acceptance/tests/resource/ssh_authorized_key/create_spec.rb b/spec/acceptance/tests/resource/ssh_authorized_key/create_spec.rb
index bfc75a7..d19d328 100644
--- a/spec/acceptance/tests/resource/ssh_authorized_key/create_spec.rb
+++ b/spec/acceptance/tests/resource/ssh_authorized_key/create_spec.rb
@@ -65,7 +65,7 @@ RSpec.context 'ssh_authorized_key: Create' do
'drop_privileges=false',
"target=/home/testuser/tmp/ssh_authorized_keys_#{name}/authorized_keys_#{name}"]
on(agent, puppet_resource('ssh_authorized_key', name.to_s, args)) do |_res|
- fail_test unless stderr =~ %r{the target path is not trusted}
+ fail_test unless %r{the target path is not trusted}.match?(stderr)
end
on(agent, "rm -rf #{custom_key_directory}")
@@ -81,7 +81,7 @@ RSpec.context 'ssh_authorized_key: Create' do
'drop_privileges=false',
"target='#{custom_key}'"]
on(agent, puppet_resource('ssh_authorized_key', name.to_s, args), acceptable_exit_codes: [0, 1]) do |_res|
- fail_test unless stderr =~ %r{the target path is not trusted}
+ fail_test unless %r{the target path is not trusted}.match?(stderr)
end
end
end
diff --git a/spec/integration/provider/ssh_authorized_key_spec.rb b/spec/integration/provider/ssh_authorized_key_spec.rb
index 9e9801d..b177c2c 100644
--- a/spec/integration/provider/ssh_authorized_key_spec.rb
+++ b/spec/integration/provider/ssh_authorized_key_spec.rb
@@ -12,23 +12,23 @@ describe Puppet::Type.type(:ssh_authorized_key).provider(:parsed), unless: Puppe
tmpfile('authorized_keys.root')
end
- # rubocop:disable Metrics/LineLength
+ # rubocop:disable Layout/LineLength
let :sample_rsa_keys do
[
'AAAAB3NzaC1yc2EAAAADAQABAAAAgQCi18JBZOq10X3w4f67nVhO0O3s5Y1vHH4UgMSM3ZnQwbC5hjGyYSi9UULOoQQoQynI/a0I9NL423/Xk/XJVIKCHcS8q6V2Wmjd+fLNelOjxxoW6mbIytEt9rDvwgq3Mof3/m21L3t2byvegR00a+ikKbmInPmKwjeWZpexCIsHzQ==', # 1024 bit
'AAAAB3NzaC1yc2EAAAADAQABAAAAgQDLClyvi3CsJw5Id6khZs2/+s11qOH4Gdp6iDioDsrIp0m8kSiPr71VGyQYAfPzzvHemHS7Xg0NkG1Kc8u9tRqBQfTvz7ubq0AT/g01+4P2hQ/soFkuwlUG/HVnnaYb6N0Qp5SHWvD5vBE2nFFQVpP5GrSctPtHSjzJq/i+6LYhmQ==', # 1024 bit
- 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDLygAO6txXkh9FNV8xSsBkATeqLbHzS7sFjGI3gt0Dx6q3LjyKwbhQ1RLf28kd5G6VWiXmClU/RtiPdUz8nrGuun++2mrxzrXrvpR9dq1lygLQ2wn2cI35dN5bjRMtXy3decs6HUhFo9MoNwX250rUWfdCyNPhGIp6OOfmjdy+UeLGNxq9wDx6i4bT5tVVSqVRtsEfw9+ICXchzl85QudjneVVpP+thriPZXfXA5eaGwAo/dmoKOIhUwF96gpdLqzNtrGQuxPbV80PTbGv9ZtAtTictxaDz8muXO7he9pXmchUpxUKtMFjHkL0FAZ9tRPmv3RA30sEr2fZ8+LKvnE50w0' # 2048 Bit
+ 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDLygAO6txXkh9FNV8xSsBkATeqLbHzS7sFjGI3gt0Dx6q3LjyKwbhQ1RLf28kd5G6VWiXmClU/RtiPdUz8nrGuun++2mrxzrXrvpR9dq1lygLQ2wn2cI35dN5bjRMtXy3decs6HUhFo9MoNwX250rUWfdCyNPhGIp6OOfmjdy+UeLGNxq9wDx6i4bT5tVVSqVRtsEfw9+ICXchzl85QudjneVVpP+thriPZXfXA5eaGwAo/dmoKOIhUwF96gpdLqzNtrGQuxPbV80PTbGv9ZtAtTictxaDz8muXO7he9pXmchUpxUKtMFjHkL0FAZ9tRPmv3RA30sEr2fZ8+LKvnE50w0', # 2048 Bit
]
end
- # rubocop:enable Metrics/LineLength
+ # rubocop:enable Layout/LineLength
- # rubocop:disable Metrics/LineLength
+ # rubocop:disable Layout/LineLength
let :sample_dsa_keys do
[
- 'AAAAB3NzaC1kc3MAAACBAOPck2O8MIDSqxPSnvENt6tzRrKJ5oOhB6Nc6oEcWm+VEH1gvuxdiRqwoMgRwyEf1yUd+UAcLw3a6Jn+EtFyEBN/5WF+4Tt4xTxZ0Pfik2Wc5uqHbQ2dkmOoXiAOYPiD3JUQ1Xwm/J0CgetjitoLfzAGdCNhMqguqAuHcVJ78ZZbAAAAFQCIBKFYZ+I18I+dtgteirXh+VVEEwAAAIEAs1yvQ/wnLLrRCM660pF4kBiw3D6dJfMdCXWQpn0hZmkBQSIzZv4Wuk3giei5luxscDxNc+y3CTXtnyG4Kt1Yi2sOdvhRI3rX8tD+ejn8GHazM05l5VIo9uu4AQPIE32iV63IqgApSBbJ6vDJW91oDH0J492WdLCar4BS/KE3cRwAAACBAN0uSDyJqYLRsfYcFn4HyVf6TJxQm1IcwEt6GcJVzgjri9VtW7FqY5iBqa9B9Zdh5XXAYJ0XLsWQCcrmMHM2XGHGpA4gL9VlCJ/0QvOcXxD2uK7IXwAVUA7g4V4bw8EVnFv2Flufozhsp+4soo1xiYc5jiFVHwVlk21sMhAtKAeF' # 1024 Bit
+ 'AAAAB3NzaC1kc3MAAACBAOPck2O8MIDSqxPSnvENt6tzRrKJ5oOhB6Nc6oEcWm+VEH1gvuxdiRqwoMgRwyEf1yUd+UAcLw3a6Jn+EtFyEBN/5WF+4Tt4xTxZ0Pfik2Wc5uqHbQ2dkmOoXiAOYPiD3JUQ1Xwm/J0CgetjitoLfzAGdCNhMqguqAuHcVJ78ZZbAAAAFQCIBKFYZ+I18I+dtgteirXh+VVEEwAAAIEAs1yvQ/wnLLrRCM660pF4kBiw3D6dJfMdCXWQpn0hZmkBQSIzZv4Wuk3giei5luxscDxNc+y3CTXtnyG4Kt1Yi2sOdvhRI3rX8tD+ejn8GHazM05l5VIo9uu4AQPIE32iV63IqgApSBbJ6vDJW91oDH0J492WdLCar4BS/KE3cRwAAACBAN0uSDyJqYLRsfYcFn4HyVf6TJxQm1IcwEt6GcJVzgjri9VtW7FqY5iBqa9B9Zdh5XXAYJ0XLsWQCcrmMHM2XGHGpA4gL9VlCJ/0QvOcXxD2uK7IXwAVUA7g4V4bw8EVnFv2Flufozhsp+4soo1xiYc5jiFVHwVlk21sMhAtKAeF', # 1024 Bit
]
end
- # rubocop:enable Metrics/LineLength
+ # rubocop:enable Layout/LineLength
let :sample_lines do
[
diff --git a/spec/integration/provider/sshkey_spec.rb b/spec/integration/provider/sshkey_spec.rb
index 6b92b56..11e98b5 100644
--- a/spec/integration/provider/sshkey_spec.rb
+++ b/spec/integration/provider/sshkey_spec.rb
@@ -130,7 +130,7 @@ describe Puppet::Type.type(:sshkey).provider(:parsed), unless: Puppet.features.m
'ed25519-sk' => 'sk-ssh-ed25519@openssh.com',
}
types.each do |type|
- it "should update an entry with #{type} type" do
+ it "updates an entry with #{type} type" do
manifest = "#{type_under_test} { '#{sshkey_name}':
ensure => 'present',
type => '#{type}',
diff --git a/spec/lib/puppet_spec/files.rb b/spec/lib/puppet_spec/files.rb
index 201baf5..55643c6 100644
--- a/spec/lib/puppet_spec/files.rb
+++ b/spec/lib/puppet_spec/files.rb
@@ -13,7 +13,7 @@ module PuppetSpec::Files
begin
allow(Dir).to receive(:entries).and_call_original
FileUtils.rm_rf path, secure: true
- rescue Errno::ENOENT # rubocop:disable Lint/HandleExceptions
+ rescue Errno::ENOENT
# nothing to do
end
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 29615cd..9b1fa6f 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,3 +1,9 @@
+# frozen_string_literal: true
+
+RSpec.configure do |c|
+ c.mock_with :rspec
+end
+
require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
@@ -31,16 +37,28 @@ default_facts.each do |fact, value|
end
RSpec.configure do |c|
- c.mock_with :rspec
c.default_facts = default_facts
c.before :each do
# set to strictest setting for testing
# by default Puppet runs at warning level
Puppet.settings[:strict] = :warning
+ Puppet.settings[:strict_variables] = true
end
c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT']
c.after(:suite) do
end
+
+ # Filter backtrace noise
+ backtrace_exclusion_patterns = [
+ %r{spec_helper},
+ %r{gems},
+ ]
+
+ if c.respond_to?(:backtrace_exclusion_patterns)
+ c.backtrace_exclusion_patterns = backtrace_exclusion_patterns
+ elsif c.respond_to?(:backtrace_clean_patterns)
+ c.backtrace_clean_patterns = backtrace_exclusion_patterns
+ end
end
# Ensures that a module is defined
diff --git a/spec/unit/provider/sshkey/parsed_spec.rb b/spec/unit/provider/sshkey/parsed_spec.rb
index e839cfe..ae37f10 100644
--- a/spec/unit/provider/sshkey/parsed_spec.rb
+++ b/spec/unit/provider/sshkey/parsed_spec.rb
@@ -11,7 +11,7 @@ describe 'sshkey parsed provider' do
end
def key
- 'AAAAB3NzaC1yc2EAAAABIwAAAQEAzwHhxXvIrtfIwrudFqc8yQcIfMudrgpnuh1F3AV6d2BrLgu/yQE7W5UyJMUjfj427sQudRwKW45O0Jsnr33F4mUw+GIMlAAmp9g24/OcrTiB8ZUKIjoPy/cO4coxGi8/NECtRzpD/ZUPFh6OEpyOwJPMb7/EC2Az6Otw4StHdXUYw22zHazBcPFnv6zCgPx1hA7QlQDWTu4YcL0WmTYQCtMUb3FUqrcFtzGDD0ytosgwSd+JyN5vj5UwIABjnNOHPZ62EY1OFixnfqX/+dUwrFSs5tPgBF/KkC6R7tmbUfnBON6RrGEmu+ajOTOLy23qUZB4CQ53V7nyAWhzqSK+hw==' # rubocop:disable Metrics/LineLength
+ 'AAAAB3NzaC1yc2EAAAABIwAAAQEAzwHhxXvIrtfIwrudFqc8yQcIfMudrgpnuh1F3AV6d2BrLgu/yQE7W5UyJMUjfj427sQudRwKW45O0Jsnr33F4mUw+GIMlAAmp9g24/OcrTiB8ZUKIjoPy/cO4coxGi8/NECtRzpD/ZUPFh6OEpyOwJPMb7/EC2Az6Otw4StHdXUYw22zHazBcPFnv6zCgPx1hA7QlQDWTu4YcL0WmTYQCtMUb3FUqrcFtzGDD0ytosgwSd+JyN5vj5UwIABjnNOHPZ62EY1OFixnfqX/+dUwrFSs5tPgBF/KkC6R7tmbUfnBON6RrGEmu+ajOTOLy23qUZB4CQ53V7nyAWhzqSK+hw==' # rubocop:disable Layout/LineLength
end
it 'parses the name from the first field' do
diff --git a/spec/unit/type/ssh_authorized_key_spec.rb b/spec/unit/type/ssh_authorized_key_spec.rb
index 5c1eddd..3ad2092 100644
--- a/spec/unit/type/ssh_authorized_key_spec.rb
+++ b/spec/unit/type/ssh_authorized_key_spec.rb
@@ -126,59 +126,59 @@ describe Puppet::Type.type(:ssh_authorized_key), unless: Puppet.features.microso
end
describe 'for key' do
- # rubocop:disable Metrics/LineLength
+ # rubocop:disable Layout/LineLength
it 'supports a valid key like a 1024 bit rsa key' do
expect { described_class.new(name: 'whev', type: :rsa, user: 'nobody', key: 'AAAAB3NzaC1yc2EAAAADAQABAAAAgQDCPfzW2ry7XvMc6E5Kj2e5fF/YofhKEvsNMUogR3PGL/HCIcBlsEjKisrY0aYgD8Ikp7ZidpXLbz5dBsmPy8hJiBWs5px9ZQrB/EOQAwXljvj69EyhEoGawmxQMtYw+OAIKHLJYRuk1QiHAMHLp5piqem8ZCV2mLb9AsJ6f7zUVw==') }.not_to raise_error
end
- # rubocop:enable Metrics/LineLength
+ # rubocop:enable Layout/LineLength
- # rubocop:disable Metrics/LineLength
+ # rubocop:disable Layout/LineLength
it 'supports a valid key like a 4096 bit rsa key' do
- expect { described_class.new(name: 'whev', type: :rsa, user: 'nobody', key: 'AAAAB3NzaC1yc2EAAAADAQABAAACAQDEY4pZFyzSfRc9wVWI3DfkgT/EL033UZm/7x1M+d+lBD00qcpkZ6CPT7lD3Z+vylQlJ5S8Wcw6C5Smt6okZWY2WXA9RCjNJMIHQbJAzwuQwgnwU/1VMy9YPp0tNVslg0sUUgpXb13WW4mYhwxyGmIVLJnUrjrQmIFhtfHsJAH8ZVqCWaxKgzUoC/YIu1u1ScH93lEdoBPLlwm6J0aiM7KWXRb7Oq1nEDZtug1zpX5lhgkQWrs0BwceqpUbY+n9sqeHU5e7DCyX/yEIzoPRW2fe2Gx1Iq6JKM/5NNlFfaW8rGxh3Z3S1NpzPHTRjw8js3IeGiV+OPFoaTtM1LsWgPDSBlzIdyTbSQR7gKh0qWYCNV/7qILEfa0yIFB5wIo4667iSPZw2pNgESVtenm8uXyoJdk8iWQ4mecdoposV/znknNb2GPgH+n/2vme4btZ0Sl1A6rev22GQjVgbWOn8zaDglJ2vgCN1UAwmq41RXprPxENGeLnWQppTnibhsngu0VFllZR5kvSIMlekLRSOFLFt92vfd+tk9hZIiKm9exxcbVCGGQPsf6dZ27rTOmg0xM2Sm4J6RRKuz79HQgA4Eg18+bqRP7j/itb89DmtXEtoZFAsEJw8IgIfeGGDtHTkfAlAC92mtK8byeaxGq57XCTKbO/r5gcOMElZHy1AcB8kw==') }.not_to raise_error # rubocop:disable Metrics/LineLength
+ expect { described_class.new(name: 'whev', type: :rsa, user: 'nobody', key: 'AAAAB3NzaC1yc2EAAAADAQABAAACAQDEY4pZFyzSfRc9wVWI3DfkgT/EL033UZm/7x1M+d+lBD00qcpkZ6CPT7lD3Z+vylQlJ5S8Wcw6C5Smt6okZWY2WXA9RCjNJMIHQbJAzwuQwgnwU/1VMy9YPp0tNVslg0sUUgpXb13WW4mYhwxyGmIVLJnUrjrQmIFhtfHsJAH8ZVqCWaxKgzUoC/YIu1u1ScH93lEdoBPLlwm6J0aiM7KWXRb7Oq1nEDZtug1zpX5lhgkQWrs0BwceqpUbY+n9sqeHU5e7DCyX/yEIzoPRW2fe2Gx1Iq6JKM/5NNlFfaW8rGxh3Z3S1NpzPHTRjw8js3IeGiV+OPFoaTtM1LsWgPDSBlzIdyTbSQR7gKh0qWYCNV/7qILEfa0yIFB5wIo4667iSPZw2pNgESVtenm8uXyoJdk8iWQ4mecdoposV/znknNb2GPgH+n/2vme4btZ0Sl1A6rev22GQjVgbWOn8zaDglJ2vgCN1UAwmq41RXprPxENGeLnWQppTnibhsngu0VFllZR5kvSIMlekLRSOFLFt92vfd+tk9hZIiKm9exxcbVCGGQPsf6dZ27rTOmg0xM2Sm4J6RRKuz79HQgA4Eg18+bqRP7j/itb89DmtXEtoZFAsEJw8IgIfeGGDtHTkfAlAC92mtK8byeaxGq57XCTKbO/r5gcOMElZHy1AcB8kw==') }.not_to raise_error # rubocop:disable Layout/LineLength
end
- # rubocop:enable Metrics/LineLength
+ # rubocop:enable Layout/LineLength
- # rubocop:disable Metrics/LineLength
+ # rubocop:disable Layout/LineLength
it 'supports a valid key like a 1024 bit dsa key' do
- expect { described_class.new(name: 'whev', type: :dsa, user: 'nobody', key: 'AAAAB3NzaC1kc3MAAACBAI80iR78QCgpO4WabVqHHdEDigOjUEHwIjYHIubR/7u7DYrXY+e+TUmZ0CVGkiwB/0yLHK5dix3Y/bpj8ZiWCIhFeunnXccOdE4rq5sT2V3l1p6WP33RpyVYbLmeuHHl5VQ1CecMlca24nHhKpfh6TO/FIwkMjghHBfJIhXK+0w/AAAAFQDYzLupuMY5uz+GVrcP+Kgd8YqMmwAAAIB3SVN71whLWjFPNTqGyyIlMy50624UfNOaH4REwO+Of3wm/cE6eP8n75vzTwQGBpJX3BPaBGW1S1Zp/DpTOxhCSAwZzAwyf4WgW7YyAOdxN3EwTDJZeyiyjWMAOjW9/AOWt9gtKg0kqaylbMHD4kfiIhBzo31ZY81twUzAfN7angAAAIBfva8sTSDUGKsWWIXkdbVdvM4X14K4gFdy0ZJVzaVOtZ6alysW6UQypnsl6jfnbKvsZ0tFgvcX/CPyqNY/gMR9lyh/TCZ4XQcbqeqYPuceGehz+jL5vArfqsW2fJYFzgCcklmr/VxtP5h6J/T0c9YcDgc/xIfWdZAlznOnphI/FA==') }.not_to raise_error # rubocop:disable Metrics/LineLength
+ expect { described_class.new(name: 'whev', type: :dsa, user: 'nobody', key: 'AAAAB3NzaC1kc3MAAACBAI80iR78QCgpO4WabVqHHdEDigOjUEHwIjYHIubR/7u7DYrXY+e+TUmZ0CVGkiwB/0yLHK5dix3Y/bpj8ZiWCIhFeunnXccOdE4rq5sT2V3l1p6WP33RpyVYbLmeuHHl5VQ1CecMlca24nHhKpfh6TO/FIwkMjghHBfJIhXK+0w/AAAAFQDYzLupuMY5uz+GVrcP+Kgd8YqMmwAAAIB3SVN71whLWjFPNTqGyyIlMy50624UfNOaH4REwO+Of3wm/cE6eP8n75vzTwQGBpJX3BPaBGW1S1Zp/DpTOxhCSAwZzAwyf4WgW7YyAOdxN3EwTDJZeyiyjWMAOjW9/AOWt9gtKg0kqaylbMHD4kfiIhBzo31ZY81twUzAfN7angAAAIBfva8sTSDUGKsWWIXkdbVdvM4X14K4gFdy0ZJVzaVOtZ6alysW6UQypnsl6jfnbKvsZ0tFgvcX/CPyqNY/gMR9lyh/TCZ4XQcbqeqYPuceGehz+jL5vArfqsW2fJYFzgCcklmr/VxtP5h6J/T0c9YcDgc/xIfWdZAlznOnphI/FA==') }.not_to raise_error # rubocop:disable Layout/LineLength
end
- # rubocop:enable Metrics/LineLength
+ # rubocop:enable Layout/LineLength
- # rubocop:disable Metrics/LineLength
+ # rubocop:disable Layout/LineLength
it 'supports a valid ssh-rsa-cert-v01@openssh.com key' do
- expect { described_class.new(name: 'bastelfreakwashere', type: :'ssh-rsa-cert-v01@openssh.com', user: 'opensshrulez', key: 'AAAAHHNzaC1yc2EtY2VydC12MDFAb3BlbnNzaC5jb20AAAAg07B03uArzrZbW5YYiH8y+mT5NNjbKOfDVz13rBPyiDAAAAADAQABAAABgQCltzNwldRtt+sn0EXx9IMPeeoGRQUpOD2KyLW7BfJSf+40SJnsVE4MkuH1WiJnow9nwhTMtBEIkx7ocqw6bBXxrXmnqMV50DbLYZiEVz1UDRdXx5RMnNb3bbmmsyf/doNeyDjiIHAwNM4cSyUppTwLw3sU/YcdeNSBbFcUDt5dJpZw6OjiD+V3OTdvpbmBeG7sftNM6871SRmNyc2T79bwG0QxBd1XMMwgK8ZjRkCPDLVl63Jy1vbV00mT65Gd+2enSC9Lb63XHS9ixZQ+vPqn9cw8ESNq3M3tNMvLUj4HdjopaEO8CAMMIjXWIJz8oOPUGWu2oFkSpWAo9r/lW+ox6s1QGbjp0l86Ve9KybHpaVKkWn9wJUDqcF04n82PHYJFs0srn397iN5FC/DHpviEBmT/GAzLeqnslf2f9lGXA/UleVE6fI3WUwlzcEgIy6rrozxh4lEPe7f5CqDIkjv6cIrid9StzqBPQE7U10yjlr/U3EKYajv5Il7gIg/qRaMAAAAAAAAAAAAAAAIAAAAQaG9zdC5leGFtcGxlLmNvbQAAABQAAAAQaG9zdC5leGFtcGxlLmNvbQAAAABfLFAkAAAAAGEMMoEAAAAAAAAAAAAAAAAAAAGXAAAAB3NzaC1yc2EAAAADAQABAAABgQCltzNwldRtt+sn0EXx9IMPeeoGRQUpOD2KyLW7BfJSf+40SJnsVE4MkuH1WiJnow9nwhTMtBEIkx7ocqw6bBXxrXmnqMV50DbLYZiEVz1UDRdXx5RMnNb3bbmmsyf/doNeyDjiIHAwNM4cSyUppTwLw3sU/YcdeNSBbFcUDt5dJpZw6OjiD+V3OTdvpbmBeG7sftNM6871SRmNyc2T79bwG0QxBd1XMMwgK8ZjRkCPDLVl63Jy1vbV00mT65Gd+2enSC9Lb63XHS9ixZQ+vPqn9cw8ESNq3M3tNMvLUj4HdjopaEO8CAMMIjXWIJz8oOPUGWu2oFkSpWAo9r/lW+ox6s1QGbjp0l86Ve9KybHpaVKkWn9wJUDqcF04n82PHYJFs0srn397iN5FC/DHpviEBmT/GAzLeqnslf2f9lGXA/UleVE6fI3WUwlzcEgIy6rrozxh4lEPe7f5CqDIkjv6cIrid9StzqBPQE7U10yjlr/U3EKYajv5Il7gIg/qRaMAAAGUAAAADHJzYS1zaGEyLTUxMgAAAYAdrQYxs/y/eYGBLQJIDQkCN5MumF3s14rpivxdkow6hc3fClLiVF0KE8viyENPpYmhUMOPFqpm/acCz9ueP1kigHw1P8la2E7FFDyAOveD8qLE+y2MigjRq1ZGzc8C4mjZutA3v+MO2Jxa+X9ZBs99wYDfAsD/3LeNFQfHJK7PlxZCFF//ZOkOfR3nLHyIWF1XHLzZlXgM5pQbsrrZF2I0VCU+BhsBI0gBrmvSflEgBlZqCipChGPBaRybK+OLa4rUq+HzCnHsaJ3KMri8aN5TMlMd2tZPq3ZaaaBRgg67nqm7B76c0kBI9vApB4KvvPxReJTAL9YUMXRzrNLSxbraQXhx8JYKEyIad1o4TXqKZBj+qzpR0L+w8RGkNZ+OhJiisP5WMuR1oTgZNPqNYDmpU84GAnzXgdjR5NpTxneQPRGD8SfRC+RsNqI5Vs5J5n5Ap5MoqlttiY86C+Ofe4/6GVIWVQuDpSMzhaRbgEVj4XxT9VLuDSWy8/l85UxKkQ8=') }.not_to raise_error # rubocop:disable Metrics/LineLength
+ expect { described_class.new(name: 'bastelfreakwashere', type: :'ssh-rsa-cert-v01@openssh.com', user: 'opensshrulez', key: 'AAAAHHNzaC1yc2EtY2VydC12MDFAb3BlbnNzaC5jb20AAAAg07B03uArzrZbW5YYiH8y+mT5NNjbKOfDVz13rBPyiDAAAAADAQABAAABgQCltzNwldRtt+sn0EXx9IMPeeoGRQUpOD2KyLW7BfJSf+40SJnsVE4MkuH1WiJnow9nwhTMtBEIkx7ocqw6bBXxrXmnqMV50DbLYZiEVz1UDRdXx5RMnNb3bbmmsyf/doNeyDjiIHAwNM4cSyUppTwLw3sU/YcdeNSBbFcUDt5dJpZw6OjiD+V3OTdvpbmBeG7sftNM6871SRmNyc2T79bwG0QxBd1XMMwgK8ZjRkCPDLVl63Jy1vbV00mT65Gd+2enSC9Lb63XHS9ixZQ+vPqn9cw8ESNq3M3tNMvLUj4HdjopaEO8CAMMIjXWIJz8oOPUGWu2oFkSpWAo9r/lW+ox6s1QGbjp0l86Ve9KybHpaVKkWn9wJUDqcF04n82PHYJFs0srn397iN5FC/DHpviEBmT/GAzLeqnslf2f9lGXA/UleVE6fI3WUwlzcEgIy6rrozxh4lEPe7f5CqDIkjv6cIrid9StzqBPQE7U10yjlr/U3EKYajv5Il7gIg/qRaMAAAAAAAAAAAAAAAIAAAAQaG9zdC5leGFtcGxlLmNvbQAAABQAAAAQaG9zdC5leGFtcGxlLmNvbQAAAABfLFAkAAAAAGEMMoEAAAAAAAAAAAAAAAAAAAGXAAAAB3NzaC1yc2EAAAADAQABAAABgQCltzNwldRtt+sn0EXx9IMPeeoGRQUpOD2KyLW7BfJSf+40SJnsVE4MkuH1WiJnow9nwhTMtBEIkx7ocqw6bBXxrXmnqMV50DbLYZiEVz1UDRdXx5RMnNb3bbmmsyf/doNeyDjiIHAwNM4cSyUppTwLw3sU/YcdeNSBbFcUDt5dJpZw6OjiD+V3OTdvpbmBeG7sftNM6871SRmNyc2T79bwG0QxBd1XMMwgK8ZjRkCPDLVl63Jy1vbV00mT65Gd+2enSC9Lb63XHS9ixZQ+vPqn9cw8ESNq3M3tNMvLUj4HdjopaEO8CAMMIjXWIJz8oOPUGWu2oFkSpWAo9r/lW+ox6s1QGbjp0l86Ve9KybHpaVKkWn9wJUDqcF04n82PHYJFs0srn397iN5FC/DHpviEBmT/GAzLeqnslf2f9lGXA/UleVE6fI3WUwlzcEgIy6rrozxh4lEPe7f5CqDIkjv6cIrid9StzqBPQE7U10yjlr/U3EKYajv5Il7gIg/qRaMAAAGUAAAADHJzYS1zaGEyLTUxMgAAAYAdrQYxs/y/eYGBLQJIDQkCN5MumF3s14rpivxdkow6hc3fClLiVF0KE8viyENPpYmhUMOPFqpm/acCz9ueP1kigHw1P8la2E7FFDyAOveD8qLE+y2MigjRq1ZGzc8C4mjZutA3v+MO2Jxa+X9ZBs99wYDfAsD/3LeNFQfHJK7PlxZCFF//ZOkOfR3nLHyIWF1XHLzZlXgM5pQbsrrZF2I0VCU+BhsBI0gBrmvSflEgBlZqCipChGPBaRybK+OLa4rUq+HzCnHsaJ3KMri8aN5TMlMd2tZPq3ZaaaBRgg67nqm7B76c0kBI9vApB4KvvPxReJTAL9YUMXRzrNLSxbraQXhx8JYKEyIad1o4TXqKZBj+qzpR0L+w8RGkNZ+OhJiisP5WMuR1oTgZNPqNYDmpU84GAnzXgdjR5NpTxneQPRGD8SfRC+RsNqI5Vs5J5n5Ap5MoqlttiY86C+Ofe4/6GVIWVQuDpSMzhaRbgEVj4XxT9VLuDSWy8/l85UxKkQ8=') }.not_to raise_error # rubocop:disable Layout/LineLength
end
- # rubocop:enable Metrics/LineLength
+ # rubocop:enable Layout/LineLength
- # rubocop:disable Metrics/LineLength
+ # rubocop:disable Layout/LineLength
it 'supports a valid ssh-ed25519-cert-v01@openssh.com key' do
- expect { described_class.new(name: 'bastelfreakwashere', type: :'ssh-ed25519-cert-v01@openssh.com', user: 'opensshrulez', key: 'AAAAIHNzaC1lZDI1NTE5LWNlcnQtdjAxQG9wZW5zc2guY29tAAAAII03FWZnj5mlByzlCf6DrreuQ1xd4P06OpWVtTv1LA8tAAAAIAELyKZcNagkQdfPc484zFekxiBOfkTYW5WQp8ZEQ0yRAAAAAAAAAAAAAAACAAAAEGhvc3QuZXhhbXBsZS5jb20AAAAUAAAAEGhvc3QuZXhhbXBsZS5jb20AAAAAXyxVTAAAAABhDDeOAAAAAAAAAAAAAAAAAAAAMwAAAAtzc2gtZWQyNTUxOQAAACABC8imXDWoJEHXz3OPOMxXpMYgTn5E2FuVkKfGRENMkQAAAFMAAAALc3NoLWVkMjU1MTkAAABAMeOkwGO8xK4xLWXemAtcwyFkBT+I57PdBI9Y+6r2MpU8WqpvY8BpR8eohwzrSyTaxt/SeRrrQ+npfMY1g2z5DA==') }.not_to raise_error # rubocop:disable Metrics/LineLength
+ expect { described_class.new(name: 'bastelfreakwashere', type: :'ssh-ed25519-cert-v01@openssh.com', user: 'opensshrulez', key: 'AAAAIHNzaC1lZDI1NTE5LWNlcnQtdjAxQG9wZW5zc2guY29tAAAAII03FWZnj5mlByzlCf6DrreuQ1xd4P06OpWVtTv1LA8tAAAAIAELyKZcNagkQdfPc484zFekxiBOfkTYW5WQp8ZEQ0yRAAAAAAAAAAAAAAACAAAAEGhvc3QuZXhhbXBsZS5jb20AAAAUAAAAEGhvc3QuZXhhbXBsZS5jb20AAAAAXyxVTAAAAABhDDeOAAAAAAAAAAAAAAAAAAAAMwAAAAtzc2gtZWQyNTUxOQAAACABC8imXDWoJEHXz3OPOMxXpMYgTn5E2FuVkKfGRENMkQAAAFMAAAALc3NoLWVkMjU1MTkAAABAMeOkwGO8xK4xLWXemAtcwyFkBT+I57PdBI9Y+6r2MpU8WqpvY8BpR8eohwzrSyTaxt/SeRrrQ+npfMY1g2z5DA==') }.not_to raise_error # rubocop:disable Layout/LineLength
end
- # rubocop:enable Metrics/LineLength
+ # rubocop:enable Layout/LineLength
- # rubocop:disable Metrics/LineLength
+ # rubocop:disable Layout/LineLength
it 'supports a valid ssh-dss-cert-v01@openssh.com key' do
- expect { described_class.new(name: 'bastelfreakwashere', type: :'ssh-dss-cert-v01@openssh.com', user: 'opensshrulez', key: 'AAAAHHNzaC1kc3MtY2VydC12MDFAb3BlbnNzaC5jb20AAAAgcCc5I4UIAZWRjnkQx/IiMadlKaM8AncxZnEepHrJU7QAAACBAK+gMKBIurFf2QdcVgf+PVJBJlGcC61ej2pFSaZURhgcyhAzf0PAxWwWmeSb5m89PXy09Q4ufDV/iDTKCLV2/tM/fk8Nqk8zT8R92SCdVLy5mN7q8seFhrDeZ1zsWRU6nQHFYiwoS0VhtMyGp1J39mX7wJqbdnIuG/1cqhB4Lxh7AAAAFQDPYY2uOe2WOrQQQY50KUjsUUdrrwAAAIBOio9RBHQasCGAuXGczY2ORp3P0rsUlPR7pLJ9C1+wN1tLfTmOkn9iNmRR3O1xButRs1gBkhlTz7zRreWHOtcXOEoZmj1wIvPqFdmvKv4KX5krq2Dd6vcmTO1LW5CZXvlPM5hYK+IE5+bER1K68xjDIIZfiM0tEmBhnME8nXENeAAAAIEAlHywsFzvdR8VP3acZSHdy82iiKslTn1fOeS10uk+qYZXP7NOhUf+b9WhGSCcv3IzlCGSHs5ClfmABBWUDJyOxF3Fwlmx1z/detbJYgrSBc6bzrqqofac7pWjf3lN7pB/bX4zpN27BjIUwDxYvLRdHlrwA5vZTN98187wOt7D1cwAAAAAAAAAAAAAAAIAAAAQaG9zdC5leGFtcGxlLmNvbQAAABQAAAAQaG9zdC5leGFtcGxlLmNvbQAAAABfLFZ4AAAAAGEMOLkAAAAAAAAAAAAAAAAAAAGyAAAAB3NzaC1kc3MAAACBAK+gMKBIurFf2QdcVgf+PVJBJlGcC61ej2pFSaZURhgcyhAzf0PAxWwWmeSb5m89PXy09Q4ufDV/iDTKCLV2/tM/fk8Nqk8zT8R92SCdVLy5mN7q8seFhrDeZ1zsWRU6nQHFYiwoS0VhtMyGp1J39mX7wJqbdnIuG/1cqhB4Lxh7AAAAFQDPYY2uOe2WOrQQQY50KUjsUUdrrwAAAIBOio9RBHQasCGAuXGczY2ORp3P0rsUlPR7pLJ9C1+wN1tLfTmOkn9iNmRR3O1xButRs1gBkhlTz7zRreWHOtcXOEoZmj1wIvPqFdmvKv4KX5krq2Dd6vcmTO1LW5CZXvlPM5hYK+IE5+bER1K68xjDIIZfiM0tEmBhnME8nXENeAAAAIEAlHywsFzvdR8VP3acZSHdy82iiKslTn1fOeS10uk+qYZXP7NOhUf+b9WhGSCcv3IzlCGSHs5ClfmABBWUDJyOxF3Fwlmx1z/detbJYgrSBc6bzrqqofac7pWjf3lN7pB/bX4zpN27BjIUwDxYvLRdHlrwA5vZTN98187wOt7D1cwAAAA3AAAAB3NzaC1kc3MAAAAoqdL2M2Q5R6xBk1mym3GrtmF7EbAh0PX0LiQ78c4+eQaWHJ71cEIe6A==') }.not_to raise_error # rubocop:disable Metrics/LineLength
+ expect { described_class.new(name: 'bastelfreakwashere', type: :'ssh-dss-cert-v01@openssh.com', user: 'opensshrulez', key: 'AAAAHHNzaC1kc3MtY2VydC12MDFAb3BlbnNzaC5jb20AAAAgcCc5I4UIAZWRjnkQx/IiMadlKaM8AncxZnEepHrJU7QAAACBAK+gMKBIurFf2QdcVgf+PVJBJlGcC61ej2pFSaZURhgcyhAzf0PAxWwWmeSb5m89PXy09Q4ufDV/iDTKCLV2/tM/fk8Nqk8zT8R92SCdVLy5mN7q8seFhrDeZ1zsWRU6nQHFYiwoS0VhtMyGp1J39mX7wJqbdnIuG/1cqhB4Lxh7AAAAFQDPYY2uOe2WOrQQQY50KUjsUUdrrwAAAIBOio9RBHQasCGAuXGczY2ORp3P0rsUlPR7pLJ9C1+wN1tLfTmOkn9iNmRR3O1xButRs1gBkhlTz7zRreWHOtcXOEoZmj1wIvPqFdmvKv4KX5krq2Dd6vcmTO1LW5CZXvlPM5hYK+IE5+bER1K68xjDIIZfiM0tEmBhnME8nXENeAAAAIEAlHywsFzvdR8VP3acZSHdy82iiKslTn1fOeS10uk+qYZXP7NOhUf+b9WhGSCcv3IzlCGSHs5ClfmABBWUDJyOxF3Fwlmx1z/detbJYgrSBc6bzrqqofac7pWjf3lN7pB/bX4zpN27BjIUwDxYvLRdHlrwA5vZTN98187wOt7D1cwAAAAAAAAAAAAAAAIAAAAQaG9zdC5leGFtcGxlLmNvbQAAABQAAAAQaG9zdC5leGFtcGxlLmNvbQAAAABfLFZ4AAAAAGEMOLkAAAAAAAAAAAAAAAAAAAGyAAAAB3NzaC1kc3MAAACBAK+gMKBIurFf2QdcVgf+PVJBJlGcC61ej2pFSaZURhgcyhAzf0PAxWwWmeSb5m89PXy09Q4ufDV/iDTKCLV2/tM/fk8Nqk8zT8R92SCdVLy5mN7q8seFhrDeZ1zsWRU6nQHFYiwoS0VhtMyGp1J39mX7wJqbdnIuG/1cqhB4Lxh7AAAAFQDPYY2uOe2WOrQQQY50KUjsUUdrrwAAAIBOio9RBHQasCGAuXGczY2ORp3P0rsUlPR7pLJ9C1+wN1tLfTmOkn9iNmRR3O1xButRs1gBkhlTz7zRreWHOtcXOEoZmj1wIvPqFdmvKv4KX5krq2Dd6vcmTO1LW5CZXvlPM5hYK+IE5+bER1K68xjDIIZfiM0tEmBhnME8nXENeAAAAIEAlHywsFzvdR8VP3acZSHdy82iiKslTn1fOeS10uk+qYZXP7NOhUf+b9WhGSCcv3IzlCGSHs5ClfmABBWUDJyOxF3Fwlmx1z/detbJYgrSBc6bzrqqofac7pWjf3lN7pB/bX4zpN27BjIUwDxYvLRdHlrwA5vZTN98187wOt7D1cwAAAA3AAAAB3NzaC1kc3MAAAAoqdL2M2Q5R6xBk1mym3GrtmF7EbAh0PX0LiQ78c4+eQaWHJ71cEIe6A==') }.not_to raise_error # rubocop:disable Layout/LineLength
end
- # rubocop:enable Metrics/LineLength
+ # rubocop:enable Layout/LineLength
- # rubocop:disable Metrics/LineLength
+ # rubocop:disable Layout/LineLength
it 'supports a valid ecdsa-sha2-nistp256-cert-v01@openssh.com key' do
- expect { described_class.new(name: 'bastelfreakwashere', type: :'ecdsa-sha2-nistp256-cert-v01@openssh.com', user: 'opensshrulez', key: 'AAAAKGVjZHNhLXNoYTItbmlzdHAyNTYtY2VydC12MDFAb3BlbnNzaC5jb20AAAAgQUGk9Pzd+RqECXZMmgj8bFEumUGfZPEhJhyUusF7hvwAAAAIbmlzdHAyNTYAAABBBBmo/Yw8pVDSObTkJxlpYL5s9tVnpj7ubeky+PKY2zJ8pRYIHS3XJ6x/NyB/iFoYlGxrn4CaMPwNvYxvSEdTj60AAAAAAAAAAAAAAAIAAAAQaG9zdC5leGFtcGxlLmNvbQAAABQAAAAQaG9zdC5leGFtcGxlLmNvbQAAAABfLFfgAAAAAGEMOkIAAAAAAAAAAAAAAAAAAABoAAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBmo/Yw8pVDSObTkJxlpYL5s9tVnpj7ubeky+PKY2zJ8pRYIHS3XJ6x/NyB/iFoYlGxrn4CaMPwNvYxvSEdTj60AAABjAAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAABIAAAAIGkErINcPm1MpBhKuUmdR0KAPJGZCSeGT9E6FafcVhlFAAAAIERD5WsflI5QdJETz3n64tIDcdPbUF0GQW8iP8EV+Nf5') }.not_to raise_error # rubocop:disable Metrics/LineLength
+ expect { described_class.new(name: 'bastelfreakwashere', type: :'ecdsa-sha2-nistp256-cert-v01@openssh.com', user: 'opensshrulez', key: 'AAAAKGVjZHNhLXNoYTItbmlzdHAyNTYtY2VydC12MDFAb3BlbnNzaC5jb20AAAAgQUGk9Pzd+RqECXZMmgj8bFEumUGfZPEhJhyUusF7hvwAAAAIbmlzdHAyNTYAAABBBBmo/Yw8pVDSObTkJxlpYL5s9tVnpj7ubeky+PKY2zJ8pRYIHS3XJ6x/NyB/iFoYlGxrn4CaMPwNvYxvSEdTj60AAAAAAAAAAAAAAAIAAAAQaG9zdC5leGFtcGxlLmNvbQAAABQAAAAQaG9zdC5leGFtcGxlLmNvbQAAAABfLFfgAAAAAGEMOkIAAAAAAAAAAAAAAAAAAABoAAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBmo/Yw8pVDSObTkJxlpYL5s9tVnpj7ubeky+PKY2zJ8pRYIHS3XJ6x/NyB/iFoYlGxrn4CaMPwNvYxvSEdTj60AAABjAAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAABIAAAAIGkErINcPm1MpBhKuUmdR0KAPJGZCSeGT9E6FafcVhlFAAAAIERD5WsflI5QdJETz3n64tIDcdPbUF0GQW8iP8EV+Nf5') }.not_to raise_error # rubocop:disable Layout/LineLength
end
- # rubocop:enable Metrics/LineLength
+ # rubocop:enable Layout/LineLength
- # rubocop:disable Metrics/LineLength
+ # rubocop:disable Layout/LineLength
it 'supports a valid ecdsa-sha2-nistp384-cert-v01@openssh.com key' do
- expect { described_class.new(name: 'bastelfreakwashere', type: :'ecdsa-sha2-nistp384-cert-v01@openssh.com', user: 'opensshrulez', key: 'AAAAKGVjZHNhLXNoYTItbmlzdHAzODQtY2VydC12MDFAb3BlbnNzaC5jb20AAAAgh+/K6gv7WlwX9qVlKLH8Vurzo5xfc8/glVcT7auQOhIAAAAIbmlzdHAzODQAAABhBDouPHnR+OD4jfdqMbhFXTfB8vTjpZYLQSl0HxEXRAs8AgqDEZI1lJEVwdxtJUbczyu1Wj7wM45YpSpgUQVU38rmVkpxujqhhMMmqMWf87gnjm9oVLLFvJHdauKNnXjJQQAAAAAAAAAAAAAAAgAAABBob3N0LmV4YW1wbGUuY29tAAAAFAAAABBob3N0LmV4YW1wbGUuY29tAAAAAF8sWnQAAAAAYQw85wAAAAAAAAAAAAAAAAAAAIgAAAATZWNkc2Etc2hhMi1uaXN0cDM4NAAAAAhuaXN0cDM4NAAAAGEEOi48edH44PiN92oxuEVdN8Hy9OOllgtBKXQfERdECzwCCoMRkjWUkRXB3G0lRtzPK7VaPvAzjlilKmBRBVTfyuZWSnG6OqGEwyaoxZ/zuCeOb2hUssW8kd1q4o2deMlBAAAAgwAAABNlY2RzYS1zaGEyLW5pc3RwMzg0AAAAaAAAADBJccfmOaYjNVbqkx0X7cLpl53EzTAMdv9k159mBLYaepMnLYmhKx+LvfA5bAUTar4AAAAwSO7n770NIdhhMZjGio4GKDyKq2WW6QLRXleY6QcynBaQ90rkMVnt+jeIEs30h6F8') }.not_to raise_error # rubocop:disable Metrics/LineLength
+ expect { described_class.new(name: 'bastelfreakwashere', type: :'ecdsa-sha2-nistp384-cert-v01@openssh.com', user: 'opensshrulez', key: 'AAAAKGVjZHNhLXNoYTItbmlzdHAzODQtY2VydC12MDFAb3BlbnNzaC5jb20AAAAgh+/K6gv7WlwX9qVlKLH8Vurzo5xfc8/glVcT7auQOhIAAAAIbmlzdHAzODQAAABhBDouPHnR+OD4jfdqMbhFXTfB8vTjpZYLQSl0HxEXRAs8AgqDEZI1lJEVwdxtJUbczyu1Wj7wM45YpSpgUQVU38rmVkpxujqhhMMmqMWf87gnjm9oVLLFvJHdauKNnXjJQQAAAAAAAAAAAAAAAgAAABBob3N0LmV4YW1wbGUuY29tAAAAFAAAABBob3N0LmV4YW1wbGUuY29tAAAAAF8sWnQAAAAAYQw85wAAAAAAAAAAAAAAAAAAAIgAAAATZWNkc2Etc2hhMi1uaXN0cDM4NAAAAAhuaXN0cDM4NAAAAGEEOi48edH44PiN92oxuEVdN8Hy9OOllgtBKXQfERdECzwCCoMRkjWUkRXB3G0lRtzPK7VaPvAzjlilKmBRBVTfyuZWSnG6OqGEwyaoxZ/zuCeOb2hUssW8kd1q4o2deMlBAAAAgwAAABNlY2RzYS1zaGEyLW5pc3RwMzg0AAAAaAAAADBJccfmOaYjNVbqkx0X7cLpl53EzTAMdv9k159mBLYaepMnLYmhKx+LvfA5bAUTar4AAAAwSO7n770NIdhhMZjGio4GKDyKq2WW6QLRXleY6QcynBaQ90rkMVnt+jeIEs30h6F8') }.not_to raise_error # rubocop:disable Layout/LineLength
end
- # rubocop:enable Metrics/LineLength
+ # rubocop:enable Layout/LineLength
- # rubocop:disable Metrics/LineLength
+ # rubocop:disable Layout/LineLength
it 'supports a valid ecdsa-sha2-nistp521-cert-v01@openssh.com key' do
- expect { described_class.new(name: 'bastelfreakwashere', type: :'ecdsa-sha2-nistp521-cert-v01@openssh.com', user: 'opensshrulez', key: 'AAAAKGVjZHNhLXNoYTItbmlzdHA1MjEtY2VydC12MDFAb3BlbnNzaC5jb20AAAAg2xMe+Z9AuETNwM88pTDRpEtKbGRarajtZ5UaxSmmaQoAAAAIbmlzdHA1MjEAAACFBAFGg1vGsCq5kEzivd0s/kf0x5/TDzb0DwPzGz5YRsUtDlhT7+F7r2lVRvEEXCagc/UjTisIQ0kcG4IgMoI3VsaFEAHrBgF4whI/bhh6i+WzIHnT3NWkjqhdX+kLBXtlm+uFXyslmFlda4gGmjGeHvsDHgC2rN7cSuGh//3DBXtelkB+uQAAAAAAAAAAAAAAAgAAABBob3N0LmV4YW1wbGUuY29tAAAAFAAAABBob3N0LmV4YW1wbGUuY29tAAAAAF8sW9wAAAAAYQw+QgAAAAAAAAAAAAAAAAAAAKwAAAATZWNkc2Etc2hhMi1uaXN0cDUyMQAAAAhuaXN0cDUyMQAAAIUEAUaDW8awKrmQTOK93Sz+R/THn9MPNvQPA/MbPlhGxS0OWFPv4XuvaVVG8QRcJqBz9SNOKwhDSRwbgiAygjdWxoUQAesGAXjCEj9uGHqL5bMgedPc1aSOqF1f6QsFe2Wb64VfKyWYWV1riAaaMZ4e+wMeALas3txK4aH//cMFe16WQH65AAAApwAAABNlY2RzYS1zaGEyLW5pc3RwNTIxAAAAjAAAAEIA92a8QL5J/EMxRaKh9fSysTaEyyN/3KesBC8tI1rwytKILtfrcAIGxXtDQF6eZ72BWUvu6aqHIM6pmIHlnpzsROgAAABCAJHPzoeANenL8ZdlEf0jz8aEiGlGt02Z+vzsajQakKclFL4P8Nm5fojR2Mo2C45CQfO+kfkRQM1UUfDrVZcPzN0S') }.not_to raise_error # rubocop:disable Metrics/LineLength
+ expect { described_class.new(name: 'bastelfreakwashere', type: :'ecdsa-sha2-nistp521-cert-v01@openssh.com', user: 'opensshrulez', key: 'AAAAKGVjZHNhLXNoYTItbmlzdHA1MjEtY2VydC12MDFAb3BlbnNzaC5jb20AAAAg2xMe+Z9AuETNwM88pTDRpEtKbGRarajtZ5UaxSmmaQoAAAAIbmlzdHA1MjEAAACFBAFGg1vGsCq5kEzivd0s/kf0x5/TDzb0DwPzGz5YRsUtDlhT7+F7r2lVRvEEXCagc/UjTisIQ0kcG4IgMoI3VsaFEAHrBgF4whI/bhh6i+WzIHnT3NWkjqhdX+kLBXtlm+uFXyslmFlda4gGmjGeHvsDHgC2rN7cSuGh//3DBXtelkB+uQAAAAAAAAAAAAAAAgAAABBob3N0LmV4YW1wbGUuY29tAAAAFAAAABBob3N0LmV4YW1wbGUuY29tAAAAAF8sW9wAAAAAYQw+QgAAAAAAAAAAAAAAAAAAAKwAAAATZWNkc2Etc2hhMi1uaXN0cDUyMQAAAAhuaXN0cDUyMQAAAIUEAUaDW8awKrmQTOK93Sz+R/THn9MPNvQPA/MbPlhGxS0OWFPv4XuvaVVG8QRcJqBz9SNOKwhDSRwbgiAygjdWxoUQAesGAXjCEj9uGHqL5bMgedPc1aSOqF1f6QsFe2Wb64VfKyWYWV1riAaaMZ4e+wMeALas3txK4aH//cMFe16WQH65AAAApwAAABNlY2RzYS1zaGEyLW5pc3RwNTIxAAAAjAAAAEIA92a8QL5J/EMxRaKh9fSysTaEyyN/3KesBC8tI1rwytKILtfrcAIGxXtDQF6eZ72BWUvu6aqHIM6pmIHlnpzsROgAAABCAJHPzoeANenL8ZdlEf0jz8aEiGlGt02Z+vzsajQakKclFL4P8Nm5fojR2Mo2C45CQfO+kfkRQM1UUfDrVZcPzN0S') }.not_to raise_error # rubocop:disable Layout/LineLength
end
- # rubocop:enable Metrics/LineLength
+ # rubocop:enable Layout/LineLength
it "doesn't support whitespaces" do
expect { described_class.new(name: 'whev', type: :rsa, user: 'nobody', key: 'AAA FA==') }.to raise_error(Puppet::Error, %r{Key must not contain whitespace})