Fixes TelegramMessenger/Telegram-iOS#1613#1614
Fixes TelegramMessenger/Telegram-iOS#1613#1614artyom-89 wants to merge 1 commit intoTelegramMessenger:masterfrom
Conversation
|
@laktyushin Please merge this. We catch hundreds of sentry errors every day
|
SoeAung95
left a comment
There was a problem hiding this comment.
gh extension install github/gh-copilot
SoeAung95
left a comment
There was a problem hiding this comment.
#!/usr/bin/env bash
set -o pipefail
client_id=$1 # Client ID as first argument
pem=$( cat $2 ) # file path of the private key as second argument
now=$(date +%s)
iat=$((${now} - 60)) # Issues 60 seconds in the past
exp=$((${now} + 600)) # Expires 10 minutes in the future
b64enc() { openssl base64 | tr -d '=' | tr '/+' '_-' | tr -d '\n'; }
header_json='{
"typ":"JWT",
"alg":"RS256"
}'
Header encode
header=$( echo -n "${header_json}" | b64enc )
payload_json="{
"iat":${iat},
"exp":${exp},
"iss":"${client_id}"
}"
Payload encode
payload=$( echo -n "${payload_json}" | b64enc )
Signature
header_payload="${header}"."${payload}"
signature=$(
openssl dgst -sha256 -sign <(echo -n "${pem}")
<(echo -n "${header_payload}") | b64enc
)
Create JWT
JWT="${header_payload}"."${signature}"
printf '%s\n' "JWT: $JWT"
|
Welcome |
|
Please guys merge it finally. Just a typo during function rename, and it causes so much pain 🙏 |
|
@Kharabet, @maltsev25, @xximwon, @Pjrich1313, @Olevordkiy32, @kennet31526, @Brent108-gjgy, @Kashy9027, team, when it will be released? Very annoying bug, please help |
|
Additionally, I created a bug report here https://bugs.telegram.org/c/48753, on a specialized telegram platform |
|
We are collecting 3k Sentry events for the last 90 days just because of this typo |

No description provided.