Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

GitHub App permission `repository_metadata` "not supported"

I am following the instructions for creating a new installation token with reduced permissions at https://developer.github.com/v3/apps/#create-a-new-installation-token. This is working fine except that when I request `repository_metadata` like this:

 

payload = {
    'repository_ids': [ <id> ],
    'permissions': {
        'repository_metadata': 'read',
    }
}

I get the following error message:

 

> There is at least one permission resource that is not supported.

 

Interestingly the request succeeds if I use just `metadata` instead of `repository_metadata`, indicating that there is likely an inconsistency between the documentation and the code.

1 Reply
Copilot Lvl 2
Message 2 of 2

Re: GitHub App permission `repository_metadata` "not supported"

I have spotted another oddity with this API. If I make a request with `permissions` specified but with `repository_ids` missing or the empty list, then the `permissions` section is ignored. This occurs even if a permission is requested that the app doesn't have.

 

E.g. payload:

payload = {
    'repository_ids': [  ],
    'permissions': {
        'pull_requests': 'read',
    }
}

Response:

 

{
  "token": "<token>", 
  "repository_selection": "selected", 
  "expires_at": "2019-08-09T16:20:52Z", 
  "permissions": {
    "metadata": "read", 
    "pull_requests": "write"
  }
}