loganintech / gitpub

A small program to create remote repos from the command line. https://crates.io/crates/gitpub
GNU General Public License v3.0
20 stars 4 forks source link

Azure DevOps support? #4

Open grimesjm opened 5 years ago

grimesjm commented 5 years ago

Thoughts?

I might be able to help with this one if you are interested.

loganintech commented 5 years ago

I'm happy to review pull requests, but if you have a link to the api docs regarding creating repositories / authentication I'd be glad to look into this.

grimesjm commented 5 years ago

Repositories: https://docs.microsoft.com/en-us/rest/api/azure/devops/git/repositories?view=azure-devops-rest-5.0

Auth: https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-5.0#authenticate

loganintech commented 5 years ago

Ahh, beautiful. If I get time I'll take a look tonight otherwise I should have time to work on it this weekend :+1:

loganintech commented 5 years ago

Added a bit of work here: https://github.com/loganintech/gitpub/tree/provider/azure

Their endpoint doesn't lend itself nicely to StructOpt (as it's not very flat) but worst-comes-to-worst we can always just do a custom Clap app.

loganintech commented 5 years ago

Well, this is proving to be significantly more challenging than anticipated. I can't seem to find a good way to authenticate. I'm going to have to slap this with the help wanted ticket and I'll leave the branch how it is so that people can see it. Also, here's the information I've understood so far.

Azure has a thousand ways to authenticate and none of them are what I want (as far as I can tell). The linked help documentation suggests using the Device Profile auth method. In their old and new samples they take advantage of .NET's Aquire Device Code Async that I can't seem and documentation sufficient to re-implement it. Their sample's get token function uses that and AquireTokenByDeviceCodeAsync which doesn't really help me out much either. At this point I've tried to implement and re-implement this feature so many times it's burning me out, so I'm going to pivot to other forms of updates and maintenance for the time being.