renovate 44.61.1 → 44.61.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/dist/config/migration.js +1 -1
  2. package/dist/config/migration.js.map +1 -1
  3. package/dist/config/migrations/custom/schedule-migration.js +8 -8
  4. package/dist/config/migrations/custom/schedule-migration.js.map +1 -1
  5. package/dist/config/options/env.js +1 -1
  6. package/dist/config/options/env.js.map +1 -1
  7. package/dist/config/parse.js +1 -1
  8. package/dist/config/parse.js.map +1 -1
  9. package/dist/config/presets/parse.js +1 -1
  10. package/dist/config/presets/parse.js.map +1 -1
  11. package/dist/config/validation.js +1 -1
  12. package/dist/config/validation.js.map +1 -1
  13. package/dist/logger/utils.js +2 -2
  14. package/dist/logger/utils.js.map +1 -1
  15. package/dist/modules/datasource/deno/index.js +1 -1
  16. package/dist/modules/datasource/deno/index.js.map +1 -1
  17. package/dist/modules/datasource/docker/ecr.js +1 -1
  18. package/dist/modules/datasource/docker/ecr.js.map +1 -1
  19. package/dist/modules/datasource/docker/google.js +1 -1
  20. package/dist/modules/datasource/docker/google.js.map +1 -1
  21. package/dist/modules/datasource/go/base.js +1 -1
  22. package/dist/modules/datasource/go/base.js.map +1 -1
  23. package/dist/modules/datasource/go/goproxy-parser.js +1 -1
  24. package/dist/modules/datasource/go/goproxy-parser.js.map +1 -1
  25. package/dist/modules/datasource/go/releases-goproxy.js +1 -1
  26. package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
  27. package/dist/modules/datasource/gradle-version/index.js +1 -1
  28. package/dist/modules/datasource/gradle-version/index.js.map +1 -1
  29. package/dist/modules/datasource/helm/schema.js +2 -2
  30. package/dist/modules/datasource/helm/schema.js.map +1 -1
  31. package/dist/modules/datasource/hexpm-bob/index.js +1 -1
  32. package/dist/modules/datasource/hexpm-bob/index.js.map +1 -1
  33. package/dist/modules/datasource/npm/get.js +1 -1
  34. package/dist/modules/datasource/npm/get.js.map +1 -1
  35. package/dist/modules/datasource/npm/npmrc.js +1 -1
  36. package/dist/modules/datasource/npm/npmrc.js.map +1 -1
  37. package/dist/modules/datasource/pypi/common.js +2 -2
  38. package/dist/modules/datasource/pypi/common.js.map +1 -1
  39. package/dist/modules/datasource/pypi/index.js +1 -1
  40. package/dist/modules/datasource/pypi/index.js.map +1 -1
  41. package/dist/modules/manager/ansible/extract.js +2 -2
  42. package/dist/modules/manager/ansible/extract.js.map +1 -1
  43. package/dist/modules/manager/ansible-galaxy/collections.js +2 -2
  44. package/dist/modules/manager/ansible-galaxy/collections.js.map +1 -1
  45. package/dist/modules/manager/ansible-galaxy/roles.js +2 -2
  46. package/dist/modules/manager/ansible-galaxy/roles.js.map +1 -1
  47. package/dist/modules/manager/ansible-galaxy/util.js +4 -4
  48. package/dist/modules/manager/ansible-galaxy/util.js.map +1 -1
  49. package/dist/modules/manager/ant/properties.js +9 -9
  50. package/dist/modules/manager/ant/properties.js.map +1 -1
  51. package/dist/modules/manager/asdf/extract.js +1 -1
  52. package/dist/modules/manager/asdf/extract.js.map +1 -1
  53. package/dist/modules/manager/asdf/upgradeable-tooling.js +1 -1
  54. package/dist/modules/manager/asdf/upgradeable-tooling.js.map +1 -1
  55. package/dist/modules/manager/batect-wrapper/extract.js +2 -2
  56. package/dist/modules/manager/batect-wrapper/extract.js.map +1 -1
  57. package/dist/modules/manager/bazel/rules/go.js +1 -1
  58. package/dist/modules/manager/bazel/rules/go.js.map +1 -1
  59. package/dist/modules/manager/buildkite/extract.js +1 -1
  60. package/dist/modules/manager/buildkite/extract.js.map +1 -1
  61. package/dist/modules/manager/buildpacks/extract.js +1 -1
  62. package/dist/modules/manager/buildpacks/extract.js.map +1 -1
  63. package/dist/modules/manager/bundler/common.js +7 -7
  64. package/dist/modules/manager/bundler/common.js.map +1 -1
  65. package/dist/modules/manager/bundler/extract.js +4 -4
  66. package/dist/modules/manager/bundler/extract.js.map +1 -1
  67. package/dist/modules/manager/deno/utils.js +1 -1
  68. package/dist/modules/manager/deno/utils.js.map +1 -1
  69. package/dist/modules/manager/dockerfile/extract.js +11 -4
  70. package/dist/modules/manager/dockerfile/extract.js.map +1 -1
  71. package/dist/modules/manager/fingerprint.generated.js +4 -4
  72. package/dist/modules/manager/fingerprint.generated.js.map +1 -1
  73. package/dist/modules/manager/flux/extract.js +2 -1
  74. package/dist/modules/manager/flux/extract.js.map +1 -1
  75. package/dist/modules/manager/git-submodules/extract.js +1 -1
  76. package/dist/modules/manager/git-submodules/extract.js.map +1 -1
  77. package/dist/modules/manager/github-actions/common.js +3 -3
  78. package/dist/modules/manager/github-actions/common.js.map +1 -1
  79. package/dist/modules/manager/github-actions/parse.js +1 -1
  80. package/dist/modules/manager/github-actions/parse.js.map +1 -1
  81. package/dist/modules/manager/gomod/artifacts.js +4 -4
  82. package/dist/modules/manager/gomod/artifacts.js.map +1 -1
  83. package/dist/modules/manager/gomod/line-parser.js +1 -1
  84. package/dist/modules/manager/gomod/line-parser.js.map +1 -1
  85. package/dist/modules/manager/gomod/update.js +1 -1
  86. package/dist/modules/manager/gomod/update.js.map +1 -1
  87. package/dist/modules/manager/gradle/parser/handlers.js +1 -1
  88. package/dist/modules/manager/gradle/parser/handlers.js.map +1 -1
  89. package/dist/modules/manager/helmv3/utils.js +1 -1
  90. package/dist/modules/manager/helmv3/utils.js.map +1 -1
  91. package/dist/modules/manager/html/extract.js +2 -2
  92. package/dist/modules/manager/html/extract.js.map +1 -1
  93. package/dist/modules/manager/kustomize/extract.js +3 -3
  94. package/dist/modules/manager/kustomize/extract.js.map +1 -1
  95. package/dist/modules/manager/leiningen/extract.js +1 -1
  96. package/dist/modules/manager/leiningen/extract.js.map +1 -1
  97. package/dist/modules/manager/maven-wrapper/artifacts.js +6 -6
  98. package/dist/modules/manager/maven-wrapper/artifacts.js.map +1 -1
  99. package/dist/modules/manager/meteor/extract.js +2 -2
  100. package/dist/modules/manager/meteor/extract.js.map +1 -1
  101. package/dist/modules/manager/mise/upgradeable-tooling.js +2 -2
  102. package/dist/modules/manager/mise/upgradeable-tooling.js.map +1 -1
  103. package/dist/modules/manager/mix/extract.js +3 -3
  104. package/dist/modules/manager/mix/extract.js.map +1 -1
  105. package/dist/modules/manager/npm/extract/common/dependency.js +4 -4
  106. package/dist/modules/manager/npm/extract/common/dependency.js.map +1 -1
  107. package/dist/modules/manager/npm/extract/yarnrc.js +1 -1
  108. package/dist/modules/manager/npm/extract/yarnrc.js.map +1 -1
  109. package/dist/modules/manager/npm/npmrc.js +1 -1
  110. package/dist/modules/manager/npm/npmrc.js.map +1 -1
  111. package/dist/modules/manager/npm/post-update/yarn.js +1 -1
  112. package/dist/modules/manager/npm/post-update/yarn.js.map +1 -1
  113. package/dist/modules/manager/npm/update/locked-dependency/package-lock/dep-constraints.js +1 -1
  114. package/dist/modules/manager/npm/update/locked-dependency/package-lock/dep-constraints.js.map +1 -1
  115. package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/replace.js +1 -1
  116. package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/replace.js.map +1 -1
  117. package/dist/modules/manager/nuget/extract.js +1 -1
  118. package/dist/modules/manager/nuget/extract.js.map +1 -1
  119. package/dist/modules/manager/pep621/utils.js +1 -1
  120. package/dist/modules/manager/pep621/utils.js.map +1 -1
  121. package/dist/modules/manager/pep723/utils.js +1 -1
  122. package/dist/modules/manager/pep723/utils.js.map +1 -1
  123. package/dist/modules/manager/pip-compile/common.js +2 -2
  124. package/dist/modules/manager/pip-compile/common.js.map +1 -1
  125. package/dist/modules/manager/pip_requirements/common.js +1 -1
  126. package/dist/modules/manager/pip_requirements/common.js.map +1 -1
  127. package/dist/modules/manager/pip_requirements/extract.js +1 -1
  128. package/dist/modules/manager/pip_requirements/extract.js.map +1 -1
  129. package/dist/modules/manager/poetry/artifacts.js +4 -4
  130. package/dist/modules/manager/poetry/artifacts.js.map +1 -1
  131. package/dist/modules/manager/puppet/puppetfile-parser.js +5 -5
  132. package/dist/modules/manager/puppet/puppetfile-parser.js.map +1 -1
  133. package/dist/modules/manager/sbt/update.js +1 -1
  134. package/dist/modules/manager/sbt/update.js.map +1 -1
  135. package/dist/modules/manager/sbt/util.js +2 -2
  136. package/dist/modules/manager/sbt/util.js.map +1 -1
  137. package/dist/modules/manager/setup-cfg/extract.js +2 -2
  138. package/dist/modules/manager/setup-cfg/extract.js.map +1 -1
  139. package/dist/modules/manager/swift/artifacts.js +4 -4
  140. package/dist/modules/manager/swift/artifacts.js.map +1 -1
  141. package/dist/modules/manager/swift/extract.js +1 -1
  142. package/dist/modules/manager/swift/extract.js.map +1 -1
  143. package/dist/modules/manager/tekton/extract.js +1 -1
  144. package/dist/modules/manager/tekton/extract.js.map +1 -1
  145. package/dist/modules/manager/terraform/extractors/others/modules.js +5 -5
  146. package/dist/modules/manager/terraform/extractors/others/modules.js.map +1 -1
  147. package/dist/modules/manager/terraform/util.js +1 -1
  148. package/dist/modules/manager/terraform/util.js.map +1 -1
  149. package/dist/modules/manager/terragrunt/modules.js +3 -3
  150. package/dist/modules/manager/terragrunt/modules.js.map +1 -1
  151. package/dist/modules/platform/azure/index.js +1 -1
  152. package/dist/modules/platform/azure/index.js.map +1 -1
  153. package/dist/modules/platform/bitbucket/index.js +4 -4
  154. package/dist/modules/platform/bitbucket/index.js.map +1 -1
  155. package/dist/modules/platform/bitbucket-server/index.js +1 -1
  156. package/dist/modules/platform/bitbucket-server/index.js.map +1 -1
  157. package/dist/modules/platform/gerrit/index.js +1 -1
  158. package/dist/modules/platform/gerrit/index.js.map +1 -1
  159. package/dist/modules/platform/gerrit/utils.js +3 -3
  160. package/dist/modules/platform/gerrit/utils.js.map +1 -1
  161. package/dist/modules/versioning/apk/index.js +3 -3
  162. package/dist/modules/versioning/apk/index.js.map +1 -1
  163. package/dist/modules/versioning/composer/index.js +11 -11
  164. package/dist/modules/versioning/composer/index.js.map +1 -1
  165. package/dist/modules/versioning/conan/range.js +1 -1
  166. package/dist/modules/versioning/conan/range.js.map +1 -1
  167. package/dist/modules/versioning/conda/index.js +1 -1
  168. package/dist/modules/versioning/conda/index.js.map +1 -1
  169. package/dist/modules/versioning/devbox/index.js +2 -2
  170. package/dist/modules/versioning/devbox/index.js.map +1 -1
  171. package/dist/modules/versioning/distro.js +1 -1
  172. package/dist/modules/versioning/distro.js.map +1 -1
  173. package/dist/modules/versioning/github-actions/index.js +2 -2
  174. package/dist/modules/versioning/github-actions/index.js.map +1 -1
  175. package/dist/modules/versioning/go-mod-directive/index.js +1 -1
  176. package/dist/modules/versioning/go-mod-directive/index.js.map +1 -1
  177. package/dist/modules/versioning/hashicorp/convertor.js +5 -5
  178. package/dist/modules/versioning/hashicorp/convertor.js.map +1 -1
  179. package/dist/modules/versioning/hex/index.js +4 -4
  180. package/dist/modules/versioning/hex/index.js.map +1 -1
  181. package/dist/modules/versioning/lambda-node/schedule.js +2 -2
  182. package/dist/modules/versioning/lambda-node/schedule.js.map +1 -1
  183. package/dist/modules/versioning/loose/index.js +2 -2
  184. package/dist/modules/versioning/loose/index.js.map +1 -1
  185. package/dist/modules/versioning/pep440/range.js +1 -1
  186. package/dist/modules/versioning/pep440/range.js.map +1 -1
  187. package/dist/modules/versioning/perl/index.js +4 -4
  188. package/dist/modules/versioning/perl/index.js.map +1 -1
  189. package/dist/modules/versioning/poetry/patterns.js +1 -1
  190. package/dist/modules/versioning/poetry/patterns.js.map +1 -1
  191. package/dist/modules/versioning/poetry/transform.js +3 -3
  192. package/dist/modules/versioning/poetry/transform.js.map +1 -1
  193. package/dist/modules/versioning/redhat/index.js +1 -1
  194. package/dist/modules/versioning/redhat/index.js.map +1 -1
  195. package/dist/modules/versioning/rpm/index.js +1 -1
  196. package/dist/modules/versioning/rpm/index.js.map +1 -1
  197. package/dist/modules/versioning/ruby/index.js +2 -2
  198. package/dist/modules/versioning/ruby/index.js.map +1 -1
  199. package/dist/modules/versioning/semver/common.js +1 -1
  200. package/dist/modules/versioning/semver/common.js.map +1 -1
  201. package/dist/modules/versioning/swift/range.js +13 -13
  202. package/dist/modules/versioning/swift/range.js.map +1 -1
  203. package/dist/modules/versioning/ubuntu/index.js +1 -1
  204. package/dist/modules/versioning/ubuntu/index.js.map +1 -1
  205. package/dist/modules/versioning/unity3d-packages/index.js +2 -2
  206. package/dist/modules/versioning/unity3d-packages/index.js.map +1 -1
  207. package/dist/util/cache/package/impl/redis.js +1 -1
  208. package/dist/util/cache/package/impl/redis.js.map +1 -1
  209. package/dist/util/git/author.js +1 -1
  210. package/dist/util/git/author.js.map +1 -1
  211. package/dist/util/git/semantic.js +1 -1
  212. package/dist/util/git/semantic.js.map +1 -1
  213. package/dist/util/http/www-authenticate.js +4 -4
  214. package/dist/util/http/www-authenticate.js.map +1 -1
  215. package/dist/util/ignore.js +1 -1
  216. package/dist/util/ignore.js.map +1 -1
  217. package/dist/util/markdown.js +8 -8
  218. package/dist/util/markdown.js.map +1 -1
  219. package/dist/util/pretty-time.js +3 -3
  220. package/dist/util/pretty-time.js.map +1 -1
  221. package/dist/util/regex.js +1 -1
  222. package/dist/util/regex.js.map +1 -1
  223. package/dist/workers/global/config/parse/cli.js +1 -1
  224. package/dist/workers/global/config/parse/cli.js.map +1 -1
  225. package/dist/workers/repository/model/semantic-commit-message.js +1 -1
  226. package/dist/workers/repository/model/semantic-commit-message.js.map +1 -1
  227. package/dist/workers/repository/onboarding/pr/pr-list.js +2 -2
  228. package/dist/workers/repository/onboarding/pr/pr-list.js.map +1 -1
  229. package/dist/workers/repository/update/pr/changelog/release-notes.js +3 -3
  230. package/dist/workers/repository/update/pr/changelog/release-notes.js.map +1 -1
  231. package/dist/workers/repository/updates/branch-name.js +1 -1
  232. package/dist/workers/repository/updates/branch-name.js.map +1 -1
  233. package/dist/workers/repository/updates/flatten.js +1 -1
  234. package/dist/workers/repository/updates/flatten.js.map +1 -1
  235. package/dist/workers/repository/updates/generate.js +1 -1
  236. package/dist/workers/repository/updates/generate.js.map +1 -1
  237. package/package.json +2 -2
  238. package/renovate-schema.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"validation.js","names":["regexOrGlobValidator.check","matchBaseBranchesValidator.check"],"sources":["../../lib/config/validation.ts"],"sourcesContent":["import is, {\n isArray,\n isEmptyString,\n isNonEmptyArray,\n isNonEmptyString,\n isNonEmptyStringAndNotWhitespace,\n isObject,\n isPlainObject,\n isString,\n isUndefined,\n} from '@sindresorhus/is';\nimport type { PlatformId } from '../constants/index.ts';\nimport { instrument } from '../instrumentation/index.ts';\nimport { logger } from '../logger/index.ts';\nimport {\n AllManagersListLiteral,\n CustomManagersListLiteral,\n} from '../manager-list.generated.ts';\nimport { isCustomManager } from '../modules/manager/custom/index.ts';\nimport type { CustomManager } from '../modules/manager/custom/types.ts';\nimport type { HostRule } from '../types/index.ts';\nimport { coerceArray } from '../util/array.ts';\nimport { packageCacheNamespaces } from '../util/cache/package/namespaces.ts';\nimport { clone } from '../util/clone.ts';\nimport { getToolConfig } from '../util/exec/containerbase.ts';\nimport { isConstraintName, isToolName } from '../util/exec/types.ts';\nimport { isValidCommitTrailer } from '../util/git/commit-trailers.ts';\nimport { getExpression } from '../util/jsonata.ts';\nimport { regEx } from '../util/regex.ts';\nimport {\n anyMatchRegexOrGlobList,\n getRegexPredicate,\n isRegexMatch,\n matchRegexOrGlobList,\n} from '../util/string-match.ts';\nimport * as template from '../util/template/index.ts';\nimport { parseUrl } from '../util/url.ts';\nimport {\n AllVersioningsListLiteral,\n type VersioningName,\n} from '../versioning-list.generated.ts';\nimport {\n hasValidSchedule,\n hasValidTimezone,\n} from '../workers/repository/update/branch/schedule.ts';\nimport { getConfigFileNames } from './app-strings.ts';\nimport { GlobalConfig } from './global.ts';\nimport { migrateConfig } from './migration.ts';\nimport { getOptions } from './options/index.ts';\nimport { resolveConfigPresets } from './presets/index.ts';\nimport { supportedDatasources } from './presets/internal/merge-confidence.preset.ts';\nimport { isRelativePresetReference, parsePreset } from './presets/parse.ts';\nimport type {\n AllConfig,\n AllowedParents,\n RenovateConfig,\n RenovateOptions,\n StatusCheckKey,\n ValidationMessage,\n ValidationResult,\n} from './types.ts';\nimport { allowedStatusCheckStrings } from './types.ts';\nimport * as matchBaseBranchesValidator from './validation-helpers/match-base-branches.ts';\nimport * as regexOrGlobValidator from './validation-helpers/regex-glob-matchers.ts';\nimport { ConfigValidationTopic } from './validation-helpers/types.ts';\nimport {\n getParentName,\n isFalseGlobal,\n validateJSONataManagerFields,\n validateNumber,\n validatePlainObject,\n validateRegexManagerFields,\n} from './validation-helpers/utils.ts';\n\nconst options = getOptions();\n\nlet optionsInitialized = false;\nlet optionTypes: Record<string, RenovateOptions['type']>;\nlet optionParents: Record<string, AllowedParents[]>;\nlet optionGlobals: Set<string>;\nlet optionInherits: Set<string>;\nlet optionRegexOrGlob: Set<string>;\nlet optionAllowsNegativeIntegers: Set<string>;\nlet optionSupportsTemplating: Set<string>;\n\nconst managerList: readonly string[] = AllManagersListLiteral;\n\nconst allManagersList: readonly string[] = [\n ...AllManagersListLiteral,\n ...CustomManagersListLiteral,\n];\n\nconst topLevelObjects = [...managerList, 'env'];\n\nconst ignoredNodes = [\n '$schema',\n 'headers',\n 'depType',\n 'npmToken',\n 'packageFile',\n 'forkToken',\n 'repository',\n 'vulnerabilityAlertsOnly',\n 'vulnerabilityAlert',\n 'isVulnerabilityAlert',\n 'vulnerabilityFixVersion', // not intended to be used by end users but may be by Mend apps\n 'copyLocalLibs', // deprecated - functionality is now enabled by default\n 'prBody', // deprecated\n 'minimumConfidence', // undocumented feature flag\n];\nconst tzRe = regEx(/^:timezone\\((.+)\\)$/);\nconst rulesRe = regEx(/p.*Rules\\[\\d+\\]$/);\nconst repoEntryRe = regEx(/^repositories\\[\\d+\\]$/);\n\nfunction isIgnored(key: string): boolean {\n return ignoredNodes.includes(key);\n}\n\nfunction getUnsupportedEnabledManagers(enabledManagers: string[]): string[] {\n return enabledManagers.filter(\n (manager) => !allManagersList.includes(manager.replace('custom.', '')),\n );\n}\n\nfunction getDeprecationMessage(option: string): string | undefined {\n const deprecatedOptions: Record<string, string | undefined> = {\n branchName: `Direct editing of branchName is now deprecated. Please edit branchPrefix, additionalBranchPrefix, or branchTopic instead`,\n commitMessage: `Direct editing of commitMessage is now deprecated. Please edit commitMessage's subcomponents instead.`,\n prTitle: `Direct editing of prTitle is now deprecated. Please edit commitMessage subcomponents instead as they will be passed through to prTitle.`,\n };\n if (deprecatedOptions[option]) {\n return deprecatedOptions[option];\n }\n\n const found = options.find((o) => o.name === option);\n if (!found) {\n return undefined;\n }\n\n if (!found.deprecationMsg) {\n return undefined;\n }\n\n return `The '${option}' option is deprecated: ${found.deprecationMsg}`;\n}\n\nfunction isInhertConfigOption(key: string): boolean {\n return optionInherits.has(key);\n}\n\nfunction isRegexOrGlobOption(key: string): boolean {\n return optionRegexOrGlob.has(key);\n}\n\nfunction isGlobalOption(key: string): boolean {\n return optionGlobals.has(key);\n}\n\nfunction initOptions(): void {\n if (optionsInitialized) {\n return;\n }\n\n optionParents = {};\n optionInherits = new Set();\n optionTypes = {};\n optionRegexOrGlob = new Set();\n optionGlobals = new Set();\n optionAllowsNegativeIntegers = new Set();\n optionSupportsTemplating = new Set();\n\n for (const option of options) {\n optionTypes[option.name] = option.type;\n\n if (option.parents) {\n optionParents[option.name] = option.parents;\n }\n\n if (option.inheritConfigSupport) {\n optionInherits.add(option.name);\n }\n\n if (option.patternMatch) {\n optionRegexOrGlob.add(option.name);\n }\n\n if (option.globalOnly) {\n optionGlobals.add(option.name);\n }\n\n if (option.allowNegative) {\n optionAllowsNegativeIntegers.add(option.name);\n }\n\n if (option.supportsTemplating) {\n optionSupportsTemplating.add(option.name);\n }\n }\n\n optionsInitialized = true;\n}\n\n/**\n * Removes every relative preset reference from a deep copy of the given\n * `packageRules` entry, at any nesting depth.\n *\n * Relative references are only resolvable while the preset which contains them\n * is fetched, so they must not be passed to `resolveConfigPresets()` during\n * validation. They are still syntax checked by the `extends` validation.\n */\nfunction stripRelativePresets(packageRule: RenovateConfig): {\n rule: RenovateConfig;\n hasRelativePresets: boolean;\n} {\n const rule = clone(packageRule);\n const hasRelativePresets = stripRelativePresetsFromValue(rule);\n return { rule, hasRelativePresets };\n}\n\nfunction stripRelativePresetsFromValue(value: unknown): boolean {\n if (isArray(value)) {\n let stripped = false;\n for (const element of value) {\n stripped = stripRelativePresetsFromValue(element) || stripped;\n }\n return stripped;\n }\n\n if (!isPlainObject(value)) {\n return false;\n }\n\n let stripped = false;\n for (const [key, val] of Object.entries(value)) {\n if (key === 'extends' && isArray(val)) {\n const remaining = val.filter(\n (preset) => !(isString(preset) && isRelativePresetReference(preset)),\n );\n if (remaining.length !== val.length) {\n value[key] = remaining;\n stripped = true;\n }\n continue;\n }\n\n stripped = stripRelativePresetsFromValue(val) || stripped;\n }\n return stripped;\n}\n\nexport async function validateConfig(\n configType: 'global' | 'inherit' | 'repo',\n config: AllConfig,\n isPreset?: boolean,\n parentPath?: string,\n): Promise<ValidationResult> {\n return instrument(\n `validateConfig(${configType}, ${JSON.stringify(parentPath)})`,\n async () => {\n initOptions();\n\n let errors: ValidationMessage[] = [];\n let warnings: ValidationMessage[] = [];\n\n for (const [key, val] of Object.entries(config)) {\n const currentPath = parentPath ? `${parentPath}.${key}` : key;\n /* v8 ignore next -- TODO: add test */\n if (key === '__proto__') {\n errors.push({\n topic: ConfigValidationTopic.Security,\n message: '__proto__',\n });\n continue;\n }\n if (\n parentPath &&\n parentPath !== 'onboardingConfig' &&\n !repoEntryRe.test(parentPath) &&\n topLevelObjects.includes(key)\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `The \"${key}\" object can only be configured at the top level of a config but was found inside \"${parentPath}\"`,\n });\n }\n\n if (isGlobalOption(key)) {\n if (configType === 'global') {\n await validateGlobalConfig(\n key,\n val,\n optionTypes[key],\n warnings,\n errors,\n currentPath,\n config,\n );\n continue;\n } else if (\n !isFalseGlobal(key, parentPath) &&\n !(configType === 'inherit' && isInhertConfigOption(key))\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `The \"${key}\" option is a global option reserved only for Renovate's global configuration and cannot be configured within a repository's config file.`,\n });\n continue;\n }\n }\n if (key === 'enabledManagers' && val) {\n const unsupportedManagers = getUnsupportedEnabledManagers(\n val as string[],\n );\n if (isNonEmptyArray(unsupportedManagers)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `The following managers configured in enabledManagers are not supported: \"${unsupportedManagers.join(\n ', ',\n )}\"`,\n });\n }\n }\n if (key === 'registryUrls' && !parentPath && isNonEmptyArray(val)) {\n warnings.push({\n topic: ConfigValidationTopic.Warning,\n message:\n 'Setting `registryUrls` at the top level of your config will apply it to all managers and datasources, which can cause the wrong registry URL to be used for some packages. Use `registryUrls` inside `packageRules` to target specific managers or packages.',\n });\n }\n if (\n key === 'defaultRegistryUrls' &&\n !parentPath &&\n isNonEmptyArray(val)\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Warning,\n message:\n 'Setting `defaultRegistryUrls` at the top level of your config will apply it to all managers and datasources, which can cause the wrong registry URL to be used for some packages. Use `defaultRegistryUrls` inside `packageRules` to target specific managers or packages.',\n });\n }\n if (\n !isIgnored(key) && // We need to ignore some reserved keys\n !(is as any).function(val) // Ignore all functions\n ) {\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: ConfigValidationTopic.Deprecation,\n message: getDeprecationMessage(key)!,\n });\n }\n if (optionSupportsTemplating.has(key) && val) {\n try {\n // TODO: types (#22198)\n template.validate((val as string).toString());\n } catch {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid template in config path: ${currentPath}`,\n });\n }\n }\n const parentName =\n parentPath && repoEntryRe.test(parentPath)\n ? '.'\n : getParentName(parentPath);\n if (\n !isPreset &&\n optionParents[key] &&\n !optionParents[key].includes(parentName as AllowedParents)\n ) {\n // TODO: types (#22198)\n const options = optionParents[key]?.toSorted().join(', ');\n const message = `\"${key}\" can't be used in \"${parentName}\". Allowed objects: ${options}.`;\n warnings.push({\n topic: `${parentPath ? `${parentPath}.` : ''}${key}`,\n message,\n });\n }\n\n // v8 ignore else -- intentionally unhandled - if we knew what was to be covered here, we'd add validation\n if (!optionTypes[key]) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid configuration option: ${currentPath}`,\n });\n } else if (key === 'schedule') {\n const [validSchedule, errorMessage] = hasValidSchedule(\n val as string[],\n );\n if (!validSchedule) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid ${currentPath}: \\`${errorMessage}\\``,\n });\n }\n } else if (\n [\n 'allowedVersions',\n 'matchCurrentVersion',\n 'matchCurrentValue',\n 'matchNewValue',\n ].includes(key) &&\n isRegexMatch(val)\n ) {\n if (!getRegexPredicate(val)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid regExp for ${currentPath}: \\`${val}\\``,\n });\n }\n } else if (key === 'timezone' && val !== null) {\n const [validTimezone, errorMessage] = hasValidTimezone(\n val as string,\n );\n if (!validTimezone) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n } else if (val !== null) {\n const type = optionTypes[key];\n if (type === 'boolean') {\n if (val !== true && val !== false) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val})`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n errors.push(\n ...validateNumber(key, val, allowsNegative, currentPath),\n );\n } else if (type === 'array' && val) {\n if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n configType,\n subval,\n isPreset,\n `${currentPath}[${subIndex}]`,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n if (isRegexOrGlobOption(key)) {\n errors.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath,\n }),\n );\n }\n if (key === 'extends') {\n for (const subval of val) {\n if (isString(subval)) {\n if (\n configType !== 'global' &&\n subval.startsWith('global:')\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: you cannot extend from \"global:\" presets in a repository config's \"extends\"`,\n });\n }\n\n if (\n parentName === 'packageRules' &&\n subval.startsWith('group:')\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Warning,\n message: `${currentPath}: you should not extend \"group:\" presets`,\n });\n }\n if (tzRe.test(subval)) {\n const [, timezone] = tzRe.exec(subval)!;\n const [validTimezone, errorMessage] =\n hasValidTimezone(timezone);\n if (!validTimezone) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n }\n if (!subval.includes('{{')) {\n try {\n parsePreset(subval);\n } catch {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: preset \"${subval}\" is not valid`,\n });\n }\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: preset value is not a string`,\n });\n }\n }\n }\n\n if (key === 'commitTrailers') {\n for (const subval of val) {\n if (!isValidCommitTrailer(subval)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid commit trailer: \\`${JSON.stringify(\n subval,\n )}\\`. Must be a single-line string in the form \\`Key: value\\`, where the key contains only letters, digits and \\`-\\`.`,\n });\n }\n }\n }\n\n const selectors = [\n 'matchFileNames',\n 'matchLanguages',\n 'matchCategories',\n 'matchBaseBranches',\n 'matchManagers',\n 'matchDatasources',\n 'matchDepTypes',\n 'matchDepNames',\n 'matchPackageNames',\n 'matchCurrentValue',\n 'matchCurrentVersion',\n 'matchSourceUrls',\n 'matchRegistryUrls',\n 'matchUpdateTypes',\n 'matchConfidence',\n 'matchCurrentAge',\n 'matchRepositories',\n 'matchNewValue',\n 'matchJsonata',\n ];\n if (key === 'packageRules') {\n for (const [subIndex, packageRule] of val.entries()) {\n if (isObject(packageRule)) {\n const { rule, hasRelativePresets } =\n stripRelativePresets(packageRule);\n const { config: resolved } = await resolveConfigPresets(\n rule,\n config,\n );\n const resolvedRule = migrateConfig({\n packageRules: [resolved],\n }).migratedConfig.packageRules![0];\n warnings.push(\n ...matchBaseBranchesValidator.check({\n resolvedRule,\n currentPath: `${currentPath}[${subIndex}]`,\n baseBranchPatterns: config.baseBranchPatterns!,\n }),\n );\n const selectorLength = Object.keys(resolvedRule).filter(\n (ruleKey) => selectors.includes(ruleKey),\n ).length;\n if (!selectorLength) {\n if (hasRelativePresets) {\n // the stripped relative preset may still provide the\n // missing selectors, so this cannot be an error\n const message = `${currentPath}[${subIndex}]: this rule extends a relative preset that cannot be resolved during validation, so its selectors could not be checked. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message,\n });\n } else {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one match* or exclude* selector. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: ConfigValidationTopic.Error,\n message,\n });\n }\n }\n if (\n // the stripped relative preset legitimately provides\n // the non-selector field\n !hasRelativePresets &&\n selectorLength === Object.keys(resolvedRule).length\n ) {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one non-match* or non-exclude* field. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message,\n });\n }\n // It's too late to apply any of these options once you already have updates determined\n const preLookupOptions = [\n 'allowedVersions',\n 'extractVersion',\n 'followTag',\n 'ignoreDeps',\n 'ignoreUnstable',\n 'rangeStrategy',\n 'registryUrls',\n 'respectLatest',\n 'rollbackPrs',\n 'separateMajorMinor',\n 'separateMinorPatch',\n 'separateMultipleMajor',\n 'separateMultipleMinor',\n 'versioning',\n ] as const;\n if (isNonEmptyArray(resolvedRule.matchUpdateTypes)) {\n for (const option of preLookupOptions) {\n if (resolvedRule[option] !== undefined) {\n const message = `${currentPath}[${subIndex}]: packageRules cannot combine both matchUpdateTypes and ${option}. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: ConfigValidationTopic.Error,\n message,\n });\n }\n }\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath} must contain JSON objects`,\n });\n }\n }\n }\n if (key === 'customManagers') {\n const allowedKeys = [\n 'customType',\n 'description',\n 'fileFormat',\n 'managerFilePatterns',\n 'matchStrings',\n 'matchStringsStrategy',\n 'depNameTemplate',\n 'packageNameTemplate',\n 'datasourceTemplate',\n 'versioningTemplate',\n 'registryUrlTemplate',\n 'currentValueTemplate',\n 'extractVersionTemplate',\n 'autoReplaceStringTemplate',\n 'depTypeTemplate',\n ];\n for (const customManager of val as CustomManager[]) {\n if (\n Object.keys(customManager).some(\n (k) => !allowedKeys.includes(k),\n )\n ) {\n const disallowedKeys = Object.keys(customManager).filter(\n (k) => !allowedKeys.includes(k),\n );\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Custom Manager contains disallowed fields: ${disallowedKeys.join(\n ', ',\n )}`,\n });\n } else if (\n isNonEmptyString(customManager.customType) &&\n isCustomManager(customManager.customType)\n ) {\n if (isNonEmptyArray(customManager.managerFilePatterns)) {\n switch (customManager.customType) {\n case 'regex':\n validateRegexManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n case 'jsonata':\n validateJSONataManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Each Custom Manager must contain a non-empty managerFilePatterns array`,\n });\n }\n } else {\n if (\n isEmptyString(customManager.customType) ||\n isUndefined(customManager.customType)\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Each Custom Manager must contain a non-empty customType string`,\n });\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid customType: ${customManager.customType}. Key is not a custom manager`,\n });\n }\n }\n }\n }\n if (['matchPackageNames', 'matchDepNames'].includes(key)) {\n const startPattern = regEx(/!?\\//);\n const endPattern = regEx(/\\/g?i?$/);\n for (const pattern of val as string[]) {\n if (\n startPattern.test(pattern) &&\n endPattern.test(pattern)\n ) {\n try {\n // regEx isn't aware of our !/ prefix but can handle the suffix\n regEx(pattern.replace(startPattern, '/'));\n } catch {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid regExp for ${currentPath}: \\`${pattern}\\``,\n });\n }\n }\n }\n }\n if (key === 'baseBranchPatterns') {\n for (const baseBranchPattern of val as string[]) {\n if (\n isRegexMatch(baseBranchPattern) &&\n !getRegexPredicate(baseBranchPattern)\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid regExp for ${currentPath}: \\`${baseBranchPattern}\\``,\n });\n }\n }\n }\n if (\n (selectors.includes(key) ||\n key === 'matchCurrentVersion' ||\n key === 'matchCurrentValue') &&\n // TODO: can be undefined ? #22198\n !rulesRe.test(parentPath!) && // Inside a packageRule\n (isString(parentPath) || !isPreset) // top level in a preset\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: ${key} should be inside a \\`packageRule\\` only`,\n });\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be a list (Array)`,\n });\n }\n } else if (type === 'string') {\n if (!isString(val)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be a string`,\n });\n }\n } else if (type === 'object') {\n if (isPlainObject(val)) {\n if (key === 'registryAliases') {\n const res = validatePlainObject(val);\n if (res !== true) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${key}.${res}\\` configuration: value is not a string`,\n });\n }\n } else if (key === 'env') {\n const allowedEnvVars =\n configType === 'global'\n ? coerceArray(config.allowedEnv)\n : GlobalConfig.get('allowedEnv');\n for (const [envVarName, envVarValue] of Object.entries(val)) {\n if (!isString(envVarValue)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid env variable value: \\`${currentPath}.${envVarName}\\` must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(envVarName, allowedEnvVars)) {\n errors.push({\n // `Security` is always a fatal error that blocks the rest of the Renovate run.\n //\n // As `env` is only applied when it's at the top-level (where `parentPath === undefined`), we should only report a security error there.\n //\n // If it's found to be set to a disallowed value - even if it's not going to be used - we should report as an error, which may block the run, but much less worryingly than Security.\n topic: parentPath\n ? ConfigValidationTopic.Error\n : ConfigValidationTopic.Security,\n message: `Env variable name \\`${envVarName}\\` is not allowed by this Renovate instance's \\`allowedEnv\\`.`,\n });\n }\n }\n } else if (key === 'statusCheckNames') {\n for (const [\n statusCheckKey,\n statusCheckValue,\n ] of Object.entries(val)) {\n if (\n !allowedStatusCheckStrings.includes(\n statusCheckKey as StatusCheckKey,\n )\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${key}.${statusCheckKey}\\` configuration: key is not allowed.`,\n });\n }\n if (\n !(isString(statusCheckValue) || null === statusCheckValue)\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${statusCheckKey}\\` configuration: status check is not a string.`,\n });\n continue;\n }\n }\n } else if (key === 'statusCheckWhen') {\n const allowedWhenValues = ['always', 'never', 'failed'];\n for (const [\n statusCheckKey,\n statusCheckValue,\n ] of Object.entries(val)) {\n if (\n !allowedStatusCheckStrings.includes(\n statusCheckKey as StatusCheckKey,\n )\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${key}.${statusCheckKey}\\` configuration: key is not allowed.`,\n });\n }\n if (\n !isString(statusCheckValue) ||\n !allowedWhenValues.includes(statusCheckValue)\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${statusCheckKey}\\` configuration: value must be one of \"always\", \"never\", or \"failed\".`,\n });\n continue;\n }\n }\n } else if (key === 'customDatasources') {\n const allowedKeys = [\n 'description',\n 'defaultRegistryUrlTemplate',\n 'format',\n 'transformTemplates',\n ];\n for (const [\n customDatasourceName,\n customDatasourceValue,\n ] of Object.entries(val)) {\n if (!isPlainObject(customDatasourceValue)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${customDatasourceName}\\` configuration: customDatasource is not an object`,\n });\n continue;\n }\n for (const [subKey, subValue] of Object.entries(\n customDatasourceValue,\n )) {\n if (!allowedKeys.includes(subKey)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: key is not allowed`,\n });\n } else if (subKey === 'transformTemplates') {\n if (!isArray(subValue, isString)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of string`,\n });\n }\n } else if (subKey === 'description') {\n if (\n !(isString(subValue) || isArray(subValue, isString))\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of strings`,\n });\n }\n } else if (!isString(subValue)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is a string`,\n });\n }\n }\n }\n } else if (key === 'installTools') {\n for (const toolName of Object.keys(val)) {\n if (!isToolName(toolName)) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${toolName}\\` configuration: not a valid tool name.`,\n });\n }\n }\n } else if (key === 'constraints') {\n const { get: getVersioning } =\n await import('../modules/versioning/index.ts');\n for (const [k, v] of Object.entries(val)) {\n if (!isString(v)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}\\` should be an object of key-value pairs of constraints and their value`,\n });\n break;\n }\n\n if (!isConstraintName(k)) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}\\`: \\`${k}\\` is not a supported constraint name`,\n });\n } else if (isToolName(k)) {\n // TODO: #31831\n const versioningId = getToolConfig(k).versioning;\n const versioning = getVersioning(versioningId);\n if (!versioning.isValid(v)) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}=${v}\\` is not a valid tool version constraint, according to \\`${versioningId}\\` versioning`,\n });\n }\n }\n }\n } else if (key === 'constraintsVersioning') {\n for (const [k, v] of Object.entries(val)) {\n if (!isString(v)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}\\` should be an object of key-value pairs of additional constraint names and their versioning`,\n });\n break;\n }\n\n if (isToolName(k)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}\\` is not a valid additional constraint name, as \\`${k}\\` is a tool name, and \\`constraintsVersioning\\` can only override the versioning for a non-tool constraint`,\n });\n } else if (isConstraintName(k)) {\n const versioningName = v.split(':')[0];\n if (\n !AllVersioningsListLiteral.includes(\n versioningName as VersioningName,\n )\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}=${v}\\`: \\`${v}\\` is not a valid versioning scheme`,\n });\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}\\`: \\`${k}\\` is not a known additional constraint name`,\n });\n }\n }\n } else {\n const ignoredObjects = options\n .filter((option) => option.freeChoice)\n .map((option) => option.name);\n if (!ignoredObjects.includes(key)) {\n const subValidation = await validateConfig(\n configType,\n val,\n isPreset,\n currentPath,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be a json object`,\n });\n }\n } else {\n // v8 ignore next -- intentionally unhandled - if we knew what was to be covered here, we'd add validation\n logger.debug(\n {},\n `Unhandled validation for ${type} at \\`${currentPath}\\``,\n );\n }\n }\n }\n\n if (key === 'hostRules' && isArray(val)) {\n const allowedHeaders =\n configType === 'global'\n ? coerceArray(config.allowedHeaders)\n : GlobalConfig.get('allowedHeaders');\n for (const rule of val as HostRule[]) {\n if (isNonEmptyString(rule.matchHost)) {\n if (\n rule.matchHost.includes('://') &&\n parseUrl(rule.matchHost) === null\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `hostRules matchHost \\`${rule.matchHost}\\` is not a valid URL.`,\n });\n }\n } else if (isEmptyString(rule.matchHost)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message:\n 'Invalid value for hostRules matchHost. It cannot be an empty string.',\n });\n }\n\n if (!rule.headers) {\n continue;\n }\n for (const [header, value] of Object.entries(rule.headers)) {\n if (!isString(value)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid hostRules headers value configuration: header must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(header, allowedHeaders)) {\n errors.push({\n // `Security` is always a fatal error that blocks the rest of the Renovate run.\n //\n // As `hostRules[]` is only applied when it's at the top-level (where `parentPath === undefined`), we should only report a security error there.\n //\n // If it's found to be set to a disallowed value - even if it's not going to be used - we should report as an error, which may block the run, but much less worryingly than Security.\n topic: parentPath\n ? ConfigValidationTopic.Error\n : ConfigValidationTopic.Security,\n message: `hostRules header \\`${header}\\` is not allowed by this Renovate instance's \\`allowedHeaders\\`.`,\n });\n }\n }\n }\n }\n\n if (key === 'matchJsonata' && isArray(val, isString)) {\n for (const expression of val) {\n const res = getExpression(expression);\n if (res instanceof Error) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid JSONata expression for ${currentPath}: ${res.message}`,\n });\n }\n }\n }\n }\n\n function sortAll(a: ValidationMessage, b: ValidationMessage): number {\n if (a.topic === b.topic) {\n return a.message > b.message ? 1 : -1;\n }\n return a.topic > b.topic ? 1 : -1;\n }\n\n errors.sort(sortAll);\n warnings.sort(sortAll);\n return { errors, warnings };\n },\n );\n}\n\n/**\n * Basic validation for global config options\n */\nasync function validateGlobalConfig(\n key: string,\n val: unknown,\n type: string,\n warnings: ValidationMessage[],\n errors: ValidationMessage[],\n currentPath: string | undefined,\n config: AllConfig,\n): Promise<void> {\n /* v8 ignore next -- not testable yet */\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: ConfigValidationTopic.Deprecation,\n message: getDeprecationMessage(key)!,\n });\n }\n\n if (key === 'binarySource' && val === 'docker') {\n warnings.push({\n topic: ConfigValidationTopic.Deprecation,\n message:\n 'Usage of `binarySource=docker` is deprecated, and will be removed in the future. Please migrate to `binarySource=install`. Feedback on the usage of `binarySource=docker` is welcome at https://github.com/renovatebot/renovate/discussions/40742',\n });\n }\n\n if (val !== null) {\n // v8 ignore else -- TODO: add test #40625\n if (type === 'string') {\n if (isString(val)) {\n if (\n key === 'onboardingConfigFileName' &&\n !getPossibleConfigFileNames({\n configFileNames: config.configFileNames,\n platform: config.platform,\n }).includes(val)\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${getPossibleConfigFileNames(\n {\n configFileNames: config.configFileNames,\n platform: config.platform,\n },\n ).join(', ')}.`,\n });\n } else if (\n key === 'repositoryCache' &&\n !['enabled', 'disabled', 'reset'].includes(val)\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['enabled', 'disabled', 'reset'].join(', ')}.`,\n });\n } else if (\n key === 'dryRun' &&\n !['extract', 'lookup', 'full'].includes(val)\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['extract', 'lookup', 'full'].join(', ')}.`,\n });\n } else if (\n key === 'binarySource' &&\n !['docker', 'global', 'install', 'hermit'].includes(val)\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['docker', 'global', 'install', 'hermit'].join(', ')}.`,\n });\n } else if (\n key === 'requireConfig' &&\n !['required', 'optional', 'ignored'].includes(val)\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['required', 'optional', 'ignored'].join(', ')}.`,\n });\n } else if (\n key === 'gitUrl' &&\n !['default', 'ssh', 'endpoint'].includes(val)\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['default', 'ssh', 'endpoint'].join(', ')}.`,\n });\n }\n\n if (\n key === 'reportType' &&\n ['s3', 'file'].includes(val) &&\n !isString(config.reportPath)\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `reportType '${val}' requires a configured reportPath`,\n });\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be a string.`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(...validateNumber(key, val, allowsNegative, currentPath));\n } else if (type === 'boolean') {\n if (val !== true && val !== false) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be a boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val}).`,\n });\n }\n } else if (type === 'array') {\n if (isArray(val) && key !== 'repositories') {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n 'global',\n subval,\n false,\n `${currentPath}[${subIndex}]`,\n );\n warnings.push(...subValidation.warnings);\n errors.push(...subValidation.errors);\n }\n }\n\n if (isRegexOrGlobOption(key)) {\n warnings.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath: currentPath!,\n }),\n );\n }\n if (key === 'gitNoVerify') {\n const allowedValues = ['commit', 'push'];\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n if (key === 'mergeConfidenceDatasources') {\n const allowedValues = supportedDatasources;\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value \\`${value}\\` for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n } else if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isPlainObject(subval)) {\n if (!isNonEmptyString(subval.repository)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}[${subIndex}]: each repository object entry must have a \\`repository\\` string property`,\n });\n }\n const { repository: _, ...repoEntryConfig } = subval;\n // Each repository object entry is validated as its own global config, so it does not automatically see the top-level `allowedEnv`/`allowedHeaders`.\n // Inherit them (unless the entry sets its own) so that entry-level `env`/`headers` are validated against the allowlists, rather than an empty one.\n const subValidation = await validateConfig(\n 'global',\n {\n ...(config.allowedEnv ? { allowedEnv: config.allowedEnv } : {}),\n ...(config.allowedHeaders\n ? { allowedHeaders: config.allowedHeaders }\n : {}),\n ...repoEntryConfig,\n },\n false,\n `${currentPath}[${subIndex}]`,\n );\n warnings.push(...subValidation.warnings);\n errors.push(...subValidation.errors);\n } else if (isString(subval)) {\n if (!isNonEmptyStringAndNotWhitespace(subval)) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}[${subIndex}]: each repository string entry entry must be a non-empty string`,\n });\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}[${subIndex}]: invalid type, should be either a string or an object`,\n });\n }\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be a list (Array).`,\n });\n }\n } else if (type === 'object') {\n if (isPlainObject(val)) {\n if (key === 'onboardingConfig') {\n const subValidation = await validateConfig('repo', val);\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'force') {\n // `force` is validated as a global config of its own, so it does not automatically see the top-level `allowedEnv`/`allowedHeaders`.\n // Inherit them (unless `force` sets its own) so that the self-hosted admin's own `force.env`/`force.hostRules[].headers` are validated against the allowlists they set, rather than an empty one.\n const subValidation = await validateConfig('global', {\n ...(config.allowedEnv ? { allowedEnv: config.allowedEnv } : {}),\n ...(config.allowedHeaders\n ? { allowedHeaders: config.allowedHeaders }\n : {}),\n ...val,\n });\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'cacheTtlOverride') {\n for (const [subKey, subValue] of Object.entries(val)) {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(\n ...validateNumber(\n key,\n subValue,\n allowsNegative,\n currentPath,\n subKey,\n ),\n );\n\n if (\n !(packageCacheNamespaces as readonly string[]).includes(subKey) &&\n !anyMatchRegexOrGlobList(\n packageCacheNamespaces as unknown as string[],\n [subKey],\n )\n ) {\n errors.push({\n message: `${currentPath}: namespace \\`${subKey}\\` does not exist`,\n topic: ConfigValidationTopic.Error,\n });\n }\n }\n } else {\n const res = validatePlainObject(val);\n if (res !== true) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${res}\\` configuration: value must be a string.`,\n });\n }\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be a JSON object.`,\n });\n }\n }\n }\n}\n\nfunction getPossibleConfigFileNames({\n configFileNames,\n platform,\n}: {\n configFileNames?: string[];\n platform?: PlatformId;\n}): string[] {\n const filenames = getConfigFileNames(platform);\n if (isNonEmptyArray(configFileNames)) {\n return filenames.concat(configFileNames);\n }\n\n return filenames;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAM,UAAU,WAAW;AAE3B,IAAI,qBAAqB;AACzB,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AAEJ,MAAM,cAAiC;A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AAgB,eAAe,GACjC,OAAO,UAAU,OAAO,eAAe;CAGzC,OAAO;AACT"}
