Skip to content

Commit b636d8b

Browse files
committed
Change the variable name
1 parent 565721b commit b636d8b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ it can be provided by **either** of the following methods:
3636
* You will need to set the following environment variables:
3737
```
3838
APP_AUTH_ID=<id_of_your_github_app>
39-
B64_APP_AUTH_PRIVATE_KEY=<private_key_of_your_github_app_bas64_encoded>
39+
APP_AUTH_PRIVATE_KEY_B64=<private_key_of_your_github_app_bas64_encoded>
4040
APP_AUTH_INSTALLATION_ID=<installtion_id_once_installed>
4141
```
4242
* Please refer to Github's offical documentation to know what these values are and where can you find them
@@ -70,7 +70,7 @@ You can do this in two ways:
7070
```bash
7171
docker run -p 8000:8000 \
7272
-e APP_AUTH_ID="<id_of_your_github_app>" \
73-
-e B64_APP_AUTH_PRIVATE_KEY="<private_key_of_your_github_app_base64_encoded>" \
73+
-e APP_AUTH_PRIVATE_KEY_B64="<private_key_of_your_github_app_base64_encoded>" \
7474
-e APP_AUTH_INSTALLATION_ID="<installtion_id_once_installed>" \
7575
-e BASIC_AUTH_USERNAME="<your_username>" \
7676
-e BASIC_AUTH_PASSWORD="<your_password>" \

src/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010

1111
GITHUB_TOKEN = os.environ.get("GITHUB_TOKEN")
1212
APP_AUTH_ID = os.environ.get("APP_AUTH_ID")
13-
B64_APP_AUTH_PRIVATE_KEY = os.environ.get("B64_APP_AUTH_PRIVATE_KEY")
13+
APP_AUTH_PRIVATE_KEY_B64 = os.environ.get("APP_AUTH_PRIVATE_KEY_B64")
1414
APP_AUTH_INSTALLATION_ID = os.environ.get("APP_AUTH_INSTALLATION_ID")
1515
APP_AUTH_BASE_URL = "https://api.github.com"

src/helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
APP_AUTH_ID,
1515
APP_AUTH_BASE_URL,
1616
APP_AUTH_INSTALLATION_ID,
17-
B64_APP_AUTH_PRIVATE_KEY,
17+
APP_AUTH_PRIVATE_KEY_B64,
1818
)
1919

2020

@@ -45,15 +45,15 @@ def get_token():
4545
token = GITHUB_TOKEN
4646
elif args.mode == "app-auth":
4747
app_auth_id = APP_AUTH_ID
48-
B64_APP_AUTH_PRIVATE_KEY = decode_base64(B64_APP_AUTH_PRIVATE_KEY)
48+
APP_AUTH_PRIVATE_KEY_B64 = decode_base64(APP_AUTH_PRIVATE_KEY_B64)
4949
app_auth_installation_id = APP_AUTH_INSTALLATION_ID
5050
app_auth_base_url = APP_AUTH_BASE_URL
5151

5252
now = datetime.datetime.utcnow()
5353
iat = int((now - datetime.datetime(1970, 1, 1)).total_seconds())
5454
exp = iat + 600
5555
payload = {"iat": iat, "exp": exp, "iss": app_auth_id}
56-
encoded_jwt = jwt.encode(payload, B64_APP_AUTH_PRIVATE_KEY, algorithm="RS256")
56+
encoded_jwt = jwt.encode(payload, APP_AUTH_PRIVATE_KEY_B64, algorithm="RS256")
5757
headers = {
5858
"Authorization": f"Bearer {encoded_jwt}",
5959
"Accept": "application/vnd.github.v3+json",

0 commit comments

Comments
 (0)