oxidecomputer / third-party-api-clients

A place for keeping all our generated third party API clients.
https://docs.rs/octorust
MIT License
133 stars 56 forks source link

Discover GitHub token scope #17

Open kaplanelad opened 2 years ago

kaplanelad commented 2 years ago

Hey, We often want to know which access the token client has before executing the API request. I have added a small package called github-scopes-rs, which allows us to get the scope of the token. This package returns a boolean fields struct (mapped to the GitHub checkboxes permission via the UI).

GitHub Scope Documentation

I have created an example file:

cargo run --example get_token_scopes
kaplanelad commented 2 years ago

He @jessfraz, what do you think about my PR?

kaplanelad commented 2 years ago

@jessfraz ?

augustuswm commented 2 years ago

Hi @kaplanelad, we are not likely to merge this currently. The clients in this repo are specifically generated based on OpenAPI specs (as defined by a given service). I can look in to seeing if there is something in the spec that we could generate this data from. I think for now it makes sense to keep it as a standalone crate.