Skip to content

Commit

Permalink
Safe label username
Browse files Browse the repository at this point in the history
  • Loading branch information
diocas committed Sep 1, 2023
1 parent facd819 commit 20b5d23
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions swan-cern/files/swan_config_cern.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os, subprocess
import escapism

from kubernetes_asyncio.client.models import (
V1EmptyDirVolumeSource,
Expand Down Expand Up @@ -41,8 +42,11 @@ async def get_swan_user_pod(self):
return self.pod

async def _init_eos_secret(self):
username = self.spawner.user.name
eos_secret_name ='eos-tokens-%s' % username

username = escapism.escape(
self.spawner.user.name, safe = self.spawner.safe_chars, escape_char = '-'
).lower()
eos_secret_name = 'eos-tokens-%s' % username

try:
# Retrieve eos token for user
Expand Down

0 comments on commit 20b5d23

Please sign in to comment.