python-github3 icon indicating copy to clipboard operation
python-github3 copied to clipboard

Add `read_only` parameter to Key schema

Open jonathanchu opened this issue 10 years ago • 0 comments

What's this PR do?

The GitHub API create Key method also takes in a read_only parameter to set keys to read-only. This PR adds the field to the schema so it can be properly passed through.

https://developer.github.com/v3/repos/keys/#create

Previously, this would create new keys with "read/write" access, which GitHub sets by default. Now, this matches their API parameters and allows the keys to be set as read-only. If the read_only field is omitted, it will default to "read/write".

Usage:

key_params = {
    'title': 'Title of your key',
    'key': <public_key>,
    'read-only': True,
}

jonathanchu avatar Nov 05 '15 22:11 jonathanchu