1
+ {"version":3,"file":"validation.js","names":["regexOrGlobValidator.check","matchBaseBranchesValidator.check"],"sources":["../../lib/config/validation.ts"],"sourcesContent":["import is, {\n isArray,\n isEmptyString,\n isNonEmptyArray,\n isNonEmptyString,\n isNonEmptyStringAndNotWhitespace,\n isObject,\n isPlainObject,\n isString,\n isUndefined,\n} from '@sindresorhus/is';\nimport type { PlatformId } from '../constants/index.ts';\nimport { instrument } from '../instrumentation/index.ts';\nimport { logger } from '../logger/index.ts';\nimport {\n AllManagersListLiteral,\n CustomManagersListLiteral,\n} from '../manager-list.generated.ts';\nimport { isCustomManager } from '../modules/manager/custom/index.ts';\nimport type { CustomManager } from '../modules/manager/custom/types.ts';\nimport type { HostRule } from '../types/index.ts';\nimport { coerceArray } from '../util/array.ts';\nimport { packageCacheNamespaces } from '../util/cache/package/namespaces.ts';\nimport { clone } from '../util/clone.ts';\nimport { getToolConfig } from '../util/exec/containerbase.ts';\nimport { isConstraintName, isToolName } from '../util/exec/types.ts';\nimport { isValidCommitTrailer } from '../util/git/commit-trailers.ts';\nimport { getExpression } from '../util/jsonata.ts';\nimport { regEx } from '../util/regex.ts';\nimport {\n anyMatchRegexOrGlobList,\n getRegexPredicate,\n isRegexMatch,\n matchRegexOrGlobList,\n} from '../util/string-match.ts';\nimport * as template from '../util/template/index.ts';\nimport { parseUrl } from '../util/url.ts';\nimport {\n AllVersioningsListLiteral,\n type VersioningName,\n} from '../versioning-list.generated.ts';\nimport {\n hasValidSchedule,\n hasValidTimezone,\n} from '../workers/repository/update/branch/schedule.ts';\nimport { getConfigFileNames } from './app-strings.ts';\nimport { GlobalConfig } from './global.ts';\nimport { migrateConfig } from './migration.ts';\nimport { getOptions } from './options/index.ts';\nimport { resolveConfigPresets } from './presets/index.ts';\nimport { supportedDatasources } from './presets/internal/merge-confidence.preset.ts';\nimport { isRelativePresetReference, parsePreset } from './presets/parse.ts';\nimport type {\n AllConfig,\n AllowedParents,\n RenovateConfig,\n RenovateOptions,\n StatusCheckKey,\n ValidationMessage,\n ValidationResult,\n} from './types.ts';\nimport { allowedStatusCheckStrings } from './types.ts';\nimport * as matchBaseBranchesValidator from './validation-helpers/match-base-branches.ts';\nimport * as regexOrGlobValidator from './validation-helpers/regex-glob-matchers.ts';\nimport { ConfigValidationTopic } from './validation-helpers/types.ts';\nimport {\n getParentName,\n isFalseGlobal,\n validateJSONataManagerFields,\n validateNumber,\n validatePlainObject,\n validateRegexManagerFields,\n} from './validation-helpers/utils.ts';\n\nconst options = getOptions();\n\nlet optionsInitialized = false;\nlet optionTypes: Record<string, RenovateOptions['type']>;\nlet optionParents: Record<string, AllowedParents[]>;\nlet optionGlobals: Set<string>;\nlet optionInherits: Set<string>;\nlet optionRegexOrGlob: Set<string>;\nlet optionAllowsNegativeIntegers: Set<string>;\nlet optionSupportsTemplating: Set<string>;\n\nconst managerList: readonly string[] = AllManagersListLiteral;\n\nconst allManagersList: readonly string[] = [\n ...AllManagersListLiteral,\n ...CustomManagersListLiteral,\n];\n\nconst topLevelObjects = [...managerList, 'env'];\n\nconst ignoredNodes = [\n '$schema',\n 'headers',\n 'depType',\n 'npmToken',\n 'packageFile',\n 'forkToken',\n 'repository',\n 'vulnerabilityAlertsOnly',\n 'vulnerabilityAlert',\n 'isVulnerabilityAlert',\n 'vulnerabilityFixVersion', // not intended to be used by end users but may be by Mend apps\n 'copyLocalLibs', // deprecated - functionality is now enabled by default\n 'prBody', // deprecated\n 'minimumConfidence', // undocumented feature flag\n];\nconst tzRe = regEx(/^:timezone\\((?<timezone>.+)\\)$/);\nconst rulesRe = regEx(/p.*Rules\\[\\d+\\]$/);\nconst repoEntryRe = regEx(/^repositories\\[\\d+\\]$/);\n\nfunction isIgnored(key: string): boolean {\n return ignoredNodes.includes(key);\n}\n\nfunction getUnsupportedEnabledManagers(enabledManagers: string[]): string[] {\n return enabledManagers.filter(\n (manager) => !allManagersList.includes(manager.replace('custom.', '')),\n );\n}\n\nfunction getDeprecationMessage(option: string): string | undefined {\n const deprecatedOptions: Record<string, string | undefined> = {\n branchName: `Direct editing of branchName is now deprecated. Please edit branchPrefix, additionalBranchPrefix, or branchTopic instead`,\n commitMessage: `Direct editing of commitMessage is now deprecated. Please edit commitMessage's subcomponents instead.`,\n prTitle: `Direct editing of prTitle is now deprecated. Please edit commitMessage subcomponents instead as they will be passed through to prTitle.`,\n };\n if (deprecatedOptions[option]) {\n return deprecatedOptions[option];\n }\n\n const found = options.find((o) => o.name === option);\n if (!found) {\n return undefined;\n }\n\n if (!found.deprecationMsg) {\n return undefined;\n }\n\n return `The '${option}' option is deprecated: ${found.deprecationMsg}`;\n}\n\nfunction isInhertConfigOption(key: string): boolean {\n return optionInherits.has(key);\n}\n\nfunction isRegexOrGlobOption(key: string): boolean {\n return optionRegexOrGlob.has(key);\n}\n\nfunction isGlobalOption(key: string): boolean {\n return optionGlobals.has(key);\n}\n\nfunction initOptions(): void {\n if (optionsInitialized) {\n return;\n }\n\n optionParents = {};\n optionInherits = new Set();\n optionTypes = {};\n optionRegexOrGlob = new Set();\n optionGlobals = new Set();\n optionAllowsNegativeIntegers = new Set();\n optionSupportsTemplating = new Set();\n\n for (const option of options) {\n optionTypes[option.name] = option.type;\n\n if (option.parents) {\n optionParents[option.name] = option.parents;\n }\n\n if (option.inheritConfigSupport) {\n optionInherits.add(option.name);\n }\n\n if (option.patternMatch) {\n optionRegexOrGlob.add(option.name);\n }\n\n if (option.globalOnly) {\n optionGlobals.add(option.name);\n }\n\n if (option.allowNegative) {\n optionAllowsNegativeIntegers.add(option.name);\n }\n\n if (option.supportsTemplating) {\n optionSupportsTemplating.add(option.name);\n }\n }\n\n optionsInitialized = true;\n}\n\n/**\n * Removes every relative preset reference from a deep copy of the given\n * `packageRules` entry, at any nesting depth.\n *\n * Relative references are only resolvable while the preset which contains them\n * is fetched, so they must not be passed to `resolveConfigPresets()` during\n * validation. They are still syntax checked by the `extends` validation.\n */\nfunction stripRelativePresets(packageRule: RenovateConfig): {\n rule: RenovateConfig;\n hasRelativePresets: boolean;\n} {\n const rule = clone(packageRule);\n const hasRelativePresets = stripRelativePresetsFromValue(rule);\n return { rule, hasRelativePresets };\n}\n\nfunction stripRelativePresetsFromValue(value: unknown): boolean {\n if (isArray(value)) {\n let stripped = false;\n for (const element of value) {\n stripped = stripRelativePresetsFromValue(element) || stripped;\n }\n return stripped;\n }\n\n if (!isPlainObject(value)) {\n return false;\n }\n\n let stripped = false;\n for (const [key, val] of Object.entries(value)) {\n if (key === 'extends' && isArray(val)) {\n const remaining = val.filter(\n (preset) => !(isString(preset) && isRelativePresetReference(preset)),\n );\n if (remaining.length !== val.length) {\n value[key] = remaining;\n stripped = true;\n }\n continue;\n }\n\n stripped = stripRelativePresetsFromValue(val) || stripped;\n }\n return stripped;\n}\n\nexport async function validateConfig(\n configType: 'global' | 'inherit' | 'repo',\n config: AllConfig,\n isPreset?: boolean,\n parentPath?: string,\n): Promise<ValidationResult> {\n return instrument(\n `validateConfig(${configType}, ${JSON.stringify(parentPath)})`,\n async () => {\n initOptions();\n\n let errors: ValidationMessage[] = [];\n let warnings: ValidationMessage[] = [];\n\n for (const [key, val] of Object.entries(config)) {\n const currentPath = parentPath ? `${parentPath}.${key}` : key;\n /* v8 ignore next -- TODO: add test */\n if (key === '__proto__') {\n errors.push({\n topic: ConfigValidationTopic.Security,\n message: '__proto__',\n });\n continue;\n }\n if (\n parentPath &&\n parentPath !== 'onboardingConfig' &&\n !repoEntryRe.test(parentPath) &&\n topLevelObjects.includes(key)\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `The \"${key}\" object can only be configured at the top level of a config but was found inside \"${parentPath}\"`,\n });\n }\n\n if (isGlobalOption(key)) {\n if (configType === 'global') {\n await validateGlobalConfig(\n key,\n val,\n optionTypes[key],\n warnings,\n errors,\n currentPath,\n config,\n );\n continue;\n } else if (\n !isFalseGlobal(key, parentPath) &&\n !(configType === 'inherit' && isInhertConfigOption(key))\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `The \"${key}\" option is a global option reserved only for Renovate's global configuration and cannot be configured within a repository's config file.`,\n });\n continue;\n }\n }\n if (key === 'enabledManagers' && val) {\n const unsupportedManagers = getUnsupportedEnabledManagers(\n val as string[],\n );\n if (isNonEmptyArray(unsupportedManagers)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `The following managers configured in enabledManagers are not supported: \"${unsupportedManagers.join(\n ', ',\n )}\"`,\n });\n }\n }\n if (key === 'registryUrls' && !parentPath && isNonEmptyArray(val)) {\n warnings.push({\n topic: ConfigValidationTopic.Warning,\n message:\n 'Setting `registryUrls` at the top level of your config will apply it to all managers and datasources, which can cause the wrong registry URL to be used for some packages. Use `registryUrls` inside `packageRules` to target specific managers or packages.',\n });\n }\n if (\n key === 'defaultRegistryUrls' &&\n !parentPath &&\n isNonEmptyArray(val)\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Warning,\n message:\n 'Setting `defaultRegistryUrls` at the top level of your config will apply it to all managers and datasources, which can cause the wrong registry URL to be used for some packages. Use `defaultRegistryUrls` inside `packageRules` to target specific managers or packages.',\n });\n }\n if (\n !isIgnored(key) && // We need to ignore some reserved keys\n !(is as any).function(val) // Ignore all functions\n ) {\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: ConfigValidationTopic.Deprecation,\n message: getDeprecationMessage(key)!,\n });\n }\n if (optionSupportsTemplating.has(key) && val) {\n try {\n // TODO: types (#22198)\n template.validate((val as string).toString());\n } catch {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid template in config path: ${currentPath}`,\n });\n }\n }\n const parentName =\n parentPath && repoEntryRe.test(parentPath)\n ? '.'\n : getParentName(parentPath);\n if (\n !isPreset &&\n optionParents[key] &&\n !optionParents[key].includes(parentName as AllowedParents)\n ) {\n // TODO: types (#22198)\n const options = optionParents[key]?.toSorted().join(', ');\n const message = `\"${key}\" can't be used in \"${parentName}\". Allowed objects: ${options}.`;\n warnings.push({\n topic: `${parentPath ? `${parentPath}.` : ''}${key}`,\n message,\n });\n }\n\n // v8 ignore else -- intentionally unhandled - if we knew what was to be covered here, we'd add validation\n if (!optionTypes[key]) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid configuration option: ${currentPath}`,\n });\n } else if (key === 'schedule') {\n const [validSchedule, errorMessage] = hasValidSchedule(\n val as string[],\n );\n if (!validSchedule) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid ${currentPath}: \\`${errorMessage}\\``,\n });\n }\n } else if (\n [\n 'allowedVersions',\n 'matchCurrentVersion',\n 'matchCurrentValue',\n 'matchNewValue',\n ].includes(key) &&\n isRegexMatch(val)\n ) {\n if (!getRegexPredicate(val)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid regExp for ${currentPath}: \\`${val}\\``,\n });\n }\n } else if (key === 'timezone' && val !== null) {\n const [validTimezone, errorMessage] = hasValidTimezone(\n val as string,\n );\n if (!validTimezone) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n } else if (val !== null) {\n const type = optionTypes[key];\n if (type === 'boolean') {\n if (val !== true && val !== false) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val})`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n errors.push(\n ...validateNumber(key, val, allowsNegative, currentPath),\n );\n } else if (type === 'array' && val) {\n if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n configType,\n subval,\n isPreset,\n `${currentPath}[${subIndex}]`,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n if (isRegexOrGlobOption(key)) {\n errors.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath,\n }),\n );\n }\n if (key === 'extends') {\n for (const subval of val) {\n if (isString(subval)) {\n if (\n configType !== 'global' &&\n subval.startsWith('global:')\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: you cannot extend from \"global:\" presets in a repository config's \"extends\"`,\n });\n }\n\n if (\n parentName === 'packageRules' &&\n subval.startsWith('group:')\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Warning,\n message: `${currentPath}: you should not extend \"group:\" presets`,\n });\n }\n if (tzRe.test(subval)) {\n const [, timezone] = tzRe.exec(subval)!;\n const [validTimezone, errorMessage] =\n hasValidTimezone(timezone);\n if (!validTimezone) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: ${errorMessage}`,\n });\n }\n }\n if (!subval.includes('{{')) {\n try {\n parsePreset(subval);\n } catch {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: preset \"${subval}\" is not valid`,\n });\n }\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: preset value is not a string`,\n });\n }\n }\n }\n\n if (key === 'commitTrailers') {\n for (const subval of val) {\n if (!isValidCommitTrailer(subval)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid commit trailer: \\`${JSON.stringify(\n subval,\n )}\\`. Must be a single-line string in the form \\`Key: value\\`, where the key contains only letters, digits and \\`-\\`.`,\n });\n }\n }\n }\n\n const selectors = [\n 'matchFileNames',\n 'matchLanguages',\n 'matchCategories',\n 'matchBaseBranches',\n 'matchManagers',\n 'matchDatasources',\n 'matchDepTypes',\n 'matchDepNames',\n 'matchPackageNames',\n 'matchCurrentValue',\n 'matchCurrentVersion',\n 'matchSourceUrls',\n 'matchRegistryUrls',\n 'matchUpdateTypes',\n 'matchConfidence',\n 'matchCurrentAge',\n 'matchRepositories',\n 'matchNewValue',\n 'matchJsonata',\n ];\n if (key === 'packageRules') {\n for (const [subIndex, packageRule] of val.entries()) {\n if (isObject(packageRule)) {\n const { rule, hasRelativePresets } =\n stripRelativePresets(packageRule);\n const { config: resolved } = await resolveConfigPresets(\n rule,\n config,\n );\n const resolvedRule = migrateConfig({\n packageRules: [resolved],\n }).migratedConfig.packageRules![0];\n warnings.push(\n ...matchBaseBranchesValidator.check({\n resolvedRule,\n currentPath: `${currentPath}[${subIndex}]`,\n baseBranchPatterns: config.baseBranchPatterns!,\n }),\n );\n const selectorLength = Object.keys(resolvedRule).filter(\n (ruleKey) => selectors.includes(ruleKey),\n ).length;\n if (!selectorLength) {\n if (hasRelativePresets) {\n // the stripped relative preset may still provide the\n // missing selectors, so this cannot be an error\n const message = `${currentPath}[${subIndex}]: this rule extends a relative preset that cannot be resolved during validation, so its selectors could not be checked. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message,\n });\n } else {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one match* or exclude* selector. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: ConfigValidationTopic.Error,\n message,\n });\n }\n }\n if (\n // the stripped relative preset legitimately provides\n // the non-selector field\n !hasRelativePresets &&\n selectorLength === Object.keys(resolvedRule).length\n ) {\n const message = `${currentPath}[${subIndex}]: Each packageRule must contain at least one non-match* or non-exclude* field. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message,\n });\n }\n // It's too late to apply any of these options once you already have updates determined\n const preLookupOptions = [\n 'allowedVersions',\n 'extractVersion',\n 'followTag',\n 'ignoreDeps',\n 'ignoreUnstable',\n 'rangeStrategy',\n 'registryUrls',\n 'respectLatest',\n 'rollbackPrs',\n 'separateMajorMinor',\n 'separateMinorPatch',\n 'separateMultipleMajor',\n 'separateMultipleMinor',\n 'versioning',\n ] as const;\n if (isNonEmptyArray(resolvedRule.matchUpdateTypes)) {\n for (const option of preLookupOptions) {\n if (resolvedRule[option] !== undefined) {\n const message = `${currentPath}[${subIndex}]: packageRules cannot combine both matchUpdateTypes and ${option}. Rule: ${JSON.stringify(\n packageRule,\n )}`;\n errors.push({\n topic: ConfigValidationTopic.Error,\n message,\n });\n }\n }\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath} must contain JSON objects`,\n });\n }\n }\n }\n if (key === 'customManagers') {\n const allowedKeys = [\n 'customType',\n 'description',\n 'fileFormat',\n 'managerFilePatterns',\n 'matchStrings',\n 'matchStringsStrategy',\n 'depNameTemplate',\n 'packageNameTemplate',\n 'datasourceTemplate',\n 'versioningTemplate',\n 'registryUrlTemplate',\n 'currentValueTemplate',\n 'extractVersionTemplate',\n 'autoReplaceStringTemplate',\n 'depTypeTemplate',\n ];\n for (const customManager of val as CustomManager[]) {\n if (\n Object.keys(customManager).some(\n (k) => !allowedKeys.includes(k),\n )\n ) {\n const disallowedKeys = Object.keys(customManager).filter(\n (k) => !allowedKeys.includes(k),\n );\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Custom Manager contains disallowed fields: ${disallowedKeys.join(\n ', ',\n )}`,\n });\n } else if (\n isNonEmptyString(customManager.customType) &&\n isCustomManager(customManager.customType)\n ) {\n if (isNonEmptyArray(customManager.managerFilePatterns)) {\n switch (customManager.customType) {\n case 'regex':\n validateRegexManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n case 'jsonata':\n validateJSONataManagerFields(\n customManager,\n currentPath,\n errors,\n );\n break;\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Each Custom Manager must contain a non-empty managerFilePatterns array`,\n });\n }\n } else {\n if (\n isEmptyString(customManager.customType) ||\n isUndefined(customManager.customType)\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Each Custom Manager must contain a non-empty customType string`,\n });\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid customType: ${customManager.customType}. Key is not a custom manager`,\n });\n }\n }\n }\n }\n if (['matchPackageNames', 'matchDepNames'].includes(key)) {\n const startPattern = regEx(/!?\\//);\n const endPattern = regEx(/\\/g?i?$/);\n for (const pattern of val as string[]) {\n if (\n startPattern.test(pattern) &&\n endPattern.test(pattern)\n ) {\n try {\n // regEx isn't aware of our !/ prefix but can handle the suffix\n regEx(pattern.replace(startPattern, '/'));\n } catch {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid regExp for ${currentPath}: \\`${pattern}\\``,\n });\n }\n }\n }\n }\n if (key === 'baseBranchPatterns') {\n for (const baseBranchPattern of val as string[]) {\n if (\n isRegexMatch(baseBranchPattern) &&\n !getRegexPredicate(baseBranchPattern)\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid regExp for ${currentPath}: \\`${baseBranchPattern}\\``,\n });\n }\n }\n }\n if (\n (selectors.includes(key) ||\n key === 'matchCurrentVersion' ||\n key === 'matchCurrentValue') &&\n // TODO: can be undefined ? #22198\n !rulesRe.test(parentPath!) && // Inside a packageRule\n (isString(parentPath) || !isPreset) // top level in a preset\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: ${key} should be inside a \\`packageRule\\` only`,\n });\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be a list (Array)`,\n });\n }\n } else if (type === 'string') {\n if (!isString(val)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be a string`,\n });\n }\n } else if (type === 'object') {\n if (isPlainObject(val)) {\n if (key === 'registryAliases') {\n const res = validatePlainObject(val);\n if (res !== true) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${key}.${res}\\` configuration: value is not a string`,\n });\n }\n } else if (key === 'env') {\n const allowedEnvVars =\n configType === 'global'\n ? coerceArray(config.allowedEnv)\n : GlobalConfig.get('allowedEnv');\n for (const [envVarName, envVarValue] of Object.entries(val)) {\n if (!isString(envVarValue)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid env variable value: \\`${currentPath}.${envVarName}\\` must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(envVarName, allowedEnvVars)) {\n errors.push({\n // `Security` is always a fatal error that blocks the rest of the Renovate run.\n //\n // As `env` is only applied when it's at the top-level (where `parentPath === undefined`), we should only report a security error there.\n //\n // If it's found to be set to a disallowed value - even if it's not going to be used - we should report as an error, which may block the run, but much less worryingly than Security.\n topic: parentPath\n ? ConfigValidationTopic.Error\n : ConfigValidationTopic.Security,\n message: `Env variable name \\`${envVarName}\\` is not allowed by this Renovate instance's \\`allowedEnv\\`.`,\n });\n }\n }\n } else if (key === 'statusCheckNames') {\n for (const [\n statusCheckKey,\n statusCheckValue,\n ] of Object.entries(val)) {\n if (\n !allowedStatusCheckStrings.includes(\n statusCheckKey as StatusCheckKey,\n )\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${key}.${statusCheckKey}\\` configuration: key is not allowed.`,\n });\n }\n if (\n !(isString(statusCheckValue) || null === statusCheckValue)\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${statusCheckKey}\\` configuration: status check is not a string.`,\n });\n continue;\n }\n }\n } else if (key === 'statusCheckWhen') {\n const allowedWhenValues = ['always', 'never', 'failed'];\n for (const [\n statusCheckKey,\n statusCheckValue,\n ] of Object.entries(val)) {\n if (\n !allowedStatusCheckStrings.includes(\n statusCheckKey as StatusCheckKey,\n )\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${key}.${statusCheckKey}\\` configuration: key is not allowed.`,\n });\n }\n if (\n !isString(statusCheckValue) ||\n !allowedWhenValues.includes(statusCheckValue)\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${statusCheckKey}\\` configuration: value must be one of \"always\", \"never\", or \"failed\".`,\n });\n continue;\n }\n }\n } else if (key === 'customDatasources') {\n const allowedKeys = [\n 'description',\n 'defaultRegistryUrlTemplate',\n 'format',\n 'transformTemplates',\n ];\n for (const [\n customDatasourceName,\n customDatasourceValue,\n ] of Object.entries(val)) {\n if (!isPlainObject(customDatasourceValue)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${customDatasourceName}\\` configuration: customDatasource is not an object`,\n });\n continue;\n }\n for (const [subKey, subValue] of Object.entries(\n customDatasourceValue,\n )) {\n if (!allowedKeys.includes(subKey)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: key is not allowed`,\n });\n } else if (subKey === 'transformTemplates') {\n if (!isArray(subValue, isString)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of string`,\n });\n }\n } else if (subKey === 'description') {\n if (\n !(isString(subValue) || isArray(subValue, isString))\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is not an array of strings`,\n });\n }\n } else if (!isString(subValue)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${subKey}\\` configuration: is a string`,\n });\n }\n }\n }\n } else if (key === 'installTools') {\n for (const toolName of Object.keys(val)) {\n if (!isToolName(toolName)) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${toolName}\\` configuration: not a valid tool name.`,\n });\n }\n }\n } else if (key === 'constraints') {\n const { get: getVersioning } =\n await import('../modules/versioning/index.ts');\n for (const [k, v] of Object.entries(val)) {\n if (!isString(v)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}\\` should be an object of key-value pairs of constraints and their value`,\n });\n break;\n }\n\n if (!isConstraintName(k)) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}\\`: \\`${k}\\` is not a supported constraint name`,\n });\n } else if (isToolName(k)) {\n // TODO: #31831\n const versioningId = getToolConfig(k).versioning;\n const versioning = getVersioning(versioningId);\n if (!versioning.isValid(v)) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}=${v}\\` is not a valid tool version constraint, according to \\`${versioningId}\\` versioning`,\n });\n }\n }\n }\n } else if (key === 'constraintsVersioning') {\n for (const [k, v] of Object.entries(val)) {\n if (!isString(v)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}\\` should be an object of key-value pairs of additional constraint names and their versioning`,\n });\n break;\n }\n\n if (isToolName(k)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}\\` is not a valid additional constraint name, as \\`${k}\\` is a tool name, and \\`constraintsVersioning\\` can only override the versioning for a non-tool constraint`,\n });\n } else if (isConstraintName(k)) {\n const versioningName = v.split(':')[0];\n if (\n !AllVersioningsListLiteral.includes(\n versioningName as VersioningName,\n )\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}=${v}\\`: \\`${v}\\` is not a valid versioning scheme`,\n });\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}.${k}\\`: \\`${k}\\` is not a known additional constraint name`,\n });\n }\n }\n } else {\n const ignoredObjects = options\n .filter((option) => option.freeChoice)\n .map((option) => option.name);\n if (!ignoredObjects.includes(key)) {\n const subValidation = await validateConfig(\n configType,\n val,\n isPreset,\n currentPath,\n );\n warnings = warnings.concat(subValidation.warnings);\n errors = errors.concat(subValidation.errors);\n }\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be a json object`,\n });\n }\n } else {\n // v8 ignore next -- intentionally unhandled - if we knew what was to be covered here, we'd add validation\n logger.debug(\n {},\n `Unhandled validation for ${type} at \\`${currentPath}\\``,\n );\n }\n }\n }\n\n if (key === 'hostRules' && isArray(val)) {\n const allowedHeaders =\n configType === 'global'\n ? coerceArray(config.allowedHeaders)\n : GlobalConfig.get('allowedHeaders');\n for (const rule of val as HostRule[]) {\n if (isNonEmptyString(rule.matchHost)) {\n if (\n rule.matchHost.includes('://') &&\n parseUrl(rule.matchHost) === null\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `hostRules matchHost \\`${rule.matchHost}\\` is not a valid URL.`,\n });\n }\n } else if (isEmptyString(rule.matchHost)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message:\n 'Invalid value for hostRules matchHost. It cannot be an empty string.',\n });\n }\n\n if (!rule.headers) {\n continue;\n }\n for (const [header, value] of Object.entries(rule.headers)) {\n if (!isString(value)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid hostRules headers value configuration: header must be a string.`,\n });\n }\n if (!matchRegexOrGlobList(header, allowedHeaders)) {\n errors.push({\n // `Security` is always a fatal error that blocks the rest of the Renovate run.\n //\n // As `hostRules[]` is only applied when it's at the top-level (where `parentPath === undefined`), we should only report a security error there.\n //\n // If it's found to be set to a disallowed value - even if it's not going to be used - we should report as an error, which may block the run, but much less worryingly than Security.\n topic: parentPath\n ? ConfigValidationTopic.Error\n : ConfigValidationTopic.Security,\n message: `hostRules header \\`${header}\\` is not allowed by this Renovate instance's \\`allowedHeaders\\`.`,\n });\n }\n }\n }\n }\n\n if (key === 'matchJsonata' && isArray(val, isString)) {\n for (const expression of val) {\n const res = getExpression(expression);\n if (res instanceof Error) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid JSONata expression for ${currentPath}: ${res.message}`,\n });\n }\n }\n }\n }\n\n function sortAll(a: ValidationMessage, b: ValidationMessage): number {\n if (a.topic === b.topic) {\n return a.message > b.message ? 1 : -1;\n }\n return a.topic > b.topic ? 1 : -1;\n }\n\n errors.sort(sortAll);\n warnings.sort(sortAll);\n return { errors, warnings };\n },\n );\n}\n\n/**\n * Basic validation for global config options\n */\nasync function validateGlobalConfig(\n key: string,\n val: unknown,\n type: string,\n warnings: ValidationMessage[],\n errors: ValidationMessage[],\n currentPath: string | undefined,\n config: AllConfig,\n): Promise<void> {\n /* v8 ignore next -- not testable yet */\n if (getDeprecationMessage(key)) {\n warnings.push({\n topic: ConfigValidationTopic.Deprecation,\n message: getDeprecationMessage(key)!,\n });\n }\n\n if (key === 'binarySource' && val === 'docker') {\n warnings.push({\n topic: ConfigValidationTopic.Deprecation,\n message:\n 'Usage of `binarySource=docker` is deprecated, and will be removed in the future. Please migrate to `binarySource=install`. Feedback on the usage of `binarySource=docker` is welcome at https://github.com/renovatebot/renovate/discussions/40742',\n });\n }\n\n if (val !== null) {\n // v8 ignore else -- TODO: add test #40625\n if (type === 'string') {\n if (isString(val)) {\n if (\n key === 'onboardingConfigFileName' &&\n !getPossibleConfigFileNames({\n configFileNames: config.configFileNames,\n platform: config.platform,\n }).includes(val)\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${getPossibleConfigFileNames(\n {\n configFileNames: config.configFileNames,\n platform: config.platform,\n },\n ).join(', ')}.`,\n });\n } else if (\n key === 'repositoryCache' &&\n !['enabled', 'disabled', 'reset'].includes(val)\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['enabled', 'disabled', 'reset'].join(', ')}.`,\n });\n } else if (\n key === 'dryRun' &&\n !['extract', 'lookup', 'full'].includes(val)\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['extract', 'lookup', 'full'].join(', ')}.`,\n });\n } else if (\n key === 'binarySource' &&\n !['docker', 'global', 'install', 'hermit'].includes(val)\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['docker', 'global', 'install', 'hermit'].join(', ')}.`,\n });\n } else if (\n key === 'requireConfig' &&\n !['required', 'optional', 'ignored'].includes(val)\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['required', 'optional', 'ignored'].join(', ')}.`,\n });\n } else if (\n key === 'gitUrl' &&\n !['default', 'ssh', 'endpoint'].includes(val)\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value \\`${val}\\` for \\`${currentPath}\\`. The allowed values are ${['default', 'ssh', 'endpoint'].join(', ')}.`,\n });\n }\n\n if (\n key === 'reportType' &&\n ['s3', 'file'].includes(val) &&\n !isString(config.reportPath)\n ) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `reportType '${val}' requires a configured reportPath`,\n });\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be a string.`,\n });\n }\n } else if (type === 'integer') {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(...validateNumber(key, val, allowsNegative, currentPath));\n } else if (type === 'boolean') {\n if (val !== true && val !== false) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be a boolean. Found: ${JSON.stringify(\n val,\n )} (${typeof val}).`,\n });\n }\n } else if (type === 'array') {\n if (isArray(val) && key !== 'repositories') {\n for (const [subIndex, subval] of val.entries()) {\n if (isObject(subval)) {\n const subValidation = await validateConfig(\n 'global',\n subval,\n false,\n `${currentPath}[${subIndex}]`,\n );\n warnings.push(...subValidation.warnings);\n errors.push(...subValidation.errors);\n }\n }\n\n if (isRegexOrGlobOption(key)) {\n warnings.push(\n ...regexOrGlobValidator.check({\n val,\n currentPath: currentPath!,\n }),\n );\n }\n if (key === 'gitNoVerify') {\n const allowedValues = ['commit', 'push'];\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n if (key === 'mergeConfidenceDatasources') {\n const allowedValues = supportedDatasources;\n for (const value of val as string[]) {\n // v8 ignore else -- TODO: add test #40625\n if (!allowedValues.includes(value)) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid value \\`${value}\\` for \\`${currentPath}\\`. The allowed values are ${allowedValues.join(', ')}.`,\n });\n }\n }\n }\n } else if (isArray(val)) {\n for (const [subIndex, subval] of val.entries()) {\n if (isPlainObject(subval)) {\n if (!isNonEmptyString(subval.repository)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}[${subIndex}]: each repository object entry must have a \\`repository\\` string property`,\n });\n }\n const { repository: _, ...repoEntryConfig } = subval;\n // Each repository object entry is validated as its own global config, so it does not automatically see the top-level `allowedEnv`/`allowedHeaders`.\n // Inherit them (unless the entry sets its own) so that entry-level `env`/`headers` are validated against the allowlists, rather than an empty one.\n const subValidation = await validateConfig(\n 'global',\n {\n ...(config.allowedEnv ? { allowedEnv: config.allowedEnv } : {}),\n ...(config.allowedHeaders\n ? { allowedHeaders: config.allowedHeaders }\n : {}),\n ...repoEntryConfig,\n },\n false,\n `${currentPath}[${subIndex}]`,\n );\n warnings.push(...subValidation.warnings);\n errors.push(...subValidation.errors);\n } else if (isString(subval)) {\n if (!isNonEmptyStringAndNotWhitespace(subval)) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}[${subIndex}]: each repository string entry entry must be a non-empty string`,\n });\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}[${subIndex}]: invalid type, should be either a string or an object`,\n });\n }\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be a list (Array).`,\n });\n }\n } else if (type === 'object') {\n if (isPlainObject(val)) {\n if (key === 'onboardingConfig') {\n const subValidation = await validateConfig('repo', val);\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'force') {\n // `force` is validated as a global config of its own, so it does not automatically see the top-level `allowedEnv`/`allowedHeaders`.\n // Inherit them (unless `force` sets its own) so that the self-hosted admin's own `force.env`/`force.hostRules[].headers` are validated against the allowlists they set, rather than an empty one.\n const subValidation = await validateConfig('global', {\n ...(config.allowedEnv ? { allowedEnv: config.allowedEnv } : {}),\n ...(config.allowedHeaders\n ? { allowedHeaders: config.allowedHeaders }\n : {}),\n ...val,\n });\n for (const warning of subValidation.warnings.concat(\n subValidation.errors,\n )) {\n warnings.push(warning);\n }\n } else if (key === 'cacheTtlOverride') {\n for (const [subKey, subValue] of Object.entries(val)) {\n const allowsNegative = optionAllowsNegativeIntegers.has(key);\n warnings.push(\n ...validateNumber(\n key,\n subValue,\n allowsNegative,\n currentPath,\n subKey,\n ),\n );\n\n if (\n !(packageCacheNamespaces as readonly string[]).includes(subKey) &&\n !anyMatchRegexOrGlobList(\n packageCacheNamespaces as unknown as string[],\n [subKey],\n )\n ) {\n errors.push({\n message: `${currentPath}: namespace \\`${subKey}\\` does not exist`,\n topic: ConfigValidationTopic.Error,\n });\n }\n }\n } else {\n const res = validatePlainObject(val);\n if (res !== true) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid \\`${currentPath}.${res}\\` configuration: value must be a string.`,\n });\n }\n }\n } else {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${currentPath}\\` should be a JSON object.`,\n });\n }\n }\n }\n}\n\nfunction getPossibleConfigFileNames({\n configFileNames,\n platform,\n}: {\n configFileNames?: string[];\n platform?: PlatformId;\n}): string[] {\n const filenames = getConfigFileNames(platform);\n if (isNonEmptyArray(configFileNames)) {\n return filenames.concat(configFileNames);\n }\n\n return filenames;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAM,UAAU,WAAW;AAE3B,IAAI,qBAAqB;AACzB,IAAI;AAC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AACF;AAEA,SAAS,2BAA2B,EAClC,iBACA,YAIW;CACX,MAAM,YAAY,mBAAmB,QAAQ;CAC7C,IAAI,gBAAgB,eAAe,GACjC,OAAO,UAAU,OAAO,eAAe;CAGzC,OAAO;AACT"}
@@ -127,11 +127,11 @@ function sanitizeValue(value, seen = /* @__PURE__ */ new WeakMap()) {
127
127
  }
128
128
  const urlRe = regEx(/[a-z]{3,9}:\/\/[^@/]+@[a-z0-9.-]+/gi);
129
129
  const urlCredRe = regEx(/\/\/[^@]+@/g);
130
- const dataUriCredRe = regEx(/^(data:[0-9a-z-]+\/[0-9a-z-]+;).+/i);
130
+ const dataUriCredRe = regEx(/^(?<prefix>data:[0-9a-z-]+\/[0-9a-z-]+;).+/i);
131
131
  function sanitizeUrls(text) {
132
132
  return text.replace(urlRe, (url) => {
133
133
  return url.replace(urlCredRe, "//**redacted**@");
134
- }).replace(dataUriCredRe, "$1**redacted**");
134
+ }).replace(dataUriCredRe, "$<prefix>**redacted**");
135
135
  }
