Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Commit ca75369

Browse files
committed
Add token owner
1 parent 8359c06 commit ca75369

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ message: If you use this software, please cite it using these metadata.
33
title: Validate GitHub Tokens
44
abstract: A simple tool to validate a GitHub Token.
55
type: software
6-
version: 0.1.0
7-
date-released: 2024-05-25
6+
version: 0.1.1
7+
date-released: 2024-05-27
88
repository-code: https://github.com/GitHubToolbox/github-token-validator
99
keywords:
1010
- "Wolf Software"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name='wolfsoftware.github-token-validator',
15-
version='0.1.0',
15+
version='0.1.1',
1616
packages=['wolfsoftware.github_token_validator'],
1717
entry_points={
1818
'console_scripts': [

wolfsoftware/github_token_validator/token.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ def validate_token(config: SimpleNamespace) -> Dict[str, Any]:
5151
response.raise_for_status()
5252

5353
if response.status_code == 200:
54+
user: Any = response.json()
55+
json_data['owner'] = user['login']
5456
json_data['scopes'] = response.headers.get("X-OAuth-Scopes")
5557
json_data['rate_limit_limit'] = response.headers.get("X-RateLimit-Limit")
5658
json_data['rate_limit_remaining'] = response.headers.get("X-RateLimit-Remaining")
@@ -102,6 +104,7 @@ def display_token(data: Any) -> None:
102104
table = PrettyTable()
103105

104106
table.field_names = ["Name", "Value"]
107+
table.add_row(["Token Owner", data['owner']])
105108
table.add_row(["Token Scope", data['scopes']])
106109
table.add_row(["Rate Limit", data['rate_limit_limit']])
107110
table.add_row(["Rate Limit Used", data['rate_limit_used']])

0 commit comments

Comments
 (0)