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

The webhook doesn't use down-scoped tokens #287

Open
mattmoor opened this issue May 20, 2024 · 0 comments
Open

The webhook doesn't use down-scoped tokens #287

mattmoor opened this issue May 20, 2024 · 0 comments

Comments

@mattmoor
Copy link
Member

The webhook should be down-scoping tokens similar to the other paths like this:

app/pkg/octosts/octosts.go

Lines 264 to 272 in 8f1603b

atr := ghinstallation.NewFromAppsTransport(s.atr, install)
// We only need to read from the repository, so create that token to fetch
// the trust policy.
atr.InstallationTokenOptions = &github.InstallationTokenOptions{
Repositories: []string{trustPolicyKey.repo},
Permissions: &github.InstallationPermissions{
Contents: ptr("read"),
},
}

It has several places it does something like this:

Transport: ghinstallation.NewFromAppsTransport(e.Transport, installationID),

cc @wlynch @cpanato

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant