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

Backing up releases using fine grained token ends with an error #257

Conversation

dale-primer-e
Copy link
Contributor

This PR addresses #234

Summary

  • I change the request in download_file to be built by _construct_request as it handles authentication with fine grained tokens better
  • I updated the download_file params to include optional as_app and optional fine so these arguments can be passed into _construct_request

Problem

When downloading assets using a fine grained token you will get a "can't concat str to bytes" error. This is due to the fine grained token being concatenated onto bytes in the line:

request.add_header("Authorization", "Basic ".encode("ascii") + auth)

This is fixed by using the _construct_request function.

When downloading assets using a fine grained token you will get a "can't
concat str to bytes" error. This is due to the fine grained token being
concatenated onto bytes in the line:

`request.add_header("Authorization", "Basic ".encode("ascii") + auth)`

This is better handled in the function `_construct_request` so I changed
the lines that construct the request in `download_file` to use the
function `_construct_request` and updated the function signature to
reflect that.
@dale-primer-e dale-primer-e marked this pull request as draft March 14, 2024 02:16
@dale-primer-e dale-primer-e marked this pull request as ready for review March 14, 2024 02:46
@josegonzalez
Copy link
Owner

Seems like this fails linting.

That are triggering flake.
@dale-primer-e
Copy link
Contributor Author

Sorry, removed trailing whitespaces

@josegonzalez josegonzalez merged commit 2cd9061 into josegonzalez:master Mar 17, 2024
1 check passed
@josegonzalez josegonzalez changed the title 234 Backing up releases using fine grained token ends with an error Backing up releases using fine grained token ends with an error Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants