Skip to content
Draft
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
11 changes: 4 additions & 7 deletions src/dfe_engine/appmgmt/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@
SOURCE_FILE = "source.json"
"""scalo's own file names - the CLI chooses the directory and nothing else."""

SECRET_MARKERS = ("x-scalo-secret", "x-dfe-secret") # noqa: S105, RUF100 - schema keywords
"""The schema keywords an app uses to mark a field as credential material.

scalo writes ``x-scalo-secret``; an app built on an older scalo writes ``x-dfe-secret``.
"""
SECRET_MARKER = "x-scalo-secret" # noqa: S105, RUF100 - a schema keyword
"""The schema keyword scalo writes to mark a field as credential material."""

ENV_NAME = re.compile(r"^[A-Z][A-Z0-9_]*$")
"""What a key under ``extraEnv`` may be called.
Expand Down Expand Up @@ -822,8 +819,8 @@ def _wholly_secret(path: str, node: dict, root: dict) -> bool:


def _marked_secret(branch: dict) -> bool:
"""Whether a schema branch carries either secret marker."""
return any(branch.get(marker) for marker in SECRET_MARKERS)
"""Whether a schema branch carries the secret marker."""
return bool(branch.get(SECRET_MARKER))


def _masked(value: Any) -> Any:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
"string",
"null"
],
"x-dfe-secret": true,
"x-scalo-secret": true,
"writeOnly": true,
"default": null
},
Expand Down Expand Up @@ -446,7 +446,7 @@
"string",
"null"
],
"x-dfe-secret": true,
"x-scalo-secret": true,
"writeOnly": true
},
"bucket": {
Expand Down Expand Up @@ -477,7 +477,7 @@
"string",
"null"
],
"x-dfe-secret": true,
"x-scalo-secret": true,
"writeOnly": true
},
"credentials_path": {
Expand Down Expand Up @@ -506,15 +506,15 @@
"string",
"null"
],
"x-dfe-secret": true,
"x-scalo-secret": true,
"writeOnly": true
},
"sas_token": {
"type": [
"string",
"null"
],
"x-dfe-secret": true,
"x-scalo-secret": true,
"writeOnly": true
},
"container": {
Expand Down Expand Up @@ -548,7 +548,7 @@
},
"secret_key": {
"type": "string",
"x-dfe-secret": true,
"x-scalo-secret": true,
"writeOnly": true
},
"bucket": {
Expand Down
Loading
Loading