Skip to content

Commit

Permalink
Merge branch 'RESTAPI-972-allow-not-bearer-JWT' into 'master'
Browse files Browse the repository at this point in the history
Search for 'Bearer ' string to be removed to extract token

See merge request firecrest/firecrest!256
  • Loading branch information
Juan Pablo Dorsch committed Nov 23, 2023
2 parents 6b23b99 + 5903e3b commit 1951e11
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 1951e11

Please sign in to comment.