Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Personal Access Token validity checks #280

Merged
merged 9 commits into from
Jan 9, 2024
Merged

Conversation

dabico
Copy link
Member

@dabico dabico commented Jan 9, 2024

The GitHubTokenManager is now an InitializingBean. Apart from the regular logging and init logic that was previously used in the @PostConstruct method, it now also verifies that each specified token:

  • Is not expired or invalidated
  • Has the correct repo scope

This PR also introduces utilities for referencing GitHub-specific headers and media types.

dabico added 9 commits January 9, 2024 00:17
This utility class will be used to store the names of all the `X`
headers from GitHub
This utility class only holds one `MediaType` specific to GitHub that we
use in the app. Might be further extended in the future.
Also includes a new `GitHubHttpHeaders` value
This is encapsulated in the aptly named `GitHubTokenValidator`, and
required some custom values in `GitHubHttpHeaders`
@dabico dabico merged commit 0791043 into master Jan 9, 2024
5 checks passed
@dabico dabico deleted the enhancement/tokens branch January 16, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant