-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add missing permissions to InstallationPermissions #1180
Conversation
This adds the remaining GitHub App installation permissions defined in https://developer.github.com/v3/apps/permissions/#metadata-permissions that are related to GitHub App installations. These do not include permissions such as `emails` or `gpg_keys` as these are user permissions.
Codecov Report
@@ Coverage Diff @@
## master #1180 +/- ##
=======================================
Coverage 70.25% 70.25%
=======================================
Files 84 84
Lines 5867 5867
=======================================
Hits 4122 4122
Misses 956 956
Partials 789 789
Continue to review full report at Codecov.
|
Thank you, @tarebyte! I'm looking around the GitHub API v3 Developer docs, and am having troubles finding these added fields. Where did you find these? |
The permissions are listed here: https://developer.github.com/v3/apps/permissions
Yup! The string is either An example of this would be the
Happy to, is https://developer.github.com/v3/apps/permissions/ sufficient? |
Hmmm... I'm still confused. Let's take an example. |
That's an Enterprise only permission, it's located in https://developer.github.com/enterprise/2.17/v3/apps/permissions/ |
Ah! Great, thanks. Then can you please add the two URLs in the comment? // Hook names taken from:
// https://developer.github.com/v3/apps/permissions/
// https://developer.github.com/enterprise/2.17/v3/apps/permissions/ Thank you! |
Done in a8d3df2 |
// | ||
// Permission names taken from: | ||
// https://developer.github.com/v3/apps/permissions/ | ||
// https://developer.github.com/enterprise/v3/apps/permissions/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will redirect to the latest Enterprise version.
https://developer.github.com/enterprise/v3/apps/permissions/ -> https://developer.github.com/enterprise/2.17/v3/apps/permissions/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Awaiting second LGTM before merging.
ContentReferences *string `json:"content_references,omitempty"` | ||
Deployments *string `json:"deployments,omitempty"` | ||
Issues *string `json:"issues,omitempty"` | ||
Metadata *string `json:"metadata,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the following documentation:
https://developer.github.com/apps/building-github-apps/creating-github-apps-using-url-parameters/#github-app-permissions
It seems like this should be RepositoryMetadata
, and more importantly, the JSON key should be repository_metadata
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@itsdalmo that seems to be an error in the docs, the key from the response is definitely metadata
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @itsdalmo and @tarebyte!
Would one of you please volunteer to contact [email protected] and let them know about the documentation error? They are typically very responsive, friendly, and helpful, and this would be appreciated feedback. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would one of you please volunteer to contact [email protected] and let them know about the documentation error?
I can file an internal issue, I work for GitHub 😃
They are typically very responsive, friendly, and helpful, and this would be appreciated feedback. Thank you!
💖
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, uh, Wow! I'm humbled and honored that you are helping us out here, @tarebyte!!!
You and your team have been an absolute joy to work with! I have a bunch of virtual friends at GitHub Tech Support. Thanks for all you do!
So let's see... all I need is another LGTM and we are good to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, uh, Wow! I'm humbled and honored that you are helping us out here, @tarebyte!!!
You and your team have been an absolute joy to work with! I have a bunch of virtual friends at GitHub Tech Support. Thanks for all you do!
It's my pleasure! Thank you for working on such a ✨ library
@itsdalmo - since you reviewed the code, can I please get an LGTM from you and we can merge this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick review, as requested by @gmlewis. I've based it on the following documentation:
https://developer.github.com/apps/building-github-apps/creating-github-apps-using-url-parameters/#github-app-permissions
According to the documentation there seems to be some missing permissions still:
blocking
emails
followers
gpg_keys
keys
packages
plan
starring
watching
With the exception of watching
, all of these seem to be present in the V3 documentation as well:
https://developer.github.com/v3/apps/permissions/#github-app-permissions
Unless both docs are wrong I think we should add these missing permissions as well? 😅
@itsdalmo, those are all user permissions that aren’t granted to an app installation. These are only requested and granted when a user goes through the authorization flow and the GitHub App gets a “user to server” token. |
Ooo actually I think I’ll double check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are only requested and granted when a user goes through the authorization flow and the GitHub App gets a “user to server” token.
Thanks for clarifying @tarebyte - LGTM
d7d3fde
to
699efa9
Compare
699efa9
to
d2e7e74
Compare
It looks like we have two LGTMs but also some more commits coming in. Just FYI, @tarebyte, we try not to use force pushes for PRs in this repo as it makes it more challenging for the reviewers to see what changed, but no big deal. Sometimes we have to use them to clear up the CLA checker and make it happy. 😄 So I'm just checking in with you on the status... are we good to merge, or do you think there are other changes that need making first? |
Good to know thanks! This is good to go from my perspective, the missing packages permission was all I needed to add. |
This adds the remaining GitHub App installation permissions defined in https://developer.github.com/v3/apps/permissions/#metadata-permissions that are related to GitHub App installations.
These do not include permissions such as
emails
orgpg_keys
as these are user permissions.I think I found the relevant test(s) to update, but if there are more I can add please let me know.
✨ Thanks ✨