Open simevo opened 6 years ago
see https://developer.github.com/v3/#authentication
the user_name
parameter is not used, and the OAuth2 token can be passed as a parameter with the url:
url = url + "&access_token=" + credentials['token']
PR ?
My patch to make it work:
20c20,21
< r = requests.get(url=url, auth=(credentials['user_name'], credentials['token']), headers={'Content-type': 'application/json'})
---
> url = url + "&access_token=" + credentials['token']
> r = requests.get(url=url, headers={'Content-type': 'application/json'})
28c29,30
< r = requests.post(url=url, data=data, auth=(credentials['user_name'], credentials['token']), headers={'Content-type': 'application/json', 'Accept': 'application/vnd.github.v3.html+json'})
---
> url = url + "&access_token=" + credentials['token']
> r = requests.post(url=url, data=data, headers={'Content-type': 'application/json', 'Accept': 'application/vnd.github.v3.html+json'})
86c88
< url = destination_url+"repos/"+destination+"/milestones"
---
> url = destination_url+"repos/"+destination+"/milestones?"
136c138
< url = destination_url+"repos/"+destination+"/issues"
---
> url = destination_url+"repos/"+destination+"/issues?"
199c201
< destination_credentials = {'user_name': args.destinationUserName, 'token': args.destinationToken}
---
> destination_credentials = source_credentials
This will stop working at some point though: https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param
fails with 401