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

🩹 [Patch]: Autoresolve IAT contexts when running commands to enterprise/org/user as an app #192

Open
MariusStorhaug opened this issue Dec 7, 2024 · 0 comments
Labels

Comments

@MariusStorhaug
Copy link
Contributor

MariusStorhaug commented Dec 7, 2024

Describe the change

Seems something is not as it should for the autoloading mechanism. It doesnt seem to catch the desired target, i.e. enterprise, org, user.

Again, when running a command that is targeted on either a ent, org, user, it should be able to detect this, find the correct installation, get a IAT, and use that for the call without swapping default context.

Process:

Connect-GitHub -ClientID <...> -PrivateKey <...>
# Creates a GitHub App context

Get-GitHubTeam -Organization PSModule
# Construct call to `Invoke-GitHubAPI`.
# - URL/Body/Headers
# - Context
# - Requirements

Invoke-GitHubAPI @params
# - Resolve the context, if string return object, if app, return applicable IAT.
# - Check AuthType to see if the context matches with the requirements (App, Installation, User).
# - Check that installation has permission to call the API
# - Run the call and return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

1 participant