From 64858bab2b99928292f145ac4e5cf106dd275d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80?= Date: Mon, 4 May 2026 21:45:08 +0300 Subject: [PATCH] API Gitea: token 1 --- .gitignore | 6 +++++- API Gitea/Gitea.py | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 API Gitea/Gitea.py diff --git a/.gitignore b/.gitignore index 0949605..1686a94 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ .venv/ -.idea/ \ No newline at end of file +.idea/ +#Tokens +.env +*_token* +*.secret \ No newline at end of file diff --git a/API Gitea/Gitea.py b/API Gitea/Gitea.py new file mode 100644 index 0000000..ff06853 --- /dev/null +++ b/API Gitea/Gitea.py @@ -0,0 +1,10 @@ +import requests +import os +from dotenv import load_dotenv + +load_dotenv() + +TOKEN = os.getenv("GITEA_TOKEN") +headers = {"Authorization": f"token {TOKEN}"} +response = requests.get("https://git.vyatsu.ru/api/v1/user", headers=headers) +print(response.json()) \ No newline at end of file