Skip to content

Commit

Permalink
Search for 'Bearer ' string to be removed to extract token
Browse files Browse the repository at this point in the history
  • Loading branch information
jdorsch committed Nov 23, 2023
1 parent ccc572f commit 5903e3b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ tag_release:
else
echo "The tag does not belong to master the branch";
exit 0
exit 1
fi
when: on_success
Expand Down
8 changes: 4 additions & 4 deletions src/certificator/certificator.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ def check_user_auth(username,system):
# checks JWT from Keycloak, optionally validates signature. It only receives the content of header's auth pair (not key:content)
def check_header(header):

# header = "Bearer ey...", remove first 7 chars
token = header[7:]
# header = remove the "Bearer " string
token = header.replace("Bearer ","")
decoding_result = False
decoding_reason = ""

Expand Down Expand Up @@ -275,8 +275,8 @@ def check_header(header):
# returns username
def get_username(header):

# header = "Bearer ey...", remove first 7 chars
token = header[7:]
# header = remove the "Bearer " string
token = header.replace("Bearer ","")
decoding_result = False
decoding_reason = ""

Expand Down
8 changes: 4 additions & 4 deletions src/common/cscs_api_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def get_null_var(var):
# checks JWT from Keycloak, optionally validates signature. It only receives the content of header's auth pair (not key:content)
def check_header(header):

# header = "Bearer ey...", remove first 7 chars
token = header[7:]
# header = remove the "Bearer " string
token = header.replace("Bearer ","")
decoding_result = False
decoding_reason = ""

Expand Down Expand Up @@ -179,8 +179,8 @@ def check_header(header):
# returns username
def get_username(header):

# header = "Bearer ey...", remove first 7 chars
token = header[7:]
# header = remove the "Bearer " string
token = header.replace("Bearer ","")
decoding_result = False
decoding_reason = ""

Expand Down

0 comments on commit 5903e3b

Please sign in to comment.