Update .gitea/workflows/build.yaml
Build, Push and Validate Frontend / build (push) Successful in 8m42s
Build, Push and Validate Frontend / build (push) Successful in 8m42s
This commit is contained in:
+14
-14
@@ -334,31 +334,31 @@ jobs:
|
||||
TOKEN_METADATA="$(
|
||||
printf '%s' "${EFFECTIVE_TOKEN}" |
|
||||
python3 -c '
|
||||
import base64
|
||||
import datetime
|
||||
import json
|
||||
import sys
|
||||
import base64
|
||||
import datetime
|
||||
import json
|
||||
import sys
|
||||
|
||||
token = sys.stdin.read().strip()
|
||||
parts = token.split(".")
|
||||
if len(parts) != 3:
|
||||
token = sys.stdin.read().strip()
|
||||
parts = token.split(".")
|
||||
if len(parts) != 3:
|
||||
print("formato=no-jwt")
|
||||
raise SystemExit(0)
|
||||
|
||||
payload = parts[1] + "=" * (-len(parts[1]) % 4)
|
||||
data = json.loads(base64.urlsafe_b64decode(payload.encode()))
|
||||
payload = parts[1] + "=" * (-len(parts[1]) % 4)
|
||||
data = json.loads(base64.urlsafe_b64decode(payload.encode()))
|
||||
|
||||
subject = data.get("sub", "desconocido")
|
||||
expiration = data.get("exp")
|
||||
subject = data.get("sub", "desconocido")
|
||||
expiration = data.get("exp")
|
||||
|
||||
if expiration is None:
|
||||
if expiration is None:
|
||||
print(f"subject={subject}; expiracion=sin-exp")
|
||||
else:
|
||||
else:
|
||||
when = datetime.datetime.fromtimestamp(
|
||||
expiration, datetime.timezone.utc
|
||||
).isoformat()
|
||||
print(f"subject={subject}; expiracion={when}")
|
||||
'
|
||||
'
|
||||
)"
|
||||
|
||||
echo "Identidad del token: ${TOKEN_METADATA}"
|
||||
|
||||
Reference in New Issue
Block a user