-
Notifications
You must be signed in to change notification settings - Fork 29
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
fix: Tokens in config are no longer ignored when there are tokens in the environment, part of refactoring in preparation for app token refreshing #284
Conversation
ec6dbe0
to
78918b9
Compare
for more information, see https://pre-commit.ci
6459b3d
to
4d49dd0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @TrishGillett 🎉 . Just a nit about idiomatic pytest.
209e311
to
0aa5771
Compare
for more information, see https://pre-commit.ci
Quality Gate passedIssues Measures |
token_manager = AppTokenManager("12345;;key\\ncontent") | ||
assert token_manager.github_app_id == "12345" | ||
assert token_manager.github_private_key == "key\ncontent" | ||
assert token_manager.github_installation_id == "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that
tap-github/tap_github/authenticator.py
Line 132 in aade338
if github_installation_id is None: |
""
I think we either want to parse this as empty string and then change the other code to look for "falsy" or we want to parse this as "None" and then we do not need to change the code.
I have been getting
404 Client Error: Not Found for url: https://api.github.com/app/installations//access_tokens
post this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @camerondavison, thanks for reporting and sorry this change caused an issue. Taking a look now. 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put up a PR to fix this here, if you like you can try pegging your version of the tap to the commit 38e1bdf9381c3a3fa17cceada9e1ede7be57ae6b
to see if it fixes your issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've also tagged v1.4.8
…#291) Addresses the problem described by @camerondavison [here](#284 (comment)), and introduced in #284. If not provided, installation ID should be set to None, since that is the way `generate_app_access_token` expects a missing installation ID to be represented.
This PR continues the work started in #281, completing the major refactor. This is accomplished by creating PersonalTokenManager and AppTokenManager classes, moving logic to them, and adding tests.
After this PR, I'll be able to easily implement refreshing for app tokens and other app token related features.
In additional to the added unit tests, I have tested running an extractor on top of the proposed code, in a couple scenarios:
I am not easily able to test the case of personal tokens being detected from the environment, just because changing the name of environment variables is not simple in my set up.