136
136
  function getEnv(key) {
137
137
  return [process.env[`RENOVATE_${key}`], process.env[key]].map((v) => v?.toLowerCase().trim()).find(isNonEmptyStringAndNotWhitespace);
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["HttpError"],"sources":["../../lib/logger/utils.ts"],"sourcesContent":["import {\n isArray,\n isBuffer,\n isDate,\n isEmptyObject,\n isError,\n isFunction,\n isNonEmptyObject,\n isNonEmptyStringAndNotWhitespace,\n isObject,\n isPlainObject,\n isString,\n} from '@sindresorhus/is';\nimport { RequestError as HttpError } from 'got';\nimport { DateTime } from 'luxon';\nimport { ZodError } from 'zod/v4';\nimport { ExecError } from '../util/exec/exec-error.ts';\nimport { regEx } from '../util/regex.ts';\nimport { redactedFields, sanitize } from '../util/sanitize.ts';\n\nconst contentFields = [\n 'content',\n 'contents',\n 'packageLockParsed',\n 'yarnLockParsed',\n];\n\ntype ZodShortenedIssue =\n | null\n | string\n | string[]\n | {\n [key: string]: ZodShortenedIssue;\n };\n\nexport function prepareZodIssues(input: unknown): ZodShortenedIssue {\n if (!isPlainObject(input)) {\n return null;\n }\n\n let err: null | string | string[] = null;\n // v8 ignore else -- TODO: add test #40625\n if (isArray(input._errors, isString)) {\n if (input._errors.length === 1) {\n err = input._errors[0];\n } else if (input._errors.length > 1) {\n err = input._errors;\n } else {\n err = null;\n }\n }\n delete input._errors;\n\n if (isEmptyObject(input)) {\n return err;\n }\n\n const output: Record<string, ZodShortenedIssue> = {};\n const entries = Object.entries(input);\n for (const [key, value] of entries.slice(0, 3)) {\n const child = prepareZodIssues(value);\n // v8 ignore else -- TODO: add test #40625\n if (child !== null) {\n output[key] = child;\n }\n }\n\n if (entries.length > 3) {\n output.___ = `... ${entries.length - 3} more`;\n }\n\n return output;\n}\n\nexport function prepareZodError(err: ZodError): Record<string, unknown> {\n Object.defineProperty(err, 'message', {\n get: () => 'Schema error',\n /* v8 ignore start -- TODO: drop set? */\n set: () => {\n /* intentionally empty */\n },\n // v8 ignore stop -- TODO: drop set? */\n });\n\n return {\n message: err.message,\n stack: err.stack,\n issues: prepareZodIssues(err.format()),\n };\n}\n\nexport default function prepareError(err: Error): Record<string, unknown> {\n if (err instanceof ZodError) {\n return prepareZodError(err);\n }\n\n const response: Record<string, unknown> = {\n // We want to loose class information, but keep enumerable properties of the error\n // oxlint-disable-next-line typescript/no-misused-spread\n ...err,\n };\n\n // Required as message is non-enumerable\n if (!response.message && err.message) {\n response.message = err.message;\n }\n\n // Required as stack is non-enumerable\n if (!response.stack && err.stack) {\n response.stack = err.stack;\n }\n\n if (err instanceof AggregateError) {\n response.errors = err.errors.map((error) => prepareError(error));\n }\n\n // handle rawExec error\n if (err instanceof ExecError && isNonEmptyObject(err.options?.env)) {\n const env = Object.keys(err.options.env);\n response.options = { ...err.options, env };\n }\n\n // handle got error\n if (err instanceof HttpError) {\n const options: Record<string, unknown> = {\n headers: structuredClone(err.options.headers),\n url: err.options.url?.toString(),\n hostType: err.options.context.hostType,\n };\n response.options = options;\n\n options.username = err.options.username;\n options.password = err.options.password;\n options.method = err.options.method;\n options.http2 = err.options.http2;\n\n // v8 ignore else -- TODO: add test #40625\n if (err.response) {\n response.response = {\n statusCode: err.response.statusCode,\n statusMessage: err.response.statusMessage,\n body:\n err.name === 'TimeoutError'\n ? undefined\n : structuredClone(err.response.body),\n headers: structuredClone(err.response.headers),\n httpVersion: err.response.httpVersion,\n retryCount: err.response.retryCount,\n };\n }\n }\n\n return response;\n}\n\ntype NestedValue = unknown[] | object;\n\nfunction isNested(value: unknown): value is NestedValue {\n return isArray(value) || isObject(value);\n}\n\nexport function sanitizeValue(\n value: unknown,\n seen = new WeakMap<NestedValue, unknown>(),\n): any {\n if (isString(value)) {\n return sanitize(sanitizeUrls(value));\n }\n\n // Handle boxed String objects (e.g. from `new String()`), which `isString`\n // rejects but `isObject` would iterate character-by-character producing\n // `{\"0\":\"h\",\"1\":\"e\",...}` in log output.\n if (value instanceof String) {\n return sanitize(sanitizeUrls(value.toString()));\n }\n\n if (isDate(value)) {\n return value;\n }\n\n if (DateTime.isDateTime(value)) {\n return value.toISO();\n }\n\n if (isFunction(value)) {\n return '[function]';\n }\n\n if (isBuffer(value)) {\n return '[content]';\n }\n\n if (isError(value)) {\n const err = prepareError(value);\n return sanitizeValue(err, seen);\n }\n\n if (isArray(value)) {\n const length = value.length;\n const arrayResult = Array(length);\n seen.set(value, arrayResult);\n for (let idx = 0; idx < length; idx += 1) {\n const val = value[idx];\n arrayResult[idx] =\n isNested(val) && seen.has(val)\n ? seen.get(val)\n : sanitizeValue(val, seen);\n }\n return arrayResult;\n }\n\n if (isObject(value)) {\n const objectResult: Record<string, any> = {};\n seen.set(value, objectResult);\n for (const [key, val] of Object.entries<any>(value)) {\n let curValue: any;\n if (!val) {\n curValue = val;\n } else if (redactedFields.includes(key)) {\n // Do not mask/sanitize secrets templates\n if (isString(val) && regEx(/^{{\\s*secrets\\..*}}$/).test(val)) {\n curValue = val;\n } else {\n curValue = '***********';\n }\n } else if (contentFields.includes(key)) {\n curValue = '[content]';\n } else if (key === 'secrets') {\n curValue = {};\n Object.keys(val).forEach((secretKey) => {\n curValue[secretKey] = '***********';\n });\n } else {\n curValue = seen.has(val) ? seen.get(val) : sanitizeValue(val, seen);\n }\n\n const sanitizedKey = sanitizeValue(key, seen);\n objectResult[sanitizedKey] = curValue;\n }\n\n return objectResult;\n }\n\n return value;\n}\n\nconst urlRe = regEx(/[a-z]{3,9}:\\/\\/[^@/]+@[a-z0-9.-]+/gi);\nconst urlCredRe = regEx(/\\/\\/[^@]+@/g);\nconst dataUriCredRe = regEx(/^(data:[0-9a-z-]+\\/[0-9a-z-]+;).+/i);\n\nexport function sanitizeUrls(text: string): string {\n return text\n .replace(urlRe, (url) => {\n return url.replace(urlCredRe, '//**redacted**@');\n })\n .replace(dataUriCredRe, '$1**redacted**');\n}\n\nexport function getEnv(key: string): string | undefined {\n return [process.env[`RENOVATE_${key}`], process.env[key]]\n .map((v) => v?.toLowerCase().trim())\n .find(isNonEmptyStringAndNotWhitespace);\n}\n\nexport function getMessage(\n p1: string | Record<string, any>,\n p2?: string,\n): string | undefined {\n return isString(p1) ? p1 : p2;\n}\n\nexport function toMeta(\n p1: string | Record<string, any>,\n): Record<string, unknown> {\n return isObject(p1) ? p1 : {};\n}\n"],"mappings":";;;;;;;;AAoBA,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;AACF;AAUA,SAAgB,iBAAiB,OAAmC;CAClE,IAAI,CAAC,cAAc,KAAK,GACtB,OAAO;CAGT,IAAI,MAAgC;;CAEpC,IAAI,QAAQ,MAAM,SAAS,QAAQ,GAAG;EACpC,IAAI,MAAM,QAAQ,WAAW,GAC3B,MAAM,MAAM,QAAQ;OACf,IAAI,MAAM,QAAQ,SAAS,GAChC,MAAM,MAAM;OAEZ,MAAM;CAEV;CACA,OAAO,MAAM;CAEb,IAAI,cAAc,KAAK,GACrB,OAAO;CAGT,MAAM,SAA4C,CAAC;CACnD,MAAM,UAAU,OAAO,QAAQ,KAAK;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,IAAI,CAAC,KACH,WAAW;QACN,IAAI,eAAe,SAAS,GAAG,GAAG;IAEvC,IAAI,SAAS,GAAG,KAAK,MAAM,sBAAsB,CAAC,CAAC,KAAK,GAAG,GACzD,WAAW;SAEX,WAAW;GAEf,OAAO,IAAI,cAAc,SAAS,GAAG,GACnC,WAAW;QACN,IAAI,QAAQ,WAAW;IAC5B,WAAW,CAAC;IACZ,OAAO,KAAK,GAAG,CAAC,CAAC,SAAS,cAAc;KACtC,SAAS,aAAa;IACxB,CAAC;GACH,OACE,WAAW,KAAK,IAAI,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,cAAc,KAAK,IAAI;GAGpE,MAAM,eAAe,cAAc,KAAK,IAAI;GAC5C,aAAa,gBAAgB;EAC/B;EAEA,OAAO;CACT;CAEA,OAAO;AACT;AAEA,MAAM,QAAQ,MAAM,qCAAqC;AACzD,MAAM,YAAY,MAAM,aAAa;AACrC,MAAM,gBAAgB,MAAM,oCAAoC;AAEhE,SAAgB,aAAa,MAAsB;CACjD,OAAO,KACJ,QAAQ,QAAQ,QAAQ;EACvB,OAAO,IAAI,QAAQ,WAAW,iBAAiB;CACjD,CAAC,CAAC,CACD,QAAQ,eAAe,gBAAgB;AAC5C;AAEA,SAAgB,OAAO,KAAiC;CACtD,OAAO,CAAC,QAAQ,IAAI,YAAY,QAAQ,QAAQ,IAAI,IAAI,CAAC,CACtD,KAAK,MAAM,GAAG,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,CACnC,KAAK,gCAAgC;AAC1C;AAEA,SAAgB,WACd,IACA,IACoB;CACpB,OAAO,SAAS,EAAE,IAAI,KAAK;AAC7B;AAEA,SAAgB,OACd,IACyB;CACzB,OAAO,SAAS,EAAE,IAAI,KAAK,CAAC;AAC9B"}
1
+ {"version":3,"file":"utils.js","names":["HttpError"],"sources":["../../lib/logger/utils.ts"],"sourcesContent":["import {\n isArray,\n isBuffer,\n isDate,\n isEmptyObject,\n isError,\n isFunction,\n isNonEmptyObject,\n isNonEmptyStringAndNotWhitespace,\n isObject,\n isPlainObject,\n isString,\n} from '@sindresorhus/is';\nimport { RequestError as HttpError } from 'got';\nimport { DateTime } from 'luxon';\nimport { ZodError } from 'zod/v4';\nimport { ExecError } from '../util/exec/exec-error.ts';\nimport { regEx } from '../util/regex.ts';\nimport { redactedFields, sanitize } from '../util/sanitize.ts';\n\nconst contentFields = [\n 'content',\n 'contents',\n 'packageLockParsed',\n 'yarnLockParsed',\n];\n\ntype ZodShortenedIssue =\n | null\n | string\n | string[]\n | {\n [key: string]: ZodShortenedIssue;\n };\n\nexport function prepareZodIssues(input: unknown): ZodShortenedIssue {\n if (!isPlainObject(input)) {\n return null;\n }\n\n let err: null | string | string[] = null;\n // v8 ignore else -- TODO: add test #40625\n if (isArray(input._errors, isString)) {\n if (input._errors.length === 1) {\n err = input._errors[0];\n } else if (input._errors.length > 1) {\n err = input._errors;\n } else {\n err = null;\n }\n }\n delete input._errors;\n\n if (isEmptyObject(input)) {\n return err;\n }\n\n const output: Record<string, ZodShortenedIssue> = {};\n const entries = Object.entries(input);\n for (const [key, value] of entries.slice(0, 3)) {\n const child = prepareZodIssues(value);\n // v8 ignore else -- TODO: add test #40625\n if (child !== null) {\n output[key] = child;\n }\n }\n\n if (entries.length > 3) {\n output.___ = `... ${entries.length - 3} more`;\n }\n\n return output;\n}\n\nexport function prepareZodError(err: ZodError): Record<string, unknown> {\n Object.defineProperty(err, 'message', {\n get: () => 'Schema error',\n /* v8 ignore start -- TODO: drop set? */\n set: () => {\n /* intentionally empty */\n },\n // v8 ignore stop -- TODO: drop set? */\n });\n\n return {\n message: err.message,\n stack: err.stack,\n issues: prepareZodIssues(err.format()),\n };\n}\n\nexport default function prepareError(err: Error): Record<string, unknown> {\n if (err instanceof ZodError) {\n return prepareZodError(err);\n }\n\n const response: Record<string, unknown> = {\n // We want to loose class information, but keep enumerable properties of the error\n // oxlint-disable-next-line typescript/no-misused-spread\n ...err,\n };\n\n // Required as message is non-enumerable\n if (!response.message && err.message) {\n response.message = err.message;\n }\n\n // Required as stack is non-enumerable\n if (!response.stack && err.stack) {\n response.stack = err.stack;\n }\n\n if (err instanceof AggregateError) {\n response.errors = err.errors.map((error) => prepareError(error));\n }\n\n // handle rawExec error\n if (err instanceof ExecError && isNonEmptyObject(err.options?.env)) {\n const env = Object.keys(err.options.env);\n response.options = { ...err.options, env };\n }\n\n // handle got error\n if (err instanceof HttpError) {\n const options: Record<string, unknown> = {\n headers: structuredClone(err.options.headers),\n url: err.options.url?.toString(),\n hostType: err.options.context.hostType,\n };\n response.options = options;\n\n options.username = err.options.username;\n options.password = err.options.password;\n options.method = err.options.method;\n options.http2 = err.options.http2;\n\n // v8 ignore else -- TODO: add test #40625\n if (err.response) {\n response.response = {\n statusCode: err.response.statusCode,\n statusMessage: err.response.statusMessage,\n body:\n err.name === 'TimeoutError'\n ? undefined\n : structuredClone(err.response.body),\n headers: structuredClone(err.response.headers),\n httpVersion: err.response.httpVersion,\n retryCount: err.response.retryCount,\n };\n }\n }\n\n return response;\n}\n\ntype NestedValue = unknown[] | object;\n\nfunction isNested(value: unknown): value is NestedValue {\n return isArray(value) || isObject(value);\n}\n\nexport function sanitizeValue(\n value: unknown,\n seen = new WeakMap<NestedValue, unknown>(),\n): any {\n if (isString(value)) {\n return sanitize(sanitizeUrls(value));\n }\n\n // Handle boxed String objects (e.g. from `new String()`), which `isString`\n // rejects but `isObject` would iterate character-by-character producing\n // `{\"0\":\"h\",\"1\":\"e\",...}` in log output.\n if (value instanceof String) {\n return sanitize(sanitizeUrls(value.toString()));\n }\n\n if (isDate(value)) {\n return value;\n }\n\n if (DateTime.isDateTime(value)) {\n return value.toISO();\n }\n\n if (isFunction(value)) {\n return '[function]';\n }\n\n if (isBuffer(value)) {\n return '[content]';\n }\n\n if (isError(value)) {\n const err = prepareError(value);\n return sanitizeValue(err, seen);\n }\n\n if (isArray(value)) {\n const length = value.length;\n const arrayResult = Array(length);\n seen.set(value, arrayResult);\n for (let idx = 0; idx < length; idx += 1) {\n const val = value[idx];\n arrayResult[idx] =\n isNested(val) && seen.has(val)\n ? seen.get(val)\n : sanitizeValue(val, seen);\n }\n return arrayResult;\n }\n\n if (isObject(value)) {\n const objectResult: Record<string, any> = {};\n seen.set(value, objectResult);\n for (const [key, val] of Object.entries<any>(value)) {\n let curValue: any;\n if (!val) {\n curValue = val;\n } else if (redactedFields.includes(key)) {\n // Do not mask/sanitize secrets templates\n if (isString(val) && regEx(/^{{\\s*secrets\\..*}}$/).test(val)) {\n curValue = val;\n } else {\n curValue = '***********';\n }\n } else if (contentFields.includes(key)) {\n curValue = '[content]';\n } else if (key === 'secrets') {\n curValue = {};\n Object.keys(val).forEach((secretKey) => {\n curValue[secretKey] = '***********';\n });\n } else {\n curValue = seen.has(val) ? seen.get(val) : sanitizeValue(val, seen);\n }\n\n const sanitizedKey = sanitizeValue(key, seen);\n objectResult[sanitizedKey] = curValue;\n }\n\n return objectResult;\n }\n\n return value;\n}\n\nconst urlRe = regEx(/[a-z]{3,9}:\\/\\/[^@/]+@[a-z0-9.-]+/gi);\nconst urlCredRe = regEx(/\\/\\/[^@]+@/g);\nconst dataUriCredRe = regEx(/^(?<prefix>data:[0-9a-z-]+\\/[0-9a-z-]+;).+/i);\n\nexport function sanitizeUrls(text: string): string {\n return text\n .replace(urlRe, (url) => {\n return url.replace(urlCredRe, '//**redacted**@');\n })\n .replace(dataUriCredRe, '$<prefix>**redacted**');\n}\n\nexport function getEnv(key: string): string | undefined {\n return [process.env[`RENOVATE_${key}`], process.env[key]]\n .map((v) => v?.toLowerCase().trim())\n .find(isNonEmptyStringAndNotWhitespace);\n}\n\nexport function getMessage(\n p1: string | Record<string, any>,\n p2?: string,\n): string | undefined {\n return isString(p1) ? p1 : p2;\n}\n\nexport function toMeta(\n p1: string | Record<string, any>,\n): Record<string, unknown> {\n return isObject(p1) ? p1 : {};\n}\n"],"mappings":";;;;;;;;AAoBA,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;AACF;AAUA,SAA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KAAK,MAAM,GAAG,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,CACnC,KAAK,gCAAgC;AAC1C;AAEA,SAAgB,WACd,IACA,IACoB;CACpB,OAAO,SAAS,EAAE,IAAI,KAAK;AAC7B;AAEA,SAAgB,OACd,IACyB;CACzB,OAAO,SAAS,EAAE,IAAI,KAAK,CAAC;AAC9B"}
@@ -25,7 +25,7 @@ var DenoDatasource = class DenoDatasource extends Datasource {
25
25
  }
