File manager - Edit - /usr/share/lve-stats3/scripts/lvestats-jwt-helper
Back
#!/opt/cloudlinux/venv/bin/python3 """ lvestats-jwt-helper — Bridge to clcommon.lib.jwt_token for JWT validation. Imports: clcommon.lib.jwt_token Returns JSON to stdout: {"valid": true/false, "error": "..."|null} Usage: lvestats-jwt-helper check """ import json import sys def cmd_check(): try: from clcommon.lib.jwt_token import jwt_token_check is_valid, error_msg, _token_data = jwt_token_check() return { "valid": is_valid, "error": error_msg if not is_valid else None, } except ImportError as e: return {"valid": False, "error": "clcommon.lib.jwt_token not available: %s" % e} except Exception as e: return {"valid": False, "error": "%s: %s" % (type(e).__name__, e)} def main(): if len(sys.argv) < 2 or sys.argv[1] != "check": print("Usage: lvestats-jwt-helper check", file=sys.stderr) sys.exit(1) try: result = cmd_check() json.dump(result, sys.stdout) sys.stdout.write("\n") except Exception as e: print("lvestats-jwt-helper: unexpected error: %s: %s" % (type(e).__name__, e), file=sys.stderr) sys.exit(1) if __name__ == "__main__": main()
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.04 |
proxy
|
phpinfo
|
Settings