Repository navigation
Conversation
|
This introduces external libraries (jwt, requests, pause), which the project has avoided so far. requirements.txt is empty, and setup.py builds install_requires from it. Since they aren't added there, they won't be installed, and because they're imported at module level, every install that upgrades to this would fail on startup, even for users not using --as-app-dynamic-token. I have other comments, but this is the first hurdle. It's up to @josegonzalez whether starting to take on external package requirements is OK. |
|
I don't want to add external dependencies - part of the charm of the codebase was that we did everything with the python stdlib. Not sure I care as much these days, but let me mull it over for a few days. |
|
Following up on the dependency question: I needed the same thing (nightly backups through a GitHub App instead of a PAT) and wrote a version that keeps the project stdlib-only, in case that helps settle it.
One trade-off worth stating: with this, the container reads the App's private key rather than a token that expires within the hour. Anyone who wants to keep the key out of the container can still mint tokens elsewhere and pass them with Separately, I found that Branch: master...capehart:python-github-backup:github-app-private-key @durist, you got here first, so I'm happy for you to pull this into #533 if you'd rather keep it to one PR. Otherwise I can open it separately and link back here, whichever @josegonzalez prefers. |
|
I am going to defer to @Iamrodos here :) |
|
Apologies, I have been traveling and unable to review this. Doing so now. |
|
I think we should go with @capehart's version, since it keeps us on the standard library. I had a look and the tests pass for me locally. Refreshing from the token's own @capehart, would you be up for opening it as its own PR? It'd be good to link back here and credit @durist for getting this started. Two things that might be worth considering:
|
This PR adds support for automatically creating and refreshing Github App Installation tokens. It works by creating a separate thread for token refresh. It uses the requests, jwt and pause modules. This is useful since Github App Installation tokens have higher rate limits, but expire in an hour.