26
26
  async _getReleases({ packageName, registryUrl }) {
27
27
  const massagedRegistryUrl = registryUrl;
28
- const rawPackageName = regEx(/^(https:\/\/deno.land\/)(?<rawPackageName>[^@\s]+)/).exec(packageName)?.groups?.rawPackageName;
28
+ const rawPackageName = regEx(/^(?:https:\/\/deno.land\/)(?<rawPackageName>[^@\s]+)/).exec(packageName)?.groups?.rawPackageName;
29
29
  if (isNullOrUndefined(rawPackageName)) {
30
30
  logger.debug(`Could not extract rawPackageName from packageName: "${packageName}"`);
31
31
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["semanticVersioning.id","packageCache.get","packageCache.set"],"sources":["../../../../lib/modules/datasource/deno/index.ts"],"sourcesContent":["import { isNullOrUndefined } from '@sindresorhus/is';\nimport pMap from 'p-map';\nimport { logger } from '../../../logger/index.ts';\nimport * as packageCache from '../../../util/cache/package/index.ts';\nimport { withCache } from '../../../util/cache/package/with-cache.ts';\nimport { coerceObject } from '../../../util/object.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { joinUrlParts } from '../../../util/url.ts';\nimport * as semanticVersioning from '../../versioning/semver/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { Release } from '../index.ts';\nimport type { GetReleasesConfig, ReleaseResult } from '../types.ts';\nimport {\n DenoAPIModuleResponse,\n DenoAPIModuleVersionResponse,\n} from './schema.ts';\n\nexport class DenoDatasource extends Datasource {\n static readonly id = 'deno';\n\n override readonly customRegistrySupport = true;\n\n override readonly registryStrategy = 'first';\n\n override readonly defaultVersioning = semanticVersioning.id;\n\n override readonly defaultRegistryUrls = ['https://apiland.deno.dev'];\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timestamp is determined from the `uploaded_at` field in the results.';\n override readonly sourceUrlSupport = 'release';\n override readonly sourceUrlNote =\n 'The source URL is determined from the `repository` field in the results.';\n\n constructor() {\n super(DenoDatasource.id);\n }\n\n private async _getReleases({\n packageName,\n registryUrl,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n const massagedRegistryUrl = registryUrl!;\n\n const extractResult = regEx(\n /^(https:\\/\\/deno.land\\/)(?<rawPackageName>[^@\\s]+)/,\n ).exec(packageName);\n const rawPackageName = extractResult?.groups?.rawPackageName;\n if (isNullOrUndefined(rawPackageName)) {\n logger.debug(\n `Could not extract rawPackageName from packageName: \"${packageName}\"`,\n );\n return null;\n }\n\n // remove third-party prefix if defined. The only internal library is `std` and is available under the same API\n const massagedPackageName = rawPackageName.replace('x/', '');\n\n // https://apiland.deno.dev/v2/modules/postgres\n const moduleAPIURL = joinUrlParts(\n massagedRegistryUrl,\n 'v2/modules',\n massagedPackageName,\n );\n\n return await this.getReleaseResult(moduleAPIURL);\n }\n\n getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null> {\n return withCache(\n {\n namespace: `datasource-${DenoDatasource.id}`,\n // TODO: types (#22198)\n key: `getReleases:${config.registryUrl}:${config.packageName}`,\n fallback: true,\n },\n () => this._getReleases(config),\n );\n }\n\n private async _getReleaseResult(\n moduleAPIURL: string,\n ): Promise<ReleaseResult> {\n const detailsCacheKey = `details:${moduleAPIURL}`;\n const releasesCache: Record<string, Release> = coerceObject(\n await packageCache.get(\n `datasource-${DenoDatasource.id}`,\n detailsCacheKey,\n ),\n );\n let cacheModified = false;\n\n const {\n body: { versions, tags },\n } = await this.http.getJson(moduleAPIURL, DenoAPIModuleResponse);\n\n // get details for the versions\n const releases = await pMap(\n versions,\n async (version) => {\n const cacheRelease = releasesCache[version];\n /* v8 ignore next: hard to test */\n if (cacheRelease) {\n return cacheRelease;\n }\n\n // https://apiland.deno.dev/v2/modules/postgres/v0.17.0\n const url = joinUrlParts(moduleAPIURL, version);\n const { body: release } = await this.http.getJson(\n url,\n DenoAPIModuleVersionResponse.catch(({ error: err }) => {\n logger.warn(\n { err, version },\n 'Deno: failed to get version details',\n );\n return { version };\n }),\n );\n\n releasesCache[release.version] = release;\n cacheModified = true;\n\n return release;\n },\n { concurrency: 5 },\n );\n\n if (cacheModified) {\n // 1 week. Releases at Deno are immutable, therefore we can use a long term cache here.\n await packageCache.set(\n `datasource-${DenoDatasource.id}`,\n detailsCacheKey,\n releasesCache,\n 10080,\n );\n }\n\n return { releases, tags };\n }\n\n getReleaseResult(moduleAPIURL: string): Promise<ReleaseResult> {\n return withCache(\n {\n namespace: `datasource-${DenoDatasource.id}`,\n key: `getReleaseResult:${moduleAPIURL}`,\n },\n () => this._getReleaseResult(moduleAPIURL),\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,IAAa,iBAAb,MAAa,uBAAuB,WAAW;CAC7C,OAAgB,KAAK;CAErB,wBAA0C;CAE1C,mBAAqC;CAErC,oBAAsCA;CAEtC,sBAAwC,CAAC,0BAA0B;CAEnE,0BAA4C;CAC5C,uBACE;CACF,mBAAqC;CACrC,gBACE;CAEF,cAAc;EACZ,MAAM,eAAe,EAAE;CACzB;CAEA,MAAc,aAAa,EACzB,aACA,eACmD;EACnD,MAAM,sBAAsB;EAK5B,MAAM,iBAHgB,MACpB,oDACF,CAAC,CAAC,KAAK,WAC4B,CAAC,EAAE,QAAQ;EAC9C,IAAI,kBAAkB,cAAc,GAAG;GACrC,OAAO,MACL,uDAAuD,YAAY,EACrE;GACA,OAAO;EACT;EAGA,MAAM,sBAAsB,eAAe,QAAQ,MAAM,EAAE;EAG3D,MAAM,eAAe,aACnB,qBACA,cACA,mBACF;EAEA,OAAO,MAAM,KAAK,iBAAiB,YAAY;CACjD;CAEA,YAAY,QAA0D;EACpE,OAAO,UACL;GACE,WAAW,cAAc,eAAe;GAExC,KAAK,eAAe,OAAO,YAAY,GAAG,OAAO;GACjD,UAAU;EACZ,SACM,KAAK,aAAa,MAAM,CAChC;CACF;CAEA,MAAc,kBACZ,cACwB;EACxB,MAAM,kBAAkB,WAAW;EACnC,MAAM,gBAAyC,aAC7C,MAAMC,IACJ,cAAc,eAAe,MAC7B,eACF,CACF;EACA,IAAI,gBAAgB;EAEpB,MAAM,EACJ,MAAM,EAAE,UAAU,WAChB,MAAM,KAAK,KAAK,QAAQ,cAAc,qBAAqB;EAG/D,MAAM,WAAW,MAAM,KACrB,UACA,OAAO,YAAY;GACjB,MAAM,eAAe,cAAc;;GAEnC,IAAI,cACF,OAAO;GAIT,MAAM,MAAM,aAAa,cAAc,OAAO;GAC9C,MAAM,EAAE,MAAM,YAAY,MAAM,KAAK,KAAK,QACxC,KACA,6BAA6B,OAAO,EAAE,OAAO,UAAU;IACrD,OAAO,KACL;KAAE;KAAK;IAAQ,GACf,qCACF;IACA,OAAO,EAAE,QAAQ;GACnB,CAAC,CACH;GAEA,cAAc,QAAQ,WAAW;GACjC,gBAAgB;GAEhB,OAAO;EACT,GACA,EAAE,aAAa,EAAE,CACnB;EAEA,IAAI,eAEF,MAAMC,IACJ,cAAc,eAAe,MAC7B,iBACA,eACA,KACF;EAGF,OAAO;GAAE;GAAU;EAAK;CAC1B;CAEA,iBAAiB,cAA8C;EAC7D,OAAO,UACL;GACE,WAAW,cAAc,eAAe;GACxC,KAAK,oBAAoB;EAC3B,SACM,KAAK,kBAAkB,YAAY,CAC3C;CACF;AACF"}
1
+ {"version":3,"file":"index.js","names":["semanticVersioning.id","packageCache.get","packageCache.set"],"sources":["../../../../lib/modules/datasource/deno/index.ts"],"sourcesContent":["import { isNullOrUndefined } from '@sindresorhus/is';\nimport pMap from 'p-map';\nimport { logger } from '../../../logger/index.ts';\nimport * as packageCache from '../../../util/cache/package/index.ts';\nimport { withCache } from '../../../util/cache/package/with-cache.ts';\nimport { coerceObject } from '../../../util/object.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { joinUrlParts } from '../../../util/url.ts';\nimport * as semanticVersioning from '../../versioning/semver/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport type { Release } from '../index.ts';\nimport type { GetReleasesConfig, ReleaseResult } from '../types.ts';\nimport {\n DenoAPIModuleResponse,\n DenoAPIModuleVersionResponse,\n} from './schema.ts';\n\nexport class DenoDatasource extends Datasource {\n static readonly id = 'deno';\n\n override readonly customRegistrySupport = true;\n\n override readonly registryStrategy = 'first';\n\n override readonly defaultVersioning = semanticVersioning.id;\n\n override readonly defaultRegistryUrls = ['https://apiland.deno.dev'];\n\n override readonly releaseTimestampSupport = true;\n override readonly releaseTimestampNote =\n 'The release timestamp is determined from the `uploaded_at` field in the results.';\n override readonly sourceUrlSupport = 'release';\n override readonly sourceUrlNote =\n 'The source URL is determined from the `repository` field in the results.';\n\n constructor() {\n super(DenoDatasource.id);\n }\n\n private async _getReleases({\n packageName,\n registryUrl,\n }: GetReleasesConfig): Promise<ReleaseResult | null> {\n const massagedRegistryUrl = registryUrl!;\n\n const extractResult = regEx(\n /^(?:https:\\/\\/deno.land\\/)(?<rawPackageName>[^@\\s]+)/,\n ).exec(packageName);\n const rawPackageName = extractResult?.groups?.rawPackageName;\n if (isNullOrUndefined(rawPackageName)) {\n logger.debug(\n `Could not extract rawPackageName from packageName: \"${packageName}\"`,\n );\n return null;\n }\n\n // remove third-party prefix if defined. The only internal library is `std` and is available under the same API\n const massagedPackageName = rawPackageName.replace('x/', '');\n\n // https://apiland.deno.dev/v2/modules/postgres\n const moduleAPIURL = joinUrlParts(\n massagedRegistryUrl,\n 'v2/modules',\n massagedPackageName,\n );\n\n return await this.getReleaseResult(moduleAPIURL);\n }\n\n getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null> {\n return withCache(\n {\n namespace: `datasource-${DenoDatasource.id}`,\n // TODO: types (#22198)\n key: `getReleases:${config.registryUrl}:${config.packageName}`,\n fallback: true,\n },\n () => this._getReleases(config),\n );\n }\n\n private async _getReleaseResult(\n moduleAPIURL: string,\n ): Promise<ReleaseResult> {\n const detailsCacheKey = `details:${moduleAPIURL}`;\n const releasesCache: Record<string, Release> = coerceObject(\n await packageCache.get(\n `datasource-${DenoDatasource.id}`,\n detailsCacheKey,\n ),\n );\n let cacheModified = false;\n\n const {\n body: { versions, tags },\n } = await this.http.getJson(moduleAPIURL, DenoAPIModuleResponse);\n\n // get details for the versions\n const releases = await pMap(\n versions,\n async (version) => {\n const cacheRelease = releasesCache[version];\n /* v8 ignore next: hard to test */\n if (cacheRelease) {\n return cacheRelease;\n }\n\n // https://apiland.deno.dev/v2/modules/postgres/v0.17.0\n const url = joinUrlParts(moduleAPIURL, version);\n const { body: release } = await this.http.getJson(\n url,\n DenoAPIModuleVersionResponse.catch(({ error: err }) => {\n logger.warn(\n { err, version },\n 'Deno: failed to get version details',\n );\n return { version };\n }),\n );\n\n releasesCache[release.version] = release;\n cacheModified = true;\n\n return release;\n },\n { concurrency: 5 },\n );\n\n if (cacheModified) {\n // 1 week. Releases at Deno are immutable, therefore we can use a long term cache here.\n await packageCache.set(\n `datasource-${DenoDatasource.id}`,\n detailsCacheKey,\n releasesCache,\n 10080,\n );\n }\n\n return { releases, tags };\n }\n\n getReleaseResult(moduleAPIURL: string): Promise<ReleaseResult> {\n return withCache(\n {\n namespace: `datasource-${DenoDatasource.id}`,\n key: `getReleaseResult:${moduleAPIURL}`,\n },\n () => this._getReleaseResult(moduleAPIURL),\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,IAAa,iBAAb,MAAa,uBAAuB,WAAW;CAC7C,OAAgB,KAAK;CAErB,wBAA0C;CAE1C,mBAAqC;CAErC,oBAAsCA;CAEtC,sBAAwC,CAAC,0BAA0B;CAEnE,0BAA4C;CAC5C,uBACE;CACF,mBAAqC;CACrC,gBACE;CAEF,cAAc;EACZ,MAAM,eAAe,EAAE;CACzB;CAEA,MAAc,aAAa,EACzB,aACA,eACmD;EACn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L;GACE,WAAW,cAAc,eAAe;GACxC,KAAK,oBAAoB;EAC3B,SACM,KAAK,kBAAkB,YAAY,CAC3C;CACF;AACF"}
@@ -3,7 +3,7 @@ import { addSecretForSanitizing } from "../../../util/sanitize.js";
3
3
  import { logger } from "../../../logger/index.js";
4
4
  import { ECR } from "@aws-sdk/client-ecr";
5
5
  //#region lib/modules/datasource/docker/ecr.ts
6
- const ecrRegex = regEx(/\d+\.(?:dkr\.ecr|dkr-ecr)(?:-fips)?\.([-a-z0-9]+)\.(?:amazonaws\.com|on\.aws|amazonaws\.com\.cn|on\.amazonwebservices\.com\.cn|amazonaws\.eu|on\.amazonwebservices\.eu|c2s\.ic\.gov|on\.aws\.ic\.gov|sc2s\.sgov\.gov|on\.aws\.scloud|scloud\.adc-e\.uk|on\.cloud-aws\.adc-e\.uk|csp\.hci\.ic\.gov|on\.aws\.hci\.ic\.gov|)/);
6
+ const ecrRegex = regEx(/\d+\.(?:dkr\.ecr|dkr-ecr)(?:-fips)?\.(?<region>[-a-z0-9]+)\.(?:amazonaws\.com|on\.aws|amazonaws\.com\.cn|on\.amazonwebservices\.com\.cn|amazonaws\.eu|on\.amazonwebservices\.eu|c2s\.ic\.gov|on\.aws\.ic\.gov|sc2s\.sgov\.gov|on\.aws\.scloud|scloud\.adc-e\.uk|on\.cloud-aws\.adc-e\.uk|csp\.hci\.ic\.gov|on\.aws\.hci\.ic\.gov|)/);
7
7
  const ecrPublicRegex = regEx(/public\.ecr\.aws|ecr-public\.aws\.com/);
8
8
  async function getECRAuthToken(region, opts) {
9
9
  const config = { region };
@@ -1 +1 @@
1
- {"version":3,"file":"ecr.js","names":[],"sources":["../../../../lib/modules/datasource/docker/ecr.ts"],"sourcesContent":["import type { ECRClientConfig } from '@aws-sdk/client-ecr';\nimport { ECR } from '@aws-sdk/client-ecr';\nimport { logger } from '../../../logger/index.ts';\nimport type { HostRule } from '../../../types/index.ts';\nimport type { HttpError } from '../../../util/http/index.ts';\nimport type { HttpResponse } from '../../../util/http/types.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { addSecretForSanitizing } from '../../../util/sanitize.ts';\n\nexport const ecrRegex = regEx(\n /\\d+\\.(?:dkr\\.ecr|dkr-ecr)(?:-fips)?\\.([-a-z0-9]+)\\.(?:amazonaws\\.com|on\\.aws|amazonaws\\.com\\.cn|on\\.amazonwebservices\\.com\\.cn|amazonaws\\.eu|on\\.amazonwebservices\\.eu|c2s\\.ic\\.gov|on\\.aws\\.ic\\.gov|sc2s\\.sgov\\.gov|on\\.aws\\.scloud|scloud\\.adc-e\\.uk|on\\.cloud-aws\\.adc-e\\.uk|csp\\.hci\\.ic\\.gov|on\\.aws\\.hci\\.ic\\.gov|)/,\n);\nexport const ecrPublicRegex = regEx(/public\\.ecr\\.aws|ecr-public\\.aws\\.com/);\n\nexport async function getECRAuthToken(\n region: string,\n opts: HostRule,\n): Promise<string | null> {\n const config: ECRClientConfig = { region };\n if (opts.username === `AWS` && opts.password) {\n logger.trace(\n `AWS user specified, encoding basic auth credentials for ECR registry`,\n );\n return Buffer.from(`AWS:${opts.password}`).toString('base64');\n }\n if (opts.username && opts.password) {\n logger.trace(\n `Using AWS accessKey to get Authorization token for ECR registry`,\n );\n config.credentials = {\n accessKeyId: opts.username,\n secretAccessKey: opts.password,\n ...(opts.token && { sessionToken: opts.token }),\n };\n }\n\n const ecr = new ECR(config);\n try {\n const data = await ecr.getAuthorizationToken({});\n const authorizationToken = data?.authorizationData?.[0]?.authorizationToken;\n if (authorizationToken) {\n // sanitize token\n addSecretForSanitizing(authorizationToken);\n return authorizationToken;\n }\n logger.warn(\n 'Could not extract authorizationToken from ECR getAuthorizationToken response',\n );\n } catch (err) {\n logger.trace({ err }, 'err');\n logger.warn('ECR getAuthorizationToken error');\n }\n return null;\n}\n\n// https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_DescribeRepositories.html#ECR-DescribeRepositories-request-maxResults\nexport function isECRMaxResultsResponse(resp: HttpResponse<unknown>): boolean {\n const body = resp.body as { errors?: { message?: string }[] } | undefined;\n return !!(\n resp.statusCode === 405 &&\n resp.headers?.['docker-distribution-api-version'] &&\n body?.errors?.[0]?.message?.includes(\n 'Member must have value less than or equal to 1000',\n )\n );\n}\n\nexport function isECRMaxResultsError(err: HttpError): boolean {\n const resp = err.response as HttpResponse<unknown> | undefined;\n return !!resp && isECRMaxResultsResponse(resp);\n}\n"],"mappings":";;;;;AASA,MAAa,WAAW,MACtB,2TACF;AACA,MAAa,iBAAiB,MAAM,uCAAuC;AAE3E,eAAsB,gBACpB,QACA,MACwB;CACxB,MAAM,SAA0B,EAAE,OAAO;CACzC,IAAI,KAAK,aAAa,SAAS,KAAK,UAAU;EAC5C,OAAO,MACL,sEACF;EACA,OAAO,OAAO,KAAK,OAAO,KAAK,UAAU,CAAC,CAAC,SAAS,QAAQ;CAC9D;CACA,IAAI,KAAK,YAAY,KAAK,UAAU;EAClC,OAAO,MACL,iEACF;EACA,OAAO,cAAc;GACnB,aAAa,KAAK;GAClB,iBAAiB,KAAK;GACtB,GAAI,KAAK,SAAS,EAAE,cAAc,KAAK,MAAM;EAC/C;CACF;CAEA,MAAM,MAAM,IAAI,IAAI,MAAM;CAC1B,IAAI;EAEF,MAAM,sBAAqB,MADR,IAAI,sBAAsB,CAAC,CAAC,EAAA,EACd,oBAAoB,EAAE,EAAE;EACzD,IAAI,oBAAoB;GAEtB,uBAAuB,kBAAkB;GACzC,OAAO;EACT;EACA,OAAO,KACL,8EACF;CACF,SAAS,KAAK;EACZ,OAAO,MAAM,EAAE,IAAI,GAAG,KAAK;EAC3B,OAAO,KAAK,iCAAiC;CAC/C;CACA,OAAO;AACT;AAGA,SAAgB,wBAAwB,MAAsC;CAC5E,MAAM,OAAO,KAAK;CAClB,OAAO,CAAC,EACN,KAAK,eAAe,OACpB,KAAK,UAAU,sCACf,MAAM,SAAS,EAAE,EAAE,SAAS,SAC1B,mDACF;AAEJ;AAEA,SAAgB,qBAAqB,KAAyB;CAC5D,MAAM,OAAO,IAAI;CACjB,OAAO,CAAC,CAAC,QAAQ,wBAAwB,IAAI;AAC/C"}
1
+ {"version":3,"file":"ecr.js","names":[],"sources":["../../../../lib/modules/datasource/docker/ecr.ts"],"sourcesContent":["import type { ECRClientConfig } from '@aws-sdk/client-ecr';\nimport { ECR } from '@aws-sdk/client-ecr';\nimport { logger } from '../../../logger/index.ts';\nimport type { HostRule } from '../../../types/index.ts';\nimport type { HttpError } from '../../../util/http/index.ts';\nimport type { HttpResponse } from '../../../util/http/types.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { addSecretForSanitizing } from '../../../util/sanitize.ts';\n\nexport const ecrRegex = regEx(\n /\\d+\\.(?:dkr\\.ecr|dkr-ecr)(?:-fips)?\\.(?<region>[-a-z0-9]+)\\.(?:amazonaws\\.com|on\\.aws|amazonaws\\.com\\.cn|on\\.amazonwebservices\\.com\\.cn|amazonaws\\.eu|on\\.amazonwebservices\\.eu|c2s\\.ic\\.gov|on\\.aws\\.ic\\.gov|sc2s\\.sgov\\.gov|on\\.aws\\.scloud|scloud\\.adc-e\\.uk|on\\.cloud-aws\\.adc-e\\.uk|csp\\.hci\\.ic\\.gov|on\\.aws\\.hci\\.ic\\.gov|)/,\n);\nexport const ecrPublicRegex = regEx(/public\\.ecr\\.aws|ecr-public\\.aws\\.com/);\n\nexport async function getECRAuthToken(\n region: string,\n opts: HostRule,\n): Promise<string | null> {\n const config: ECRClientConfig = { region };\n if (opts.username === `AWS` && opts.password) {\n logger.trace(\n `AWS user specified, encoding basic auth credentials for ECR registry`,\n );\n return Buffer.from(`AWS:${opts.password}`).toString('base64');\n }\n if (opts.username && opts.password) {\n logger.trace(\n `Using AWS accessKey to get Authorization token for ECR registry`,\n );\n config.credentials = {\n accessKeyId: opts.username,\n secretAccessKey: opts.password,\n ...(opts.token && { sessionToken: opts.token }),\n };\n }\n\n const ecr = new ECR(config);\n try {\n const data = await ecr.getAuthorizationToken({});\n const authorizationToken = data?.authorizationData?.[0]?.authorizationToken;\n if (authorizationToken) {\n // sanitize token\n addSecretForSanitizing(authorizationToken);\n return authorizationToken;\n }\n logger.warn(\n 'Could not extract authorizationToken from ECR getAuthorizationToken response',\n );\n } catch (err) {\n logger.trace({ err }, 'err');\n logger.warn('ECR getAuthorizationToken error');\n }\n return null;\n}\n\n// https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_DescribeRepositories.html#ECR-DescribeRepositories-request-maxResults\nexport function isECRMaxResultsResponse(resp: HttpResponse<unknown>): boolean {\n const body = resp.body as { errors?: { message?: string }[] } | undefined;\n return !!(\n resp.statusCode === 405 &&\n resp.headers?.['docker-distribution-api-version'] &&\n body?.errors?.[0]?.message?.includes(\n 'Member must have value less than or equal to 1000',\n )\n );\n}\n\nexport function isECRMaxResultsError(err: HttpError): boolean {\n const resp = err.response as HttpResponse<unknown> | undefined;\n return !!resp && isECRMaxResultsResponse(resp);\n}\n"],"mappings":";;;;;AASA,MAAa,WAAW,MACtB,oUACF;AACA,MAAa,iBAAiB,MAAM,uCAAuC;AAE3E,eAAsB,gBACpB,QACA,MACwB;CACxB,MAAM,SAA0B,EAAE,OAAO;CACzC,IAAI,KAAK,aAAa,SAAS,KAAK,UAAU;EAC5C,OAAO,MACL,sEACF;EACA,OAAO,OAAO,KAAK,OAAO,KAAK,UAAU,CAAC,CAAC,SAAS,QAAQ;CAC9D;CACA,IAAI,KAAK,YAAY,KAAK,UAAU;EAClC,OAAO,MACL,iEACF;EACA,OAAO,cAAc;GACnB,aAAa,KAAK;GAClB,iBAAiB,KAAK;GACtB,GAAI,KAAK,SAAS,EAAE,cAAc,KAAK,MAAM;EAC/C;CACF;CAEA,MAAM,MAAM,IAAI,IAAI,MAAM;CAC1B,IAAI;EAEF,MAAM,sBAAqB,MADR,IAAI,sBAAsB,CAAC,CAAC,EAAA,EACd,oBAAoB,EAAE,EAAE;EACzD,IAAI,oBAAoB;GAEtB,uBAAuB,kBAAkB;GACzC,OAAO;EACT;EACA,OAAO,KACL,8EACF;CACF,SAAS,KAAK;EACZ,OAAO,MAAM,EAAE,IAAI,GAAG,KAAK;EAC3B,OAAO,KAAK,iCAAiC;CAC/C;CACA,OAAO;AACT;AAGA,SAAgB,wBAAwB,MAAsC;CAC5E,MAAM,OAAO,KAAK;CAClB,OAAO,CAAC,EACN,KAAK,eAAe,OACpB,KAAK,UAAU,sCACf,MAAM,SAAS,EAAE,EAAE,SAAS,SAC1B,mDACF;AAEJ;AAEA,SAAgB,qBAAqB,KAAyB;CAC5D,MAAM,OAAO,IAAI;CACjB,OAAO,CAAC,CAAC,QAAQ,wBAAwB,IAAI;AAC/C"}
@@ -1,6 +1,6 @@
1
1
  import { regEx } from "../../../util/regex.js";
2
2
  //#region lib/modules/datasource/docker/google.ts
3
- const googleRegex = regEx(/(((eu|us|asia)\.)?gcr\.io|[a-z0-9-]+-docker\.pkg\.dev)/);
3
+ const googleRegex = regEx(/(?:(?:(?:eu|us|asia)\.)?gcr\.io|[a-z0-9-]+-docker\.pkg\.dev)/);
4
4
  //#endregion
5
5
  export { googleRegex };
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"google.js","names":[],"sources":["../../../../lib/modules/datasource/docker/google.ts"],"sourcesContent":["import { regEx } from '../../../util/regex.ts';\n\nexport const googleRegex = regEx(\n /(((eu|us|asia)\\.)?gcr\\.io|[a-z0-9-]+-docker\\.pkg\\.dev)/,\n);\n"],"mappings":";;AAEA,MAAa,cAAc,MACzB,wDACF"}
1
+ {"version":3,"file":"google.js","names":[],"sources":["../../../../lib/modules/datasource/docker/google.ts"],"sourcesContent":["import { regEx } from '../../../util/regex.ts';\n\nexport const googleRegex = regEx(\n /(?:(?:(?:eu|us|asia)\\.)?gcr\\.io|[a-z0-9-]+-docker\\.pkg\\.dev)/,\n);\n"],"mappings":";;AAEA,MAAa,cAAc,MACzB,8DACF"}
@@ -94,7 +94,7 @@ var BaseGoDatasource = class BaseGoDatasource {
94
94
  return await BaseGoDatasource.goGetDatasource(goModule);
95
95
  }
96
96
  static async goGetDatasource(goModule) {
97
- const pkgUrl = `https://${goModule.replace(regEx(/\.git(\/[a-z0-9/]*)?$/), "")}?go-get=1`;
97
+ const pkgUrl = `https://${goModule.replace(regEx(/\.git(?:\/[a-z0-9/]*)?$/), "")}?go-get=1`;
98
98
  const { body: html } = await BaseGoDatasource.http.getText(pkgUrl);
99
99
  const goSourceHeader = BaseGoDatasource.goSourceHeader(html, goModule);
100
100
  if (goSourceHeader) return goSourceHeader;