Skip to content

Commit

Permalink
Ignore bandit false positives
Browse files Browse the repository at this point in the history
  • Loading branch information
bschimke95 committed Feb 9, 2024
1 parent 4bc2828 commit 8091f18
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions charms/worker/k8s/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _distribute_cluster_tokens(self, relation: ops.Relation, token_type: str):
continue

name = unit.name.replace("/", "-")
token = self.api_manager.create_join_token(name, worker=token_type == "worker")
token = self.api_manager.create_join_token(name, worker=token_type == "worker") #nosec
content = {"token": token}
secret = self.app.add_secret(content)
secret.grant(relation, unit=unit)
Expand All @@ -131,10 +131,10 @@ def _create_cluster_tokens(self):
return

if peer := self.model.get_relation("cluster"):
self._distribute_cluster_tokens(peer, token_type="control-plane")
self._distribute_cluster_tokens(peer, token_type="control-plane") #nosec

if workers := self.model.get_relation("k8s-cluster"):
self._distribute_cluster_tokens(workers, token_type="worker")
self._distribute_cluster_tokens(workers, token_type="worker") #nosec

@on_error(
WaitingStatus("Waiting for enable components"), InvalidResponseError, K8sdConnectionError
Expand Down Expand Up @@ -189,7 +189,7 @@ def _join_cluster(self):
if relation := self.model.get_relation("cluster"):
app_databag = relation.data.get(self.model.get_app("k8s"), {})
secret_id = app_databag.get(self.unit.name, "")
assert secret_id, "cluster:secret-id is not set"
assert secret_id, "cluster:secret-id is not set" #nosec
secret = self.model.get_secret(id=secret_id)
content = secret.get_content()
token = content["token"]
Expand Down

0 comments on commit 8091f18

Please sign in to comment.