Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/1487.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added config validation for credential values ('username', 'cert', ...) to not be empty.
2 changes: 1 addition & 1 deletion pulp-glue/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ classifiers = [
"Typing :: Typed",
]
dependencies = [
"multidict>=6.0.5,<7.2",
"multidict>=6.0.5,<7.2", # SemVerIsh https://github.com/aio-libs/multidict/blob/master/RELEASE.md#versioning
"packaging>=22.0,<=26.3", # CalVer
"pydantic>=2.9.2,<3", # Stable with the exception of experimental features. https://pydantic.dev/docs/validation/latest/get-started/version-policy
"requests>=2.24.0,<2.35 ; python_version < '3.12'",
Expand Down
3 changes: 3 additions & 0 deletions src/pulp_cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ def validate_config(config: dict[str, t.Any], strict: bool = False) -> None:
errors.append(_("Failed to parse the 'base_path'."))
if "api_root" in config and (config["api_root"][0] != "/" or config["api_root"][-1] != "/"):
errors.append(_("'api_root' must begin and end with '/'"))
for key in ["username", "cert", "key", "client_id", "client_secret"]:
if config.get(key) == "":
errors.append(_("'{}' should not be an empty string.").format(key))
if "format" in config and config["format"].lower() not in FORMAT_CHOICES:
errors.append(_("'format' is not one of {choices}").format(choices=FORMAT_CHOICES))
if "verify_ssl" in config and not isinstance(config["verify_ssl"], bool):
Expand Down
Loading