saltext.github.utils.gh.deploy_keys

Operations on GitHub repository deploy keys.

saltext.github.utils.gh.deploy_keys.fingerprint(key)[source]

Return the OpenSSH-style SHA256 fingerprint of an SSH public key.

key

SSH public key.

saltext.github.utils.gh.deploy_keys.key_body(key)[source]

Reduce an SSH public key to its comparable part (type + base64 body), ignoring whitespace variations and the comment.

key

SSH public key.

saltext.github.utils.gh.deploy_keys.list_all(conn, repo_name, *, owner=None)[source]

Return all deploy keys of a repository.

conn

GitHubConnection to use.

repo_name

Repository name.

owner

Owner of the repository. Defaults to the connection’s owner.

saltext.github.utils.gh.deploy_keys.get(conn, repo_name, key_id, *, owner=None)[source]

Return the data of a single deploy key.

conn

GitHubConnection to use.

repo_name

Repository name.

key_id

Deploy key ID.

owner

Owner of the repository. Defaults to the connection’s owner.

Raises GitHubNotFoundError if the deploy key does not exist.

saltext.github.utils.gh.deploy_keys.create(conn, repo_name, title, key, *, read_only=False, owner=None)[source]

Add a deploy key to a repository. Returns the data of the created key.

Note that deploy keys are immutable, they can only be replaced.

conn

GitHubConnection to use.

repo_name

Repository name.

title

Display title of the deploy key.

key

SSH public key.

read_only

Deny write access to the repository for this key. Defaults to false.

owner

Owner of the repository. Defaults to the connection’s owner.

saltext.github.utils.gh.deploy_keys.delete(conn, repo_name, key_id, *, owner=None)[source]

Remove a deploy key from a repository.

conn

GitHubConnection to use.

repo_name

Repository name.

key_id

Deploy key ID.

owner

Owner of the repository. Defaults to the connection’s owner.