Org as single line with company code, v1.0.4
This commit is contained in:
@@ -14,6 +14,18 @@ def _mask(s):
|
||||
return s[:4] + "*" * (len(s) - 8) + s[-4:]
|
||||
|
||||
|
||||
def _client_id(token):
|
||||
import base64, json
|
||||
try:
|
||||
parts = token.split(".")
|
||||
if len(parts) >= 2:
|
||||
payload = base64.urlsafe_b64decode(parts[1] + "==")
|
||||
return json.loads(payload).get("ClientID", "")
|
||||
except Exception:
|
||||
pass
|
||||
return ""
|
||||
|
||||
|
||||
@bp.route("/", methods=["GET", "POST"])
|
||||
def index():
|
||||
env_token = current_app.config["NUBES_API_TOKEN"]
|
||||
@@ -75,6 +87,7 @@ def index():
|
||||
organization=org, error=error,
|
||||
env_token_masked=_mask(env_token),
|
||||
has_user_token=bool(user_token),
|
||||
client_id=_client_id(active_token),
|
||||
instance_groups=instance_groups)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user