From 43b543736055c4683778fbc210f2451f3fb3038b Mon Sep 17 00:00:00 2001 From: Brian Schonecker Date: Mon, 16 Oct 2023 06:26:40 -0400 Subject: [PATCH 01/13] Change password_max_age lower bounds to negative one (-1) to allow for disabling of password expiry. --- README.md | 2 +- REFERENCE.md | 2 +- manifests/user.pp | 2 +- types/user/passwordmaxage.pp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b7c1f953..41e94327 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,7 @@ Allows strings up to 32 characters long that begin with a lower case letter or u #### `Accounts::User::PasswordMaxAge` -Maximum number of days a password may be used before it must be changed. Allows any integer from `0` to `99999`. See [`user`](https://puppet.com/docs/puppet/latest/types/user.html#user-attribute-password_max_age) resource. +Maximum number of days a password may be used before it must be changed. Allows any integer from `-1` to `99999`. See [`user`](https://puppet.com/docs/puppet/latest/types/user.html#user-attribute-password_max_age) resource. #### `Accounts::User::Resource` diff --git a/REFERENCE.md b/REFERENCE.md index d26820dc..f0a449bb 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -428,7 +428,7 @@ Default value: `'!!'` Data type: `Optional[Accounts::User::PasswordMaxAge]` Maximum number of days a password may be used before it must be changed. -Allows any integer from `0` to `99999`. See the +Allows any integer from `-1` to `99999`. See the [`user`](https://puppet.com/docs/puppet/latest/types/user.html#user-attribute-password_max_age) resource. diff --git a/manifests/user.pp b/manifests/user.pp index 19802128..dec6cf83 100644 --- a/manifests/user.pp +++ b/manifests/user.pp @@ -126,7 +126,7 @@ # # @param password_max_age # Maximum number of days a password may be used before it must be changed. -# Allows any integer from `0` to `99999`. See the +# Allows any integer from `-1` to `99999`. See the # [`user`](https://puppet.com/docs/puppet/latest/types/user.html#user-attribute-password_max_age) # resource. # diff --git a/types/user/passwordmaxage.pp b/types/user/passwordmaxage.pp index 8ecb90d3..43515852 100644 --- a/types/user/passwordmaxage.pp +++ b/types/user/passwordmaxage.pp @@ -3,4 +3,4 @@ # On most systems, the default value of 99999 is about 274 years, which # effectively disables password aging. # -type Accounts::User::PasswordMaxAge = Integer[1, 99999] +type Accounts::User::PasswordMaxAge = Integer[-1, 99999] From bc4c6859b2e34fdfdb6d884890d980bcd22866ee Mon Sep 17 00:00:00 2001 From: rajat-puppet Date: Mon, 6 Nov 2023 18:07:11 +0530 Subject: [PATCH 02/13] Adding github directory to pdkignore --- .pdkignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.pdkignore b/.pdkignore index c538bea8..960a62ab 100644 --- a/.pdkignore +++ b/.pdkignore @@ -31,6 +31,7 @@ /.fixtures.yml /Gemfile /.gitattributes +/.github/ /.gitignore /.gitlab-ci.yml /.pdkignore From 8fed5430ec129d1a17e5d5b11c149fb99d0a2f14 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Mon, 20 Nov 2023 11:32:05 +0530 Subject: [PATCH 03/13] "CAT-945 - Update README.md LICENSE" --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 41e94327..0761a720 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ 4. [Reference - An under-the-hood peek at what the module is doing and how](#reference) * [Data Types](#data-types) 5. [Limitations - OS compatibility, etc.](#limitations) -6. [Development - Guide for contributing to the module](#development) +6. [License](#license) +7. [Development - Guide for contributing to the module](#development) ## Description @@ -237,6 +238,10 @@ The accounts module is designed to take the place of the pe\_accounts module tha For example, the .bashrc and .bash\_profile files are not managed by default but allow custom content to be passed in using the `bashrc_content` and `bash_profile_content` parameters. The content for these two files as managed by pe\_accounts can continue to be used by passing `bashrc_content => file('accounts/shell/bashrc')` and `bash_profile_content => file('accounts/shell/bash_profile')` to the `accounts::user` defined type. +## License + +This codebase is licensed under the Apache2.0 licensing, however due to the nature of the codebase the open source dependencies may also use a combination of [AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html), [BSD-2](https://opensource.org/license/bsd-2-claus), [BSD-3](https://opensource.org/license/bsd-3-claus), [GPL2.0](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html), [LGPL](https://opensource.org/license/lgpl-3-0/), [MIT](https://opensource.org/license/mit/) and [MPL](https://opensource.org/license/mpl-2-0/) Licensing. + ## Development Acceptance tests for this module leverage [puppet_litmus](https://github.com/puppetlabs/puppet_litmus). From 6d39d1095393cbc8a0218e20b9c12d1387ae560f Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Mon, 20 Nov 2023 12:13:40 +0530 Subject: [PATCH 04/13] (MAINT) - Debugging nigtly failures --- .github/workflows/ci.yml | 4 +++- .github/workflows/nightly.yml | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5738adb..900fda16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ on: branches: - "main" workflow_dispatch: - + jobs: Spec: uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main" @@ -15,3 +15,5 @@ jobs: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" + with: + runs_on: "ubuntu-20.04" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a28cd2db..aaa4967f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,4 +14,5 @@ jobs: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" - + with: + runs_on: "ubuntu-20.04" From 4f7c99a1a3efe5625a2042f7a8877e0fe61991a2 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Tue, 28 Nov 2023 10:51:49 +0530 Subject: [PATCH 05/13] (CAT-1608) - PDK update --- .gitignore | 2 +- .pdkignore | 8 +- .rubocop.yml | 649 ++++++++++++++++++++++++++++++++++++++++- .rubocop_todo.yml | 54 +--- .sync.yml | 2 + Gemfile | 48 +-- Rakefile | 8 +- metadata.json | 4 +- spec/default_facts.yml | 6 +- spec/spec_helper.rb | 6 +- types/user/uid.pp | 22 +- 11 files changed, 699 insertions(+), 110 deletions(-) diff --git a/.gitignore b/.gitignore index 988dcbbe..3f155121 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ /log/ /pkg/ /spec/fixtures/manifests/ -/spec/fixtures/modules/ +/spec/fixtures/modules/* /tmp/ /vendor/ /convert_report.txt diff --git a/.pdkignore b/.pdkignore index 960a62ab..862847a7 100644 --- a/.pdkignore +++ b/.pdkignore @@ -16,7 +16,7 @@ /log/ /pkg/ /spec/fixtures/manifests/ -/spec/fixtures/modules/ +/spec/fixtures/modules/* /tmp/ /vendor/ /convert_report.txt @@ -26,21 +26,17 @@ .envrc /inventory.yaml /spec/fixtures/litmus_inventory.yaml -/appveyor.yml -/.editorconfig /.fixtures.yml /Gemfile /.gitattributes /.github/ /.gitignore -/.gitlab-ci.yml /.pdkignore /.puppet-lint.rc /Rakefile /rakelib/ /.rspec -/.rubocop.yml -/.travis.yml +/..yml /.yardopts /spec/ /.vscode/ diff --git a/.rubocop.yml b/.rubocop.yml index 57cdcf82..7a66e083 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,15 +1,11 @@ --- -inherit_from: .rubocop_todo.yml - require: - rubocop-performance - rubocop-rspec AllCops: + NewCops: enable DisplayCopNames: true TargetRubyVersion: '2.7' - NewCops: enable - ExtraDetails: true - DisplayStyleGuide: true Include: - "**/*.rb" Exclude: @@ -23,6 +19,7 @@ AllCops: - "**/Puppetfile" - "**/Vagrantfile" - "**/Guardfile" +inherit_from: ".rubocop_todo.yml" Layout/LineLength: Description: People have wide screens, use them. Max: 200 @@ -84,3 +81,645 @@ Style/Documentation: - spec/**/* 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 +Bundler/GemFilename: + Enabled: false +Bundler/InsecureProtocolSource: + Enabled: false +Capybara/CurrentPathExpectation: + Enabled: false +Capybara/VisibilityMatcher: + Enabled: false +Gemspec/DuplicatedAssignment: + Enabled: false +Gemspec/OrderedDependencies: + Enabled: false +Gemspec/RequiredRubyVersion: + Enabled: false +Gemspec/RubyVersionGlobalsUsage: + Enabled: false +Layout/ArgumentAlignment: + Enabled: false +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/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: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +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/FeatureMethods: + Enabled: false +RSpec/ContainExactly: + 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/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/MatchArray: + 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/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 +Capybara/MatchStyle: + Enabled: false +Capybara/NegationMatcher: + Enabled: false +Capybara/SpecificActions: + Enabled: false +Capybara/SpecificFinders: + Enabled: false +Capybara/SpecificMatcher: + Enabled: false +Gemspec/DeprecatedAttributeAssignment: + Enabled: false +Gemspec/DevelopmentDependencies: + Enabled: false +Gemspec/RequireMFA: + Enabled: false +Layout/LineContinuationLeadingSpace: + Enabled: false +Layout/LineContinuationSpacing: + Enabled: false +Layout/LineEndStringConcatenationIndentation: + Enabled: false +Layout/SpaceBeforeBrackets: + Enabled: false +Lint/AmbiguousAssignment: + Enabled: false +Lint/AmbiguousOperatorPrecedence: + Enabled: false +Lint/AmbiguousRange: + Enabled: false +Lint/ConstantOverwrittenInRescue: + Enabled: false +Lint/DeprecatedConstants: + Enabled: false +Lint/DuplicateBranch: + Enabled: false +Lint/DuplicateMagicComment: + Enabled: false +Lint/DuplicateRegexpCharacterClassElement: + Enabled: false +Lint/EmptyBlock: + Enabled: false +Lint/EmptyClass: + Enabled: false +Lint/EmptyInPattern: + Enabled: false +Lint/IncompatibleIoSelectWithFiberScheduler: + Enabled: false +Lint/LambdaWithoutLiteralBlock: + Enabled: false +Lint/NoReturnInBeginEndBlocks: + Enabled: false +Lint/NonAtomicFileOperation: + Enabled: false +Lint/NumberedParameterAssignment: + Enabled: false +Lint/OrAssignmentToConstant: + Enabled: false +Lint/RedundantDirGlobSort: + Enabled: false +Lint/RefinementImportMethods: + Enabled: false +Lint/RequireRangeParentheses: + Enabled: false +Lint/RequireRelativeSelfPath: + Enabled: false +Lint/SymbolConversion: + Enabled: false +Lint/ToEnumArguments: + Enabled: false +Lint/TripleQuotes: + Enabled: false +Lint/UnexpectedBlockArity: + Enabled: false +Lint/UnmodifiedReduceAccumulator: + Enabled: false +Lint/UselessRescue: + Enabled: false +Lint/UselessRuby2Keywords: + Enabled: false +Metrics/CollectionLiteralLength: + Enabled: false +Naming/BlockForwarding: + Enabled: false +Performance/CollectionLiteralInLoop: + Enabled: false +Performance/ConcurrentMonotonicTime: + Enabled: false +Performance/MapCompact: + Enabled: false +Performance/RedundantEqualityComparisonBlock: + Enabled: false +Performance/RedundantSplitRegexpArgument: + Enabled: false +Performance/StringIdentifierArgument: + Enabled: false +RSpec/BeEq: + Enabled: false +RSpec/BeNil: + Enabled: false +RSpec/ChangeByZero: + Enabled: false +RSpec/ClassCheck: + Enabled: false +RSpec/DuplicatedMetadata: + Enabled: false +RSpec/ExcessiveDocstringSpacing: + Enabled: false +RSpec/FactoryBot/ConsistentParenthesesStyle: + Enabled: false +RSpec/FactoryBot/FactoryNameStyle: + Enabled: false +RSpec/FactoryBot/SyntaxMethods: + Enabled: false +RSpec/IdenticalEqualityAssertion: + Enabled: false +RSpec/NoExpectationExample: + Enabled: false +RSpec/PendingWithoutReason: + Enabled: false +RSpec/Rails/AvoidSetupHook: + Enabled: false +RSpec/Rails/HaveHttpStatus: + Enabled: false +RSpec/Rails/InferredSpecType: + Enabled: false +RSpec/Rails/MinitestAssertions: + Enabled: false +RSpec/Rails/TravelAround: + Enabled: false +RSpec/RedundantAround: + Enabled: false +RSpec/SkipBlockInsideExample: + Enabled: false +RSpec/SortMetadata: + Enabled: false +RSpec/SubjectDeclaration: + Enabled: false +RSpec/VerifiedDoubleReference: + Enabled: false +Security/CompoundHash: + Enabled: false +Security/IoMethods: + Enabled: false +Style/ArgumentsForwarding: + Enabled: false +Style/ArrayIntersect: + Enabled: false +Style/CollectionCompact: + Enabled: false +Style/ComparableClamp: + Enabled: false +Style/ConcatArrayLiterals: + Enabled: false +Style/DirEmpty: + Enabled: false +Style/DocumentDynamicEvalDefinition: + Enabled: false +Style/EmptyHeredoc: + Enabled: false +Style/EndlessMethod: + Enabled: false +Style/EnvHome: + Enabled: false +Style/FetchEnvVar: + Enabled: false +Style/FileEmpty: + Enabled: false +Style/FileRead: + Enabled: false +Style/FileWrite: + Enabled: false +Style/HashConversion: + Enabled: false +Style/HashExcept: + Enabled: false +Style/IfWithBooleanLiteralBranches: + Enabled: false +Style/InPatternThen: + Enabled: false +Style/MagicCommentFormat: + Enabled: false +Style/MapCompactWithConditionalBlock: + Enabled: false +Style/MapToHash: + Enabled: false +Style/MapToSet: + Enabled: false +Style/MinMaxComparison: + Enabled: false +Style/MultilineInPatternThen: + Enabled: false +Style/NegatedIfElseCondition: + Enabled: false +Style/NestedFileDirname: + Enabled: false +Style/NilLambda: + Enabled: false +Style/NumberedParameters: + Enabled: false +Style/NumberedParametersLimit: + Enabled: false +Style/ObjectThen: + Enabled: false +Style/OpenStructUse: + Enabled: false +Style/OperatorMethodCall: + Enabled: false +Style/QuotedSymbols: + Enabled: false +Style/RedundantArgument: + Enabled: false +Style/RedundantConstantBase: + Enabled: false +Style/RedundantDoubleSplatHashBraces: + Enabled: false +Style/RedundantEach: + Enabled: false +Style/RedundantHeredocDelimiterQuotes: + Enabled: false +Style/RedundantInitialize: + Enabled: false +Style/RedundantSelfAssignmentBranch: + Enabled: false +Style/RedundantStringEscape: + Enabled: false +Style/SelectByRegexp: + Enabled: false +Style/StringChars: + Enabled: false +Style/SwapValues: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index bb7c73c5..5328c378 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,58 +1,11 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2023-04-05 10:28:45 UTC using RuboCop version 1.48.1. +# on 2023-11-28 05:20:52 UTC using RuboCop version 1.48.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 1 -# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. -Metrics/MethodLength: - Max: 12 - -# Offense count: 1 -# Configuration parameters: CountKeywordArgs, MaxOptionalParameters. -Metrics/ParameterLists: - Max: 6 - -# Offense count: 4 -# Configuration parameters: MinSize. -Performance/CollectionLiteralInLoop: - Exclude: - - 'spec/defines/accounts_user_spec.rb' - -# Offense count: 4 -# Configuration parameters: Prefixes, AllowedPatterns. -# Prefixes: when, with, without -RSpec/ContextWording: - Exclude: - - 'spec/defines/accounts_user_spec.rb' - -# Offense count: 5 -# Configuration parameters: IgnoredMetadata. -RSpec/DescribeClass: - Exclude: - - '**/spec/features/**/*' - - '**/spec/requests/**/*' - - '**/spec/routing/**/*' - - '**/spec/system/**/*' - - '**/spec/views/**/*' - - 'spec/acceptance/accounts_spec.rb' - - 'spec/acceptance/user_spec.rb' - - 'spec/defines/accounts_user_spec.rb' - - 'spec/functions/accounts_ssh_authorized_keys_line_parser_spec.rb' - - 'spec/functions/accounts_ssh_options_parser_spec.rb' - -# Offense count: 13 -# Configuration parameters: CountAsOne. -RSpec/ExampleLength: - Max: 24 - -# Offense count: 25 -RSpec/MultipleExpectations: - Max: 22 - # Offense count: 20 # Configuration parameters: EnforcedStyle, IgnoreSharedExamples. # SupportedStyles: always, named_only @@ -60,8 +13,3 @@ RSpec/NamedSubject: Exclude: - 'spec/defines/accounts_user_spec.rb' - 'spec/functions/accounts_ssh_authorized_keys_line_parser_spec.rb' - -# Offense count: 29 -# Configuration parameters: AllowedGroups. -RSpec/NestedGroups: - Max: 5 diff --git a/.sync.yml b/.sync.yml index 06ff198a..b245ab74 100644 --- a/.sync.yml +++ b/.sync.yml @@ -6,6 +6,8 @@ delete: true appveyor.yml: delete: true +.rubocop.yml: + include_todos: true Gemfile: optional: diff --git a/Gemfile b/Gemfile index ea113b0c..86e337ad 100644 --- a/Gemfile +++ b/Gemfile @@ -14,31 +14,35 @@ def location_for(place_or_version, fake_version = nil) end group :development do - 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', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "voxpupuli-puppet-lint-plugins", '~> 4.0', require: false - gem "facterdb", '~> 1.18', require: false - gem "metadata-json-lint", '>= 2.0.2', '< 4.0.0', require: false - gem "puppetlabs_spec_helper", '~> 5.0', require: false - gem "rspec-puppet-facts", '~> 2.0', require: false - gem "codecov", '~> 0.2', require: false - gem "dependency_checker", '~> 0.2', require: false - gem "parallel_tests", '= 3.12.1', require: false - gem "pry", '~> 0.10', require: false - gem "simplecov-console", '~> 0.5', require: false - gem "puppet-debugger", '~> 1.0', require: false - gem "rubocop", '~> 1.48.1', require: false - gem "rubocop-performance", '~> 1.16', require: false - gem "rubocop-rspec", '~> 2.19', require: false - gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "github_changelog_generator", '= 1.15.2', require: false + 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', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false + gem "facterdb", '~> 1.18', require: false + gem "metadata-json-lint", '~> 3.0', require: false + gem "rspec-puppet-facts", '~> 2.0', require: false + gem "codecov", '~> 0.2', require: false + gem "dependency_checker", '~> 1.0.0', require: false + gem "parallel_tests", '= 3.12.1', require: false + gem "pry", '~> 0.10', require: false + gem "simplecov-console", '~> 0.5', require: false + gem "puppet-debugger", '~> 1.0', require: false + gem "rubocop", '= 1.48.1', require: false + gem "rubocop-performance", '= 1.16.0', require: false + gem "rubocop-rspec", '= 2.19.0', require: false + gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "github_changelog_generator", '= 1.15.2', require: false end group :system_tests do gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] - gem "serverspec", '~> 2.41', require: false + gem "serverspec", '~> 2.41', require: false +end +group :release_prep do + gem "puppet-strings", '~> 4.0', require: false + gem "puppetlabs_spec_helper", '~> 7.0', require: false end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/Rakefile b/Rakefile index 53152e21..74415a96 100644 --- a/Rakefile +++ b/Rakefile @@ -1,11 +1,11 @@ # frozen_string_literal: true require 'bundler' -require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any? +require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus' require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' -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 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator' +require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' def changelog_user return unless Rake.application.top_level_tasks.include? "changelog" @@ -43,7 +43,7 @@ end PuppetLint.configuration.send('disable_relative') -if Bundler.rubygems.find_name('github_changelog_generator').any? +if Gem.loaded_specs.key? 'github_changelog_generator' GitHubChangelogGenerator::RakeTask.new :changelog do |config| raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? config.user = "#{changelog_user}" diff --git a/metadata.json b/metadata.json index 5288aef0..fc1e5597 100644 --- a/metadata.json +++ b/metadata.json @@ -88,6 +88,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-g604a3ec", - "pdk-version": "2.7.1" + "template-ref": "heads/main-0-g01c6a19", + "pdk-version": "3.0.0" } diff --git a/spec/default_facts.yml b/spec/default_facts.yml index f3946607..3346c394 100644 --- a/spec/default_facts.yml +++ b/spec/default_facts.yml @@ -3,7 +3,7 @@ # Facts specified here will override the values provided by rspec-puppet-facts. --- networking: - ip: "172.16.254.254" - ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" - mac: "AA:AA:AA:AA:AA:AA" + ip: "172.16.254.254" + ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" + mac: "AA:AA:AA:AA:AA:AA" is_pe: false diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1a8b68bd..6820cebe 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,11 +9,11 @@ require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb')) -include RspecPuppetFacts # rubocop:disable Style/MixinUsage +include RspecPuppetFacts default_facts = { puppetversion: Puppet.version, - facterversion: Facter.version + facterversion: Facter.version, } default_fact_files = [ @@ -25,7 +25,7 @@ next unless File.exist?(f) && File.readable?(f) && File.size?(f) begin - default_facts.merge!(YAML.safe_load(File.read(f), [], [], true)) + default_facts.merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) rescue StandardError => e RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" end diff --git a/types/user/uid.pp b/types/user/uid.pp index d89dd43f..fae3a758 100644 --- a/types/user/uid.pp +++ b/types/user/uid.pp @@ -5,16 +5,16 @@ type Accounts::User::Uid = Variant[ Integer[0,4294967295], Pattern[/\A0\z/, - /\A[1-3]\d{0,9}\z/, - /\A[4-9]\d{0,8}\z/, - /\A4[0-1]\d{8}\z/, - /\A42[0-8]\d{7}\z/, - /\A429[0-3]\d{6}\z/, - /\A4294[0-8]\d{5}\z/, - /\A42949[0-5]\d{4}\z/, - /\A429496[0-6]\d{3}\z/, - /\A4294967[0-1]\d{2}\z/, - /\A42949672[0-8]\d\z/, - /\A429496729[0-5]\z/, + /\A[1-3]\d{0,9}\z/, + /\A[4-9]\d{0,8}\z/, + /\A4[0-1]\d{8}\z/, + /\A42[0-8]\d{7}\z/, + /\A429[0-3]\d{6}\z/, + /\A4294[0-8]\d{5}\z/, + /\A42949[0-5]\d{4}\z/, + /\A429496[0-6]\d{3}\z/, + /\A4294967[0-1]\d{2}\z/, + /\A42949672[0-8]\d\z/, + /\A429496729[0-5]\z/, ] ] From 00d24749cf66e1c89278d610a9d60ce965157f3b Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Thu, 21 Dec 2023 10:20:10 +0530 Subject: [PATCH 06/13] PDK update --- .sync.yml | 5 ---- Gemfile | 5 ++-- Rakefile | 79 --------------------------------------------------- metadata.json | 2 +- 4 files changed, 4 insertions(+), 87 deletions(-) diff --git a/.sync.yml b/.sync.yml index b245ab74..6b195a3a 100644 --- a/.sync.yml +++ b/.sync.yml @@ -9,11 +9,6 @@ appveyor.yml: .rubocop.yml: include_todos: true -Gemfile: - optional: - ":development": - - gem: github_changelog_generator - version: '= 1.15.2' spec/spec_helper.rb: mock_with: ":rspec" coverage_report: true diff --git a/Gemfile b/Gemfile index 86e337ad..ca0e773e 100644 --- a/Gemfile +++ b/Gemfile @@ -23,6 +23,7 @@ group :development do gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false gem "facterdb", '~> 1.18', require: false gem "metadata-json-lint", '~> 3.0', require: false + gem "puppetlabs_spec_helper", '~> 6.0', require: false gem "rspec-puppet-facts", '~> 2.0', require: false gem "codecov", '~> 0.2', require: false gem "dependency_checker", '~> 1.0.0', require: false @@ -33,8 +34,8 @@ group :development do gem "rubocop", '= 1.48.1', require: false gem "rubocop-performance", '= 1.16.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false + gem "puppet-strings", '~> 4.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "github_changelog_generator", '= 1.15.2', require: false end group :system_tests do gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] @@ -42,7 +43,7 @@ group :system_tests do end group :release_prep do gem "puppet-strings", '~> 4.0', require: false - gem "puppetlabs_spec_helper", '~> 7.0', require: false + gem "puppetlabs_spec_helper", '~> 6.0', require: false end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/Rakefile b/Rakefile index 74415a96..77590fe6 100644 --- a/Rakefile +++ b/Rakefile @@ -4,85 +4,6 @@ require 'bundler' require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus' require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' -require 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator' require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' -def changelog_user - return unless Rake.application.top_level_tasks.include? "changelog" - returnVal = nil || JSON.load(File.read('metadata.json'))['author'] - raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil? - puts "GitHubChangelogGenerator user:#{returnVal}" - returnVal -end - -def changelog_project - return unless Rake.application.top_level_tasks.include? "changelog" - - returnVal = nil - returnVal ||= begin - metadata_source = JSON.load(File.read('metadata.json'))['source'] - metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z}) - - metadata_source_match && metadata_source_match[1] - end - - raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil? - - puts "GitHubChangelogGenerator project:#{returnVal}" - returnVal -end - -def changelog_future_release - return unless Rake.application.top_level_tasks.include? "changelog" - 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 -end - PuppetLint.configuration.send('disable_relative') - - -if Gem.loaded_specs.key? 'github_changelog_generator' - GitHubChangelogGenerator::RakeTask.new :changelog do |config| - raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? - config.user = "#{changelog_user}" - config.project = "#{changelog_project}" - config.future_release = "#{changelog_future_release}" - config.exclude_labels = ['maintenance'] - 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; LABEL THEM ON GITHUB" - config.configure_sections = { - "Changed" => { - "prefix" => "### Changed", - "labels" => ["backwards-incompatible"], - }, - "Added" => { - "prefix" => "### Added", - "labels" => ["enhancement", "feature"], - }, - "Fixed" => { - "prefix" => "### Fixed", - "labels" => ["bug", "documentation", "bugfix"], - }, - } - end -else - desc 'Generate a Changelog from GitHub' - task :changelog do - raise < 1.15' - condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')" -EOM - end -end - diff --git a/metadata.json b/metadata.json index fc1e5597..5e2bd215 100644 --- a/metadata.json +++ b/metadata.json @@ -88,6 +88,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-g01c6a19", + "template-ref": "heads/main-0-g79a2f93", "pdk-version": "3.0.0" } From f91d63b89a47212ef55bcb3f71cb3a280ccd7787 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Fri, 8 Mar 2024 09:48:46 +0530 Subject: [PATCH 07/13] (CAT-1746) - Fixing CI pipeline --- types/user/resource.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/types/user/resource.pp b/types/user/resource.pp index b26f6bc6..567af287 100644 --- a/types/user/resource.pp +++ b/types/user/resource.pp @@ -27,7 +27,6 @@ Optional[managehome] => Boolean, Optional[managevim] => Boolean, Optional[membership] => Enum['inclusive','minimum'], - Optional[name] => Accounts::User::Name, Optional[password] => String, Optional[password_max_age] => Accounts::User::PasswordMaxAge, Optional[purge_sshkeys] => Boolean, From ec5f04a47868a1aa51a5d847cf5d7a1b11cd1a1c Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 26 Mar 2024 14:12:32 +0100 Subject: [PATCH 08/13] Add bastelfreak to CODEOWNERS I'm in the trusted contributors group but somehow the CODEOWNERS change was missing. --- CODEOWNERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index a5d109e9..13360c54 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,2 +1,3 @@ # Setting ownership to the modules team -* @puppetlabs/modules +# include Trusted Contributors +* @puppetlabs/modules @bastelfreak From 45809e1894e8d784b98e96fcbf04084f77af26b3 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 26 Mar 2024 14:34:04 +0000 Subject: [PATCH 09/13] Release prep v8.1.1 --- CHANGELOG.md | 111 +++++++++++++------------------------------------- REFERENCE.md | 44 ++++++++++++++------ metadata.json | 2 +- 3 files changed, 61 insertions(+), 96 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e66df1db..980e94e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All 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). +## [v8.1.1](https://github.com/puppetlabs/puppetlabs-accounts/tree/v8.1.1) - 2024-03-26 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/v8.1.0...v8.1.1) + +### Fixed + +- Accounts::User::Resource: Fix duplicate key `name` [#477](https://github.com/puppetlabs/puppetlabs-accounts/pull/477) ([Ramesh7](https://github.com/Ramesh7)) + ## [v8.1.0](https://github.com/puppetlabs/puppetlabs-accounts/tree/v8.1.0) - 2023-06-19 [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/v8.0.0...v8.1.0) @@ -159,13 +167,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/v5.0.0...v6.0.0) +### Changed +- pdksync - FM-8499 - remove ubuntu14 support [#277](https://github.com/puppetlabs/puppetlabs-accounts/pull/277) ([lionce](https://github.com/lionce)) + ### Added - (FM-8671) - Support added for CentOS 8 [#278](https://github.com/puppetlabs/puppetlabs-accounts/pull/278) ([david22swan](https://github.com/david22swan)) -### Changed -- pdksync - FM-8499 - remove ubuntu14 support [#277](https://github.com/puppetlabs/puppetlabs-accounts/pull/277) ([lionce](https://github.com/lionce)) - ### Fixed - fix small typo on the root_home key at Debian.yaml [#260](https://github.com/puppetlabs/puppetlabs-accounts/pull/260) ([wandenberg](https://github.com/wandenberg)) @@ -175,13 +183,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/v4.2.0...v5.0.0) +### Changed +- (MODULES-9712) Move data into hiera. [#241](https://github.com/puppetlabs/puppetlabs-accounts/pull/241) ([pillarsdotnet](https://github.com/pillarsdotnet)) + ### Added - (FM-8392) Add debian 10 to provision.yaml [#251](https://github.com/puppetlabs/puppetlabs-accounts/pull/251) ([ThoughtCrhyme](https://github.com/ThoughtCrhyme)) -### Changed -- (MODULES-9712) Move data into hiera. [#241](https://github.com/puppetlabs/puppetlabs-accounts/pull/241) ([pillarsdotnet](https://github.com/pillarsdotnet)) - ### Fixed - (MODULES-9849) wrong order when removing user with custom sshkey file [#250](https://github.com/puppetlabs/puppetlabs-accounts/pull/250) ([tuxmea](https://github.com/tuxmea)) @@ -260,6 +268,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/2.0.0...3.0.0) +### Changed +- Adding ability to specify custom ssh_key location [#149](https://github.com/puppetlabs/puppetlabs-accounts/pull/149) ([ggeldenhuis](https://github.com/ggeldenhuis)) + ### Added - (MODULES-7687) - Added Darwin compatibility [#167](https://github.com/puppetlabs/puppetlabs-accounts/pull/167) ([eimlav](https://github.com/eimlav)) @@ -269,9 +280,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - (MODULES-7671) - Support spaces in ssh key options [#153](https://github.com/puppetlabs/puppetlabs-accounts/pull/153) ([dleske](https://github.com/dleske)) - (FM-7254) - Addition of support for Ubuntu 18.04 [#150](https://github.com/puppetlabs/puppetlabs-accounts/pull/150) ([david22swan](https://github.com/david22swan)) -### Changed -- Adding ability to specify custom ssh_key location [#149](https://github.com/puppetlabs/puppetlabs-accounts/pull/149) ([ggeldenhuis](https://github.com/ggeldenhuis)) - ### Fixed - pdksync - (MODULES-7658) use beaker4 in puppet-module-gems [#170](https://github.com/puppetlabs/puppetlabs-accounts/pull/170) ([tphoney](https://github.com/tphoney)) @@ -281,52 +289,28 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/1.3.0...2.0.0) -### Added - -- Add expiry property to user resource. [#145](https://github.com/puppetlabs/puppetlabs-accounts/pull/145) ([jonnytdevops](https://github.com/jonnytdevops)) -- (FM-7052) - Addition of Debian 9 support to accounts [#144](https://github.com/puppetlabs/puppetlabs-accounts/pull/144) ([david22swan](https://github.com/david22swan)) - ### Changed - [FM-6969] Removal of unsupported OS from accounts [#143](https://github.com/puppetlabs/puppetlabs-accounts/pull/143) ([david22swan](https://github.com/david22swan)) -### Other +### Added -- pdksync - Update using 1.5.0 [#142](https://github.com/puppetlabs/puppetlabs-accounts/pull/142) ([HelenCampbell](https://github.com/HelenCampbell)) -- pdksync - Update using 1.5.0 [#136](https://github.com/puppetlabs/puppetlabs-accounts/pull/136) ([HelenCampbell](https://github.com/HelenCampbell)) -- (MODULES-7153) - Unmanage gitlab-ci.yml [#135](https://github.com/puppetlabs/puppetlabs-accounts/pull/135) ([pmcmaw](https://github.com/pmcmaw)) -- (MODULES-7023) - Removing duplication in .sync.yml [#134](https://github.com/puppetlabs/puppetlabs-accounts/pull/134) ([pmcmaw](https://github.com/pmcmaw)) -- (maint) - PDK Update Accounts [#131](https://github.com/puppetlabs/puppetlabs-accounts/pull/131) ([pmcmaw](https://github.com/pmcmaw)) +- Add expiry property to user resource. [#145](https://github.com/puppetlabs/puppetlabs-accounts/pull/145) ([jonnytdevops](https://github.com/jonnytdevops)) +- (FM-7052) - Addition of Debian 9 support to accounts [#144](https://github.com/puppetlabs/puppetlabs-accounts/pull/144) ([david22swan](https://github.com/david22swan)) - Allow sshkeys to be reused for multiple accounts [#130](https://github.com/puppetlabs/puppetlabs-accounts/pull/130) ([jcharaoui](https://github.com/jcharaoui)) -- (MODULES-6607) - Update docs to reflect correct default value for ignore_password_if_empty. [#129](https://github.com/puppetlabs/puppetlabs-accounts/pull/129) ([pmcmaw](https://github.com/pmcmaw)) -- Release merge back 1.3.0 [#127](https://github.com/puppetlabs/puppetlabs-accounts/pull/127) ([pmcmaw](https://github.com/pmcmaw)) - Allow mode for homedir to be undef [#126](https://github.com/puppetlabs/puppetlabs-accounts/pull/126) ([arjenz](https://github.com/arjenz)) ## [1.3.0](https://github.com/puppetlabs/puppetlabs-accounts/tree/1.3.0) - 2018-01-22 [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/1.2.1...1.3.0) -### Other +### Fixed -- Release Prep 1.3.0 [#125](https://github.com/puppetlabs/puppetlabs-accounts/pull/125) ([pmcmaw](https://github.com/pmcmaw)) -- (MODULES-6328) - PDK Convert accounts [#124](https://github.com/puppetlabs/puppetlabs-accounts/pull/124) ([pmcmaw](https://github.com/pmcmaw)) - Don't create accounts::home_dir resources [#123](https://github.com/puppetlabs/puppetlabs-accounts/pull/123) ([arjenz](https://github.com/arjenz)) -- (maint) modulesync 65530a4 Update Travis [#122](https://github.com/puppetlabs/puppetlabs-accounts/pull/122) ([michaeltlombardi](https://github.com/michaeltlombardi)) -- (maint) - modulesync 384f4c1 [#121](https://github.com/puppetlabs/puppetlabs-accounts/pull/121) ([tphoney](https://github.com/tphoney)) -- (FM-6634) - Addressing Rubocop errors [#120](https://github.com/puppetlabs/puppetlabs-accounts/pull/120) ([pmcmaw](https://github.com/pmcmaw)) -- Release merge back 1.2.1 [#118](https://github.com/puppetlabs/puppetlabs-accounts/pull/118) ([pmcmaw](https://github.com/pmcmaw)) ## [1.2.1](https://github.com/puppetlabs/puppetlabs-accounts/tree/1.2.1) - 2017-11-20 [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/1.2.0...1.2.1) -### Other - -- (maint) - modulesync 1d81b6a [#117](https://github.com/puppetlabs/puppetlabs-accounts/pull/117) ([pmcmaw](https://github.com/pmcmaw)) -- (maint) fix up the .sync.yml [#116](https://github.com/puppetlabs/puppetlabs-accounts/pull/116) ([tphoney](https://github.com/tphoney)) -- Release prep for 1.2.1 [#115](https://github.com/puppetlabs/puppetlabs-accounts/pull/115) ([willmeek](https://github.com/willmeek)) -- Cleanup ruby code via rubocop [#114](https://github.com/puppetlabs/puppetlabs-accounts/pull/114) ([willmeek](https://github.com/willmeek)) -- Release mergeback 1.2.0 [#113](https://github.com/puppetlabs/puppetlabs-accounts/pull/113) ([pmcmaw](https://github.com/pmcmaw)) - ## [1.2.0](https://github.com/puppetlabs/puppetlabs-accounts/tree/1.2.0) - 2017-11-14 [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/1.1.0...1.2.0) @@ -334,63 +318,26 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Added - Support ssh authorized key options [#110](https://github.com/puppetlabs/puppetlabs-accounts/pull/110) ([rgevaert](https://github.com/rgevaert)) +- Group name [#85](https://github.com/puppetlabs/puppetlabs-accounts/pull/85) ([wpowell-ossg](https://github.com/wpowell-ossg)) +- added option to set system user or group [#82](https://github.com/puppetlabs/puppetlabs-accounts/pull/82) ([netman2k](https://github.com/netman2k)) +- Added the option to create or not a group with the user name [#81](https://github.com/puppetlabs/puppetlabs-accounts/pull/81) ([jsanvall](https://github.com/jsanvall)) +- Allow the use of the `source` param for bash files. [#74](https://github.com/puppetlabs/puppetlabs-accounts/pull/74) ([MG2R](https://github.com/MG2R)) +- Allow duplicate keys to be associated with multiple accounts. [#54](https://github.com/puppetlabs/puppetlabs-accounts/pull/54) ([ian-d](https://github.com/ian-d)) -### Other +### Fixed -- minor fixups in README [#112](https://github.com/puppetlabs/puppetlabs-accounts/pull/112) ([jbondpdx](https://github.com/jbondpdx)) -- Further 1.2.0 Release Prep [#111](https://github.com/puppetlabs/puppetlabs-accounts/pull/111) ([willmeek](https://github.com/willmeek)) -- MODULES-5600 Add support for .forward [#109](https://github.com/puppetlabs/puppetlabs-accounts/pull/109) ([rgevaert](https://github.com/rgevaert)) -- 1.2.0 Release Prep [#108](https://github.com/puppetlabs/puppetlabs-accounts/pull/108) ([willmeek](https://github.com/willmeek)) -- Update group acceptance tests for SLES and Solaris [#106](https://github.com/puppetlabs/puppetlabs-accounts/pull/106) ([willmeek](https://github.com/willmeek)) - Skips password check test on Solaris [#105](https://github.com/puppetlabs/puppetlabs-accounts/pull/105) ([willmeek](https://github.com/willmeek)) - (MODULES-5778) Set operatingsystem fact in specs [#104](https://github.com/puppetlabs/puppetlabs-accounts/pull/104) ([rodjek](https://github.com/rodjek)) -- Group dependency tests [#103](https://github.com/puppetlabs/puppetlabs-accounts/pull/103) ([willmeek](https://github.com/willmeek)) -- Empty password test [#102](https://github.com/puppetlabs/puppetlabs-accounts/pull/102) ([willmeek](https://github.com/willmeek)) -- remove whitespace from EOL [#100](https://github.com/puppetlabs/puppetlabs-accounts/pull/100) ([tphoney](https://github.com/tphoney)) -- (maint) modulesync 892c4cf [#98](https://github.com/puppetlabs/puppetlabs-accounts/pull/98) ([HAIL9000](https://github.com/HAIL9000)) -- (maint) - Removing Ubuntu 12.04 [#96](https://github.com/puppetlabs/puppetlabs-accounts/pull/96) ([pmcmaw](https://github.com/pmcmaw)) -- (maint) modulesync 915cde70e20 [#94](https://github.com/puppetlabs/puppetlabs-accounts/pull/94) ([glennsarti](https://github.com/glennsarti)) -- (MODULES-5187) mysnc puppet 5 and ruby 2.4 [#92](https://github.com/puppetlabs/puppetlabs-accounts/pull/92) ([eputnam](https://github.com/eputnam)) -- (MODULES-5199) Prep for puppet 5 [#90](https://github.com/puppetlabs/puppetlabs-accounts/pull/90) ([hunner](https://github.com/hunner)) - Update Puppet version compatibility [#87](https://github.com/puppetlabs/puppetlabs-accounts/pull/87) ([HelenCampbell](https://github.com/HelenCampbell)) -- Group name [#85](https://github.com/puppetlabs/puppetlabs-accounts/pull/85) ([wpowell-ossg](https://github.com/wpowell-ossg)) -- [msync] 786266 Implement puppet-module-gems, a45803 Remove metadata.json from locales config [#84](https://github.com/puppetlabs/puppetlabs-accounts/pull/84) ([wilson208](https://github.com/wilson208)) -- [MODULES-4528] Replace Puppet.version.to_f version comparison from spec_helper.rb [#83](https://github.com/puppetlabs/puppetlabs-accounts/pull/83) ([wilson208](https://github.com/wilson208)) -- added option to set system user or group [#82](https://github.com/puppetlabs/puppetlabs-accounts/pull/82) ([netman2k](https://github.com/netman2k)) -- Added the option to create or not a group with the user name [#81](https://github.com/puppetlabs/puppetlabs-accounts/pull/81) ([jsanvall](https://github.com/jsanvall)) -- [MODULES-4224] Implement beaker-module_install_helper [#79](https://github.com/puppetlabs/puppetlabs-accounts/pull/79) ([wilson208](https://github.com/wilson208)) -- (MODULES-4098) Sync the rest of the files [#78](https://github.com/puppetlabs/puppetlabs-accounts/pull/78) ([hunner](https://github.com/hunner)) -- (FM-5972) gettext and spec.opts [#77](https://github.com/puppetlabs/puppetlabs-accounts/pull/77) ([eputnam](https://github.com/eputnam)) -- (MODULES-3631) msync Gemfile for 1.9 frozen strings [#76](https://github.com/puppetlabs/puppetlabs-accounts/pull/76) ([hunner](https://github.com/hunner)) - Revert "Allow duplicate keys to be associated with multiple accounts." [#75](https://github.com/puppetlabs/puppetlabs-accounts/pull/75) ([eputnam](https://github.com/eputnam)) -- Allow the use of the `source` param for bash files. [#74](https://github.com/puppetlabs/puppetlabs-accounts/pull/74) ([MG2R](https://github.com/MG2R)) -- (MODULES-3983) Update parallel_tests for ruby 2.0.0 [#72](https://github.com/puppetlabs/puppetlabs-accounts/pull/72) ([pmcmaw](https://github.com/pmcmaw)) -- (MODULES-3704) Update gemfile template like windows [#71](https://github.com/puppetlabs/puppetlabs-accounts/pull/71) ([hunner](https://github.com/hunner)) -- Update modulesync_config [51f469d] [#70](https://github.com/puppetlabs/puppetlabs-accounts/pull/70) ([DavidS](https://github.com/DavidS)) -- Release mergeback [#69](https://github.com/puppetlabs/puppetlabs-accounts/pull/69) ([HelenCampbell](https://github.com/HelenCampbell)) -- the simple usage example has some erros [#63](https://github.com/puppetlabs/puppetlabs-accounts/pull/63) ([roock](https://github.com/roock)) -- Allow duplicate keys to be associated with multiple accounts. [#54](https://github.com/puppetlabs/puppetlabs-accounts/pull/54) ([ian-d](https://github.com/ian-d)) ## [1.1.0](https://github.com/puppetlabs/puppetlabs-accounts/tree/1.1.0) - 2016-09-20 [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/1.0.0...1.1.0) -### Other - -- 1.1.0 Release Prep [#68](https://github.com/puppetlabs/puppetlabs-accounts/pull/68) ([HelenCampbell](https://github.com/HelenCampbell)) -- Update modulesync_config [a3fe424] [#65](https://github.com/puppetlabs/puppetlabs-accounts/pull/65) ([DavidS](https://github.com/DavidS)) -- Update modulesync_config [0d59329] [#64](https://github.com/puppetlabs/puppetlabs-accounts/pull/64) ([DavidS](https://github.com/DavidS)) -- (MAINT) Update for modulesync_config 72d19f184 [#62](https://github.com/puppetlabs/puppetlabs-accounts/pull/62) ([DavidS](https://github.com/DavidS)) -- (maint) modulesync f6e2070 [#60](https://github.com/puppetlabs/puppetlabs-accounts/pull/60) ([tphoney](https://github.com/tphoney)) -- (MODULES-3560) fixing tests [#59](https://github.com/puppetlabs/puppetlabs-accounts/pull/59) ([tphoney](https://github.com/tphoney)) -- Adding osfamily fact to tests. [#55](https://github.com/puppetlabs/puppetlabs-accounts/pull/55) ([ian-d](https://github.com/ian-d)) -- Addition of Debian 8 compatibility in metadata [#49](https://github.com/puppetlabs/puppetlabs-accounts/pull/49) ([HelenCampbell](https://github.com/HelenCampbell)) -- This isn't needed with BPIH 0.4.2 [#48](https://github.com/puppetlabs/puppetlabs-accounts/pull/48) ([hunner](https://github.com/hunner)) -- Unpin rspec-puppet [#47](https://github.com/puppetlabs/puppetlabs-accounts/pull/47) ([hunner](https://github.com/hunner)) -- 1.0.x [#45](https://github.com/puppetlabs/puppetlabs-accounts/pull/45) ([hunner](https://github.com/hunner)) -- Edited readme file. [#44](https://github.com/puppetlabs/puppetlabs-accounts/pull/44) ([mindymo](https://github.com/mindymo)) +### Added + - Allow non-managed SSH keys to be purged from user. [#42](https://github.com/puppetlabs/puppetlabs-accounts/pull/42) ([ian-d](https://github.com/ian-d)) -- 1.0.x mergeback [#40](https://github.com/puppetlabs/puppetlabs-accounts/pull/40) ([bmjen](https://github.com/bmjen)) ## [1.0.0](https://github.com/puppetlabs/puppetlabs-accounts/tree/1.0.0) - 2015-12-08 diff --git a/REFERENCE.md b/REFERENCE.md index f0a449bb..940ea5dd 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -26,6 +26,7 @@ homedir, .ssh/authorized_keys files, and directories. * [`accounts_ssh_authorized_keys_line_parser`](#accounts_ssh_authorized_keys_line_parser): Parse an ssh authorized_keys line string into an array using its expected pattern by using a combination of regex matching and extracting the * [`accounts_ssh_options_parser`](#accounts_ssh_options_parser): Parse an ssh authorized_keys option string into an array using its expected pattern which matches a crazy regex slightly modified from shell +* [`user_password`](#user_password) ### Data types @@ -619,6 +620,24 @@ Data type: `String` ssh authorized_keys option string +### `user_password` + +Type: Ruby 4.x API + +The user_password function. + +#### `user_password(Variant[Sensitive[String], String] $password)` + +The user_password function. + +Returns: `Variant[Sensitive[String], String]` + +##### `password` + +Data type: `Variant[Sensitive[String], String]` + + + ## Data types ### `Accounts::Group::Hash` @@ -697,7 +716,7 @@ Max password age. On most systems, the default value of 99999 is about 274 years, which effectively disables password aging. -Alias of `Integer[1, 99999]` +Alias of `Integer[-1, 99999]` ### `Accounts::User::Resource` @@ -731,7 +750,6 @@ Struct[{ Optional[ensure] => Enum['absent','present'], Optional[managehome] => Boolean, Optional[managevim] => Boolean, Optional[membership] => Enum['inclusive','minimum'], - Optional[name] => Accounts::User::Name, Optional[password] => String, Optional[password_max_age] => Accounts::User::PasswordMaxAge, Optional[purge_sshkeys] => Boolean, @@ -756,17 +774,17 @@ Alias of ```puppet Variant[Integer[0,4294967295], Pattern[/\A0\z/, - /\A[1-3]\d{0,9}\z/, - /\A[4-9]\d{0,8}\z/, - /\A4[0-1]\d{8}\z/, - /\A42[0-8]\d{7}\z/, - /\A429[0-3]\d{6}\z/, - /\A4294[0-8]\d{5}\z/, - /\A42949[0-5]\d{4}\z/, - /\A429496[0-6]\d{3}\z/, - /\A4294967[0-1]\d{2}\z/, - /\A42949672[0-8]\d\z/, - /\A429496729[0-5]\z/, + /\A[1-3]\d{0,9}\z/, + /\A[4-9]\d{0,8}\z/, + /\A4[0-1]\d{8}\z/, + /\A42[0-8]\d{7}\z/, + /\A429[0-3]\d{6}\z/, + /\A4294[0-8]\d{5}\z/, + /\A42949[0-5]\d{4}\z/, + /\A429496[0-6]\d{3}\z/, + /\A4294967[0-1]\d{2}\z/, + /\A42949672[0-8]\d\z/, + /\A429496729[0-5]\z/, ]] ``` diff --git a/metadata.json b/metadata.json index 5e2bd215..d0136041 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-accounts", - "version": "8.1.0", + "version": "8.1.1", "author": "puppetlabs", "summary": "Account management module.", "license": "Apache-2.0", From d29e07a6aa461ad5108df40515522e87b0d4f3d3 Mon Sep 17 00:00:00 2001 From: Malik Parvez <84777619+malikparvez@users.noreply.github.com> Date: Tue, 2 Apr 2024 21:09:37 +0530 Subject: [PATCH 10/13] Fix mend to run on cron --- .github/workflows/mend.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml index b4100a5a..8b5b4018 100644 --- a/.github/workflows/mend.yml +++ b/.github/workflows/mend.yml @@ -1,9 +1,10 @@ name: "mend" on: - pull_request: - branches: - - "main" + pull_request_target: + types: + - opened + - synchronize schedule: - cron: "0 0 * * *" workflow_dispatch: From 4a46fc8d19643dc9f8c687e2b685dcde936cdab5 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 7 May 2024 09:44:37 +0200 Subject: [PATCH 11/13] accounts_ssh_authorized_keys_line_parser: Output regex matches when sshkey format isnt correct --- .../accounts_ssh_authorized_keys_line_parser.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/puppet/functions/accounts_ssh_authorized_keys_line_parser.rb b/lib/puppet/functions/accounts_ssh_authorized_keys_line_parser.rb index 77ca368a..15a8a172 100644 --- a/lib/puppet/functions/accounts_ssh_authorized_keys_line_parser.rb +++ b/lib/puppet/functions/accounts_ssh_authorized_keys_line_parser.rb @@ -17,7 +17,16 @@ def accounts_ssh_authorized_keys_line_parser_string(str) matched = str.match(%r{((sk-ssh-ed25519|sk-ecdsa-|ssh-|ecdsa-)[^\s]+)\s+([^\s]+)\s+(.*)$}) - raise ArgumentError, 'Wrong Keyline format!' unless matched && matched.length == 5 + + raise ArgumentError, "Wrong Keyline format! Got nil after applying regex to'#{str}'" unless matched + unless matched.length == 5 + output = [] + # first element is str, aftwerwards are all matching groups. We ignore the first element + (1..matched.length).each do |counter| + output << "element #{counter}: #{matched[counter]}" + end + raise ArgumentError, "Wrong Keyline format! Input: #{str}. Expected 4 elements after applying regex, got: #{output}" + end options = str[0, str.index(matched[0])].rstrip [options, matched[1], matched[3], matched[4]] From 2492b853bac0522b9413d1f37d91d63741c5b60c Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 7 May 2024 09:52:18 +0200 Subject: [PATCH 12/13] usermanagement: prohibit empty ssh keys previously we allowed ssh keys as empty strings `''`. This doesn't make sense and breaks the `accounts_ssh_authorized_keys_line_parser()` function. --- REFERENCE.md | 6 +++--- .../functions/accounts_ssh_authorized_keys_line_parser.rb | 2 +- manifests/key_management.pp | 4 ++-- manifests/manage_keys.pp | 2 +- manifests/user.pp | 2 +- .../accounts_ssh_authorized_keys_line_parser_spec.rb | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 940ea5dd..40efa683 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -505,7 +505,7 @@ Default value: `'0600'` ##### `sshkeys` -Data type: `Array[String]` +Data type: `Array[String[1]]` An array of SSH public keys associated with the user. These should be complete public key strings that include the type, content and name of the @@ -559,7 +559,7 @@ The returned options element can by an empty string. accounts_ssh_authorized_keys_line_parser_string('options ssh-rsa AAAA... comment) ``` -#### `accounts_ssh_authorized_keys_line_parser(String $str)` +#### `accounts_ssh_authorized_keys_line_parser(String[1] $str)` Parse an ssh authorized_keys line string into an array using its expected pattern by using a combination of regex matching and extracting the substring @@ -580,7 +580,7 @@ accounts_ssh_authorized_keys_line_parser_string('options ssh-rsa AAAA... comment ##### `str` -Data type: `String` +Data type: `String[1]` ssh authorized_keys line string diff --git a/lib/puppet/functions/accounts_ssh_authorized_keys_line_parser.rb b/lib/puppet/functions/accounts_ssh_authorized_keys_line_parser.rb index 77ca368a..c3940dec 100644 --- a/lib/puppet/functions/accounts_ssh_authorized_keys_line_parser.rb +++ b/lib/puppet/functions/accounts_ssh_authorized_keys_line_parser.rb @@ -12,7 +12,7 @@ # @example Calling the function # accounts_ssh_authorized_keys_line_parser_string('options ssh-rsa AAAA... comment) dispatch :accounts_ssh_authorized_keys_line_parser_string do - param 'String', :str + param 'String[1]', :str end def accounts_ssh_authorized_keys_line_parser_string(str) diff --git a/manifests/key_management.pp b/manifests/key_management.pp index 01a06392..7f3bff4e 100644 --- a/manifests/key_management.pp +++ b/manifests/key_management.pp @@ -42,7 +42,7 @@ Accounts::User::Name $sshkey_group = $group, Accounts::User::Name $sshkey_owner = $user, Variant[Integer[0],String] $sshkey_mode = '0600', - Array[String] $sshkeys = [], + Array[String[1]] $sshkeys = [], Optional[Stdlib::Unixpath] $user_home = undef, ) { if $user_home { @@ -98,7 +98,7 @@ } if $sshkeys != [] { - $sshkeys.each |$sshkey| { + $sshkeys.each |String[1] $sshkey| { accounts::manage_keys { "${sshkey} for ${user}": ensure => $ensure, keyspec => $sshkey, diff --git a/manifests/manage_keys.pp b/manifests/manage_keys.pp index 13907c02..fe0eef1d 100644 --- a/manifests/manage_keys.pp +++ b/manifests/manage_keys.pp @@ -20,7 +20,7 @@ # define accounts::manage_keys ( Stdlib::Unixpath $key_file, - String $keyspec, + String[1] $keyspec, Accounts::User::Name $user, Enum['absent','present'] $ensure = 'present', Accounts::User::Name $key_owner = $user, diff --git a/manifests/user.pp b/manifests/user.pp index dec6cf83..d90dfceb 100644 --- a/manifests/user.pp +++ b/manifests/user.pp @@ -213,7 +213,7 @@ Optional[Accounts::User::Name] $sshkey_group = $group, Optional[Accounts::User::Name] $sshkey_owner = $name, Variant[Integer[0],String] $sshkey_mode = '0600', - Array[String] $sshkeys = [], + Array[String[1]] $sshkeys = [], Boolean $system = false, Optional[Accounts::User::Uid] $uid = undef, ) { diff --git a/spec/functions/accounts_ssh_authorized_keys_line_parser_spec.rb b/spec/functions/accounts_ssh_authorized_keys_line_parser_spec.rb index 3437dc4b..46c8773e 100644 --- a/spec/functions/accounts_ssh_authorized_keys_line_parser_spec.rb +++ b/spec/functions/accounts_ssh_authorized_keys_line_parser_spec.rb @@ -8,7 +8,7 @@ } it { - expect(subject).to run.with_params('').and_raise_error(ArgumentError, %r{Wrong Keyline format!}) + expect(subject).to run.with_params('').and_raise_error(ArgumentError, %r{'accounts_ssh_authorized_keys_line_parser' parameter 'str' expects a String\[1\] value, got String}) } it { From 46517657ce6fed7f23af2386ca7e24762b57f287 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 7 May 2024 18:43:32 +0000 Subject: [PATCH 13/13] Release prep v8.2.0 --- CHANGELOG.md | 19 +++++++++++++++++++ metadata.json | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 980e94e2..bbf0aeb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ All 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). +## [v8.2.0](https://github.com/puppetlabs/puppetlabs-accounts/tree/v8.2.0) - 2024-05-07 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/v8.1.1...v8.2.0) + +### Added + +- accounts_ssh_authorized_keys_line_parser: Output regex matches when sshkey format isnt correct [#484](https://github.com/puppetlabs/puppetlabs-accounts/pull/484) ([bastelfreak](https://github.com/bastelfreak)) + +### Fixed + +- usermanagement: prohibit empty ssh keys [#483](https://github.com/puppetlabs/puppetlabs-accounts/pull/483) ([bastelfreak](https://github.com/bastelfreak)) + ## [v8.1.1](https://github.com/puppetlabs/puppetlabs-accounts/tree/v8.1.1) - 2024-03-26 [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/v8.1.0...v8.1.1) @@ -31,6 +43,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/v7.3.1...v8.0.0) ### Changed + - (CONT-850) Puppet 8 support / Drop Puppet 6 [#441](https://github.com/puppetlabs/puppetlabs-accounts/pull/441) ([LukasAud](https://github.com/LukasAud)) ## [v7.3.1](https://github.com/puppetlabs/puppetlabs-accounts/tree/v7.3.1) - 2023-01-27 @@ -111,6 +124,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/v6.4.0...v7.0.0) ### Changed + - Update metadata.json - remove ubuntu 14.04 [#368](https://github.com/puppetlabs/puppetlabs-accounts/pull/368) ([daianamezdrea](https://github.com/daianamezdrea)) - pdksync - Remove Puppet 5 from testing and bump minimal version to 6.0.0 [#359](https://github.com/puppetlabs/puppetlabs-accounts/pull/359) ([carabasdaniel](https://github.com/carabasdaniel)) @@ -168,6 +182,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/v5.0.0...v6.0.0) ### Changed + - pdksync - FM-8499 - remove ubuntu14 support [#277](https://github.com/puppetlabs/puppetlabs-accounts/pull/277) ([lionce](https://github.com/lionce)) ### Added @@ -184,6 +199,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/v4.2.0...v5.0.0) ### Changed + - (MODULES-9712) Move data into hiera. [#241](https://github.com/puppetlabs/puppetlabs-accounts/pull/241) ([pillarsdotnet](https://github.com/pillarsdotnet)) ### Added @@ -226,6 +242,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/3.2.0...v4.0.0) ### Changed + - pdksync - (MODULES-8444) - Raise lower Puppet bound [#218](https://github.com/puppetlabs/puppetlabs-accounts/pull/218) ([david22swan](https://github.com/david22swan)) - (MODULES-8909) Add type-aliases and auto-loading. [#214](https://github.com/puppetlabs/puppetlabs-accounts/pull/214) ([pillarsdotnet](https://github.com/pillarsdotnet)) @@ -269,6 +286,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/2.0.0...3.0.0) ### Changed + - Adding ability to specify custom ssh_key location [#149](https://github.com/puppetlabs/puppetlabs-accounts/pull/149) ([ggeldenhuis](https://github.com/ggeldenhuis)) ### Added @@ -290,6 +308,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-accounts/compare/1.3.0...2.0.0) ### Changed + - [FM-6969] Removal of unsupported OS from accounts [#143](https://github.com/puppetlabs/puppetlabs-accounts/pull/143) ([david22swan](https://github.com/david22swan)) ### Added diff --git a/metadata.json b/metadata.json index d0136041..2f4db320 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-accounts", - "version": "8.1.1", + "version": "8.2.0", "author": "puppetlabs", "summary": "Account management module.", "license": "Apache-2.0",