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
4 changes: 2 additions & 2 deletions requirements/v1/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ops >= 2.1.1
ops >= 2.1.1,<3.8.0
Comment thread
dragomirp marked this conversation as resolved.
pydantic>=2.11,<3
poetry-core
poetry-core
12 changes: 11 additions & 1 deletion tests/jubilant_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
TLS_ROOT_DIR = "/var/snap/charmed-etcd/current/tls"
CLIENT_PORT = 2379

TLSLIBID = "afd8c2bccf834997afce12c2706d2ede"
CLIENT_TLS_RELATION_NAME = "client-certificates"

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -73,9 +76,16 @@

tls_path = TLS_ROOT_DIR

for file in ["client.pem", "client.key", "client_ca.pem"]:
for file in ["client.pem", "client_ca.pem"]:
juju.scp(f"{unit}:{tls_path}/{file}", file)

private_key = get_secret_by_label_jubilant(
juju, label=f"{TLSLIBID}-private-key-{unit.split('/')[1]}-{CLIENT_TLS_RELATION_NAME}"
)["private-key"]

with open("client.key", "w") as f:
f.write(private_key)

Check failure

Code scanning / CodeQL

Clear-text storage of sensitive information High test

This expression stores
sensitive data (secret)
as clear text.
Comment thread
reneradoi marked this conversation as resolved.
Dismissed
Comment thread
dragomirp marked this conversation as resolved.


def get_secret_by_label_jubilant(juju: Juju, label: str) -> Dict[str, str]:
for secret in juju.secrets():
Expand Down