convert to gitea

This commit is contained in:
2025-09-15 13:35:51 +09:00
commit ef73e56eb9
38 changed files with 3314 additions and 0 deletions

26
create_jwt.py Normal file
View File

@ -0,0 +1,26 @@
# create_jwt.py
import jwt
import time
import base64
# ★★★★★ 1단계에서 생성한 동일한 비밀 키를 сюда 붙여넣습니다 ★★★★★
secret_key = "UGdiOTdLVjFBTWtndTRNRiZmVjdwMDdCRW1lSSUxTnA="
secret_key_64 = base64.b64decode(secret_key)
# 페이로드 데이터 정의 (이전과 동일)
payload = {
'sub': 'admin',
'roles': ['admin'],
'exp': int(time.time()) + 3600,
'iat': int(time.time())
}
# ★★★★★ JWT 생성 (알고리즘: HS256) ★★★★★
token = jwt.encode(
payload,
secret_key_64,
algorithm='HS256'
)
# 생성된 토큰 출력
print(token)