diff --git a/AUTHORS.rst b/AUTHORS.rst index 841a0b85..6b5828b9 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -222,3 +222,5 @@ Contributors - Andrew MacCormack (@amaccormack-lumira) - Chris R (@offbyone) + +- Thomas Buchner (@MrBatschner) diff --git a/src/github3/actions/__init__.py b/src/github3/actions/__init__.py new file mode 100644 index 00000000..8c8ff163 --- /dev/null +++ b/src/github3/actions/__init__.py @@ -0,0 +1,20 @@ +""" +github3.actions +============= + +Module which contains all GitHub Actions related material (only secrets +so far). + +See also: http://developer.github.com/v3/actions/ +""" +from .secrets import ( + OrganizationSecret, + RepositorySecret, + SharedOrganizationSecret, +) + +__all__ = ( + "OrganizationSecret", + "RepositorySecret", + "SharedOrganizationSecret", +) diff --git a/src/github3/actions/secrets.py b/src/github3/actions/secrets.py new file mode 100644 index 00000000..59f0db16 --- /dev/null +++ b/src/github3/actions/secrets.py @@ -0,0 +1,228 @@ +"""This module contains all the classes relating to GitHub Actions secrets.""" + +import typing + +from .. import models + + +class PublicKey(models.GitHubCore): + + """Object representing a Public Key for GitHub Actions secrets. + + See https://docs.github.com/en/rest/actions/secrets for more details. + + .. attribute:: key_id + + The ID of the public key + + .. attribute:: key + + The actual public key as a string + """ + + def _update_attributes(self, publickey): + self.key_id = publickey["key_id"] + self.key = publickey["key"] + + def _repr(self): + return f"" + + def __str__(self): + return self.key + + +class _Secret(models.GitHubCore): + + """Base class for all secrets for GitHub Actions. + + See https://docs.github.com/en/rest/actions/secrets for more details. + GitHub never reveals the secret value through its API, it is only accessible + from within actions. Therefore, this object represents the secret's metadata + but not its actual value. + """ + + class_name = "_Secret" + + def _repr(self): + return f"<{self.class_name} [{self.name}]>" + + def __str__(self): + return self.name + + def _update_attributes(self, secret): + self.name = secret["name"] + self.created_at = self._strptime(secret["created_at"]) + self.updated_at = self._strptime(secret["updated_at"]) + + +class RepositorySecret(_Secret): + """An object representing a repository secret for GitHub Actions. + + See https://docs.github.com/en/rest/actions/secrets for more details. + GitHub never reveals the secret value through its API, it is only accessible + from within actions. Therefore, this object represents the secret's metadata + but not its actual value. + + .. attribute:: name + + The name of the secret + + .. attribute:: created_at + + The timestamp of when the secret was created + + .. attribute:: updated_at + + The timestamp of when the secret was last updated + """ + + class_name = "RepositorySecret" + + +class SharedOrganizationSecret(_Secret): + """An object representing an organization secret for GitHub Actions that is + shared with the repository. + + See https://docs.github.com/en/rest/actions/secrets for more details. + GitHub never reveals the secret value through its API, it is only accessible + from within actions. Therefore, this object represents the secret's metadata + but not its actual value. + + .. attribute:: name + + The name of the secret + + .. attribute:: created_at + + The timestamp of when the secret was created + + .. attribute:: updated_at + + The timestamp of when the secret was last updated + """ + + class_name = "SharedOrganizationSecret" + + +class OrganizationSecret(_Secret): + """An object representing am organization secret for GitHub Actions. + + See https://docs.github.com/en/rest/actions/secrets for more details. + GitHub never reveals the secret value through its API, it is only accessible + from within actions. Therefore, this object represents the secret's metadata + but not its actual value. + + .. attribute:: name + + The name of the secret + + .. attribute:: created_at + + The timestamp of when the secret was created + + .. attribute:: updated_at + + The timestamp of when the secret was last updated + """ + + class_name = "OrganizationSecret" + + def _update_attributes(self, secret): + super()._update_attributes(secret) + self.visibility = secret["visibility"] + if self.visibility == "selected": + self._selected_repos_url = secret["selected_repositories_url"] + + def selected_repositories(self, number=-1, etag=""): + """Iterates over all repositories this secret is visible to. + + :param int number: + (optional), number of repositories to return. + Default: -1 returns all selected repositories. + :param str etag: + (optional), ETag from a previous request to the same endpoint + :returns: + Generator of selected repositories or None if the visibility of this + secret is not set to 'selected'. + :rtype: + :class:`~github3.repos.ShortRepository` + """ + from .. import repos + + if self.visibility != "selected": + return None + + return self._iter( + int(number), + self._selected_repos_url, + repos.ShortRepository, + etag=etag, + list_key="repositories", + ) + + def set_selected_repositories(self, repository_ids: typing.List[int]): + """Sets the selected repositories this secret is visible to. + + :param list[int] repository_ids: + A list of repository IDs which this secret should be visible to. + :returns: + A boolean indicating whether the update was successful. + :rtype: + bool + """ + if self.visibility != "selected": + raise ValueError( + """cannot set a list of selected repositories when visibility + is not 'selected'""" + ) + + data = {"selected_repository_ids": repository_ids} + + return self._boolean( + self._put(self._selected_repos_url, json=data), 204, 404 + ) + + def add_selected_repository(self, repository_id: int): + """Adds a repository to the list of repositories this secret is + visible to. + + :param int repository_id: + The IDs of a repository this secret should be visible to. + :raises: + A ValueError if the visibility of this secret is not 'selected'. + :returns: + A boolean indicating if the repository was successfully added to + the visible list. + :rtype: + bool + """ + if self.visibility != "selected": + raise ValueError( + "cannot add a repository when visibility is not 'selected'" + ) + + url = "/".join([self._selected_repos_url, str(repository_id)]) + return self._boolean(self._put(url), 204, 409) + + def delete_selected_repository(self, repository_id: int): + """Deletes a repository from the list of repositories this secret is + visible to. + + :param int repository_id: + The IDs of the repository this secret should no longer be + visible to. + :raises: + A ValueError if the visibility of this secret is not 'selected'. + :returns: + A boolean indicating if the repository was successfully removed + from the visible list. + :rtype: + bool + """ + if self.visibility != "selected": + raise ValueError( + "cannot delete a repository when visibility is not 'selected'" + ) + + url = "/".join([self._selected_repos_url, str(repository_id)]) + return self._boolean(self._delete(url), 204, 409) diff --git a/src/github3/orgs.py b/src/github3/orgs.py index 363fe357..1b0c9ce2 100644 --- a/src/github3/orgs.py +++ b/src/github3/orgs.py @@ -11,6 +11,8 @@ from .projects import Project from .repos import Repository from .repos import ShortRepository +from . import exceptions +from .actions import secrets as actionsecrets if t.TYPE_CHECKING: from . import users as _users @@ -1276,6 +1278,133 @@ def team_by_name(self, team_slug: str) -> t.Optional[Team]: json = self._json(self._get(url), 200) return self._instance_or_null(Team, json) + @requires_auth + def public_key(self) -> t.Optional[actionsecrets.PublicKey]: + """Retrieves an organizations public-key for GitHub Actions secrets + + :returns: + the public key of the organization + :rtype: + :class:`~github3.secrets.PublicKey` + """ + url = self._build_url( + "orgs", self.login, "actions", "secrets", "public-key" + ) + json = self._json(self._get(url), 200) + return self._instance_or_null(actionsecrets.PublicKey, json) + + @requires_auth + def secrets(self, number=-1, etag=None): + """Iterate over all GitHub Actions secrets of an organization. + + :param int number: + (optional), number of secrets to return. + Default: -1 returns all available secrets + :param str etag: + (optional), ETag from a previous request to the same endpoint + :returns: + Generator of organization secrets. + :rtype: + :class:`~github3.secrets.OrganizationSecret` + """ + url = self._build_url("orgs", self.login, "actions", "secrets") + return self._iter( + int(number), + url, + actionsecrets.OrganizationSecret, + etag=etag, + list_key="secrets", + ) + + @requires_auth + def secret(self, secret_name): + """Returns the organization secret with the given name. + + :param str secret_name: + Name of the organization secret to obtain. + :returns: + The organization secret with the given name. + :rtype: + :class:`~github3.secrets.OrganizationSecret` + """ + url = self._build_url( + "orgs", self.login, "actions", "secrets", secret_name + ) + json = self._json(self._get(url), 200) + return self._instance_or_null(actionsecrets.OrganizationSecret, json) + + @requires_auth + def create_or_update_secret( + self, secret_name, encrypted_value, visibility, selected_repo_ids=None + ): + """Creates or updates an organization secret. + + :param str secret_name: + Name of the organization secret to be created or updated. + :param str encrypted_value: + The value of the secret which was previously encrypted + by the organizations public key. + Check + https://developer.github.com/v3/actions/secrets#create-or-update-an-organization-secret + for how to properly encrypt the secret value before using + this function. + :param str visibility: + Visibility of this organization secret, must be one of 'all', + 'private' or 'selected'. + :param list[int] selected_repo_ids: + A list of repository IDs this secret should be visible to, required + if visibility is 'selected'. + :returns: + The secret that was just created or updated. + :rtype: + :class:`~github3.py.secrets.OrganizationSecret` + """ + data = {} + + if visibility not in ("all", "private", "selected"): + raise ValueError( + "visibility must be 'all', 'private' or 'selected'" + ) + data.update(visibility=visibility) + + if visibility == "selected": + if selected_repo_ids is None or len(selected_repo_ids) == 0: + raise ValueError( + "must supply a list of repos IDs for visibility 'selected'" + ) + else: + data.update(selected_repository_ids=selected_repo_ids) + + data.update(encrypted_value=encrypted_value) + data.update(key_id=self.public_key().key_id) + + url = self._build_url( + "orgs", self.login, "actions", "secrets", secret_name + ) + response = self._put(url, json=data) + if response.status_code not in (201, 204): + raise exceptions.error_for(response) + + # PUT for secrets does not return anything but having a secret + # object at least containing the timestamps would be nice + return self.secret(secret_name) + + @requires_auth + def delete_secret(self, secret_name): + """Deletes an organization secret. + + :param str secret_name: + The name of the secret to delete. + :returns: + A boolean indicating whether the secret was successfully deleted. + :rtype: + bool + """ + url = self._build_url( + "orgs", self.login, "actions", "secrets", secret_name + ) + return self._boolean(self._delete(url), 204, 404) + class Organization(_Organization): """Object for the full representation of a Organization. diff --git a/src/github3/repos/repo.py b/src/github3/repos/repo.py index 09303074..00ee4756 100644 --- a/src/github3/repos/repo.py +++ b/src/github3/repos/repo.py @@ -8,6 +8,7 @@ import json as jsonlib import uritemplate as urit +import typing from . import branch from . import comment @@ -38,6 +39,7 @@ from .. import pulls from .. import users from .. import utils +from ..actions import secrets as actionsecrets from ..issues import event as ievent from ..issues import label from ..issues import milestone @@ -2887,6 +2889,140 @@ def weekly_commit_count(self): del json["Last-Modified"] return json + @decorators.requires_auth + def public_key(self) -> typing.Optional[actionsecrets.PublicKey]: + """Retrieves a repositories public-key for GitHub Actions secrets + + :returns: + the public key of the repository + :rtype: + :class:`~github3.secrets.PublicKey` + """ + url = self._build_url( + "repos", self.owner, self.name, "actions", "secrets", "public-key" + ) + json = self._json(self._get(url), 200) + return self._instance_or_null(actionsecrets.PublicKey, json) + + @decorators.requires_auth + def secrets(self, number=-1, etag=None): + """Iterate over all GitHub Actions secrets of a repository. + + :param int number: + (optional), number of secrets to return. + Default: -1 returns all available secrets + :param str etag: + (optional), ETag from a previous request to the same endpoint + :returns: + Generator of repository secrets. + :rtype: + :class:`~github3.secrets.RepositorySecret` + """ + url = self._build_url( + "repos", self.owner, self.name, "actions", "secrets" + ) + return self._iter( + int(number), + url, + actionsecrets.RepositorySecret, + etag=etag, + list_key="secrets", + ) + + @decorators.requires_auth + def organization_secrets(self, number=-1, etag=None): + """Iterate over all GitHub Actions organization secrets that are + shared with this repository. + + :param int number: + (optional), number of secrets to return. + Default: -1 returns all available secrets + :param str etag: + (optional), ETag from a previous request to the same endpoint + :returns: + Generator of shared organization secrets. + :rtype: + :class:`~github3.secrets.SharedOrganizationSecret` + """ + + url = self._build_url( + "repos", self.owner, self.name, "actions", "organization-secrets" + ) + return self._iter( + int(number), + url, + actionsecrets.SharedOrganizationSecret, + etag=etag, + list_key="secrets", + ) + + @decorators.requires_auth + def secret(self, secret_name): + """Returns the repository secret with the given name. + + :param str secret_name: + Name of the repository secret to obtain. + :returns: + The repository secret with the given name. + :rtype: + :class:`~github3.secrets.RepositorySecret` + """ + url = self._build_url( + "repos", self.owner, self.name, "actions", "secrets", secret_name + ) + json = self._json(self._get(url), 200) + return self._instance_or_null(actionsecrets.RepositorySecret, json) + + @decorators.requires_auth + def create_or_update_secret(self, secret_name, encrypted_value): + """Creates or updates a repository secret. + + :param str secret_name: + Name of the repository secret to be created or updated. + :param str encrypted_value: + The value of the secret which was previously encrypted + by the repositorie's public key. + Check + https://developer.github.com/v3/actions/secrets#create-or-update-a-repository-secret + for how to properly encrypt the secret value before using + this function. + :returns: + The secret that was just created or updated. + :rtype: + :class:`~github3.py.secrets.RepositorySecret` + """ + data = { + "encrypted_value": encrypted_value, + "key_id": self.public_key().key_id, + } + + url = self._build_url( + "repos", self.owner, self.name, "actions", "secrets", secret_name + ) + response = self._put(url, json=data) + if response.status_code not in (201, 204): + raise exceptions.error_for(response) + + # PUT for secrets does not return anything but having a secret + # object at least containing the timestamps would be nice + return self.secret(secret_name) + + @decorators.requires_auth + def delete_secret(self, secret_name): + """Deletes a repository secret. + + :param str secret_name: + The name of the secret to delete. + :returns: + A boolean indicating whether the secret was successfully deleted. + :rtype: + bool + """ + url = self._build_url( + "repos", self.owner, self.name, "actions", "secrets", secret_name + ) + return self._boolean(self._delete(url), 204, 404) + class Repository(_Repository): """This organizes the full representation of a single Repository. diff --git a/tests/cassettes/OrganizationSecrets_add_repo_to_shared_secret.json b/tests/cassettes/OrganizationSecrets_add_repo_to_shared_secret.json new file mode 100644 index 00000000..29c2ea50 --- /dev/null +++ b/tests/cassettes/OrganizationSecrets_add_repo_to_shared_secret.json @@ -0,0 +1,760 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA61VTXPjRBD9K0ZnJ5b8lbWqKDgAOQCVosgB9jLVktryxKMZMR/2mlT++z592JGdwK4pfLJn+nVPv/e6/RwpU0odpVFJtmCtpA6fonEkiyhdJqv5PE7m40ibgkVzFP36w4+Hh+3q8HH6U6A/6k1xr3bZ05+fHh5/i3EXAxqsQuDG+9qlkwnV8raUfhOy29xUE2NLNzkvZbk2TlyFmrQY1OIda38tuAMBvTFmey24xTQEORf4WnAHArriKmN7LbxHPU+6Ly9IVIdMyVz8t3zn4GFa2pEneylKe+h6OYNjmxvtIUCrbJgc/fLd7ts5nlawy62svTSNvR43PMrY+dHD76O1saP71m5sRxVpKrkY/RzAiGbPbpSr4Dzo+QZZNFUMeBc++qW3JwrWpA9RqoNS4yiDiQeeG/jrVhokUSan/h33bFHx0HinIgmndhn8XnqUFE1XXcnuXDqxYyvXkuF+bwPDNeQEbExa/t0mFbU1T5x7NwxoDSq9sYc31z3rnYXTJDmJWErXJInH0dooZfZgIEqT6fGn1OgRlxtfqQtlBgN2Plu5ZfJcCPKgZxpP45t4dhN/eEyW6WyaLhYfwUOoi7MYBCxukuljMk3ju3S2amL8oW5UeBi03ZwaTwr9SRiDRd/Q3Tgye42aF+cf0Gcf+dpoId0WnMMAWDezWYygHL1TZiyBPPSP7ZNJhbVUil6wqCLl+faJdBEK+t5R3fivNdyagvLdQ3ruoTaGrrPg3krPiDsOS05adAS9QiSfZPR7I9aU4xm4/itIyxW8LlhTpho3rEk52OGYjVrJimH1NnnjkJ4+hLxffmiJ5uGDV7zz2DNivxwuMaPwtHq3yffSQ40TCcN7jO32XNVT8Z6LPWcCWlTSCydLbdbrI3Vv+Rqw37df/1PhXqRj32dxtSKsl+fjnoBCbBHoGqFdTTmMtbpbLpbT+Wr16sDeq6v2gwGDwyCdg1zofJkkMHH/Y5HEq9nLOKJiRzpvg/IAIx2ORhCgRWjeX9DbM1JwzbqAn70gxRb/Vb1/vhp2qtfN6VUJWOcHUVqqN19XFrUsQztoo9uJ67z+72+9BNXBbZql57ETG/P/L0ly/COYSmAPbN9M4JceMMB26/7lM9fqOeD2CAAA", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 12:57:36 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"deed4f9b30f709f900ecde6fac47c9d91b2aae62a65dd341f974c3d3cc8a2aa4\"" + ], + "Last-Modified": [ + "Fri, 12 May 2023 12:07:39 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org, read:org, repo, user, write:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4999" + ], + "X-RateLimit-Reset": [ + "1687355856" + ], + "X-RateLimit-Used": [ + "1" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "4B96:DEFC:588A5EF:5950EA2:6492F3C0" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux" + }, + "recorded_at": "2023-06-21T12:57:36" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/public-key" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA6tWyk6tjM9MUbJSMjWzMDI1MDQzNzIxMjWxNDcxVtIByQKlijwiIj1z9b2qfIN8it3NLAxN9C3cvXO9gnKCIwMzzN08/VOcyzz8/F0qi22VagFbbFfDVAAAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 12:57:37 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"8434271b3550491b7cefb89bdfe1b45031999379ccac2972d8b9f434c7870bcd\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4998" + ], + "X-RateLimit-Reset": [ + "1687355856" + ], + "X-RateLimit-Used": [ + "2" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "4B96:DEFC:588A85F:595112B:6492F3C0" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/public-key" + }, + "recorded_at": "2023-06-21T12:57:36" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "{\"encrypted_value\": \"9JgL1eNoSjB/9cmjYUI00ojLcLxidIgvspXw/g+vmEvlIgqafYXTe1sbVEsz3RyLEyu/\", \"key_id\": \"568250167242549743\", \"visibility\": \"selected\", \"selected_repository_ids\": [245713798]}" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "189" + ], + "Authorization": [ + "token " + ] + }, + "method": "PUT", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_shared_secret" + }, + "response": { + "body": { + "encoding": null, + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 12:57:37 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4997" + ], + "X-RateLimit-Reset": [ + "1687355856" + ], + "X-RateLimit-Used": [ + "3" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Vary": [ + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-GitHub-Request-Id": [ + "4B96:DEFC:588A93A:59511F9:6492F3C1" + ] + }, + "status": { + "code": 204, + "message": "No Content" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_shared_secret" + }, + "recorded_at": "2023-06-21T12:57:37" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_shared_secret" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA23PTQuCQBCA4f+y53T9qJS9RRndgvLUZVl10AF1ZWeMIvrvbYcgqNswPLzMPMRoBhBK7I9HfT5sTsVOn4vtqSjFQtQODEOjDXuQREkaROsgicsoV+lSrfKLN/PU/DVxolaZSrO3uSJhhT3y3XcIeqh91e8/o3YwWUK2DoH07HrPOuaJlJRmwrBF7uYqrO0grWtJtsY1MPY4zjdpakY7kiTw1zLJnz/kd1w8X+2Tv8XxAAAA", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 12:57:37 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"6def96c6068e90a71fa078e7db41ef9084e6442c6b2763bb8c64aac4dc19c205\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4996" + ], + "X-RateLimit-Reset": [ + "1687355856" + ], + "X-RateLimit-Used": [ + "4" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "4B96:DEFC:588AAB3:5951360:6492F3C1" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_shared_secret" + }, + "recorded_at": "2023-06-21T12:57:37" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "0" + ], + "Authorization": [ + "token " + ] + }, + "method": "PUT", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/FOO_SHARED_SECRET/repositories/517639342" + }, + "response": { + "body": { + "encoding": null, + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 12:57:37 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4995" + ], + "X-RateLimit-Reset": [ + "1687355856" + ], + "X-RateLimit-Used": [ + "5" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Vary": [ + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-GitHub-Request-Id": [ + "4B96:DEFC:588AB7C:595145A:6492F3C1" + ] + }, + "status": { + "code": 204, + "message": "No Content" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/FOO_SHARED_SECRET/repositories/517639342" + }, + "recorded_at": "2023-06-21T12:57:37" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/FOO_SHARED_SECRET/repositories?per_page=100" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA+2YUW/bNhDHv4qn13lmErvNHKDoQ7NlG5YZK1Kg3TAYlExLnClRIymnjuDvvjtSsmUHs+OQeRiQl8SWdT+ejnen47+OjDRUTBNZFSa6uuhHipVScyMVZzq6+rOO+Ayuj95cng8vx9/3o0LO2BSvRbfXP9xPxC8iuRk/0M8fl0mxWP12/Wl4e3c7nNyl7yK4meYM7kypmrFC8KL6ChfnlRDTx7+Q3btKxZfUgPWcCs36kbwvmIqu6kjIlBePoOjR2/PxaHR2PtpzcjVZjFd/XPxY0c9lNrsRy/jvL18nd7+fwQOcgT8U1qFqWikB1MyYUl8R4i7qQcpNVsWVZiqRhWGFGSQyJxVp13q/fDcCRqoaio0MXNijlbwhOXPA6b3nzUwu9nxwa1uLvQhKIeQ9MPadPrIMmbeGuA32My/S50HAsCbSZAwiB4+zxiBwbU52yRrVBP9BWiFGw24oNjvVrcYMnMJMWdcEM9nyqlgnipeGy+Jk93aMASZVSgv+QJ8FA2MNDFtipz6eNQJjtoQkPNnaWdXEVlWywrAoljC+hDg/j7hnDkCzKrHYJ50IYfS5YVM6y7FmbSmv+1BkT8z1vbyfsc1GwkI3tqv0fsW20vuud5exXsy0aS7Mpeq5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:38 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"332bb29eec6d7b92996544fa7939f6c9286ac0d1e6bcf68ebe15c6a1ae7988f1\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4994" + ], + "X-RateLimit-Reset": [ + "1687355856" + ], + "X-RateLimit-Used": [ + "6" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "4B96:DEFC:588AD66:5951644:6492F3C1" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/FOO_SHARED_SECRET/repositories?per_page=100" + }, + "recorded_at": "2023-06-21T12:57:38" + } + ], + "recorded_with": "betamax/0.8.1" +} \ No newline at end of file diff --git a/tests/cassettes/OrganizationSecrets_create_or_update_secret.json b/tests/cassettes/OrganizationSecrets_create_or_update_secret.json new file mode 100644 index 00000000..f9b7a6ff --- /dev/null +++ b/tests/cassettes/OrganizationSecrets_create_or_update_secret.json @@ -0,0 +1,1033 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA61VTXPiRhD9K0RnbIT48KKqVHJI4kOScqXiQ7KXqZbUiDGjGWU+YInL/32fPsACO9klFU4w0697+r3XzXOkTCl1lEYl2YK1kjp8isaRLKJ0OV3N5/F0Po60KVg0R9GvP/x4eNiuDh+TnwL9UW+Ke7XLnv789PD4W4y7GNBgFQI33tcunUyolrel9JuQ3eammhhbusl5Kcu1ceIq1KTFoBbvWPtrwR0I6I0x22vBLaYhyLnA14I7ENAVVxnba+E96nnSfXlBojpkSubiv+U7Bw/T0o482UtR2kPXyxkc29xoDwFaZcPk6Jfvdt/O8bSCXW5l7aVp7PW44VHGzo8efh+tjR3dt3ZjO6pIU8nF6OcARjR7dqNcBedBzzfIoqliwLvw0S+9PVGwJn2IUh2UGkcZTDzw3MBft9IgiTI59e+4Z4uKh8Y7FUk4tcvg99KjpGi66kp259KJHVu5lgz3exsYriEnYGPS8u82qaiteeLcu2FAa1DpjT28ue5Z7yycTuOTiKV0TRIcrI1SZg8GonSaHH9KjR5xufGVulBmMGDns5VbJs+FIA96kjiJb+LZTfzhcbpMZ0m6WHwED6EuzmIQsLiZJo/TJI3v0tmqifGHulHhYdB2c2o8KfQnYQwWfUN348jsNWpenH9An33ka6OFdFtwDgNg3cxmyWwc5eidMmMJ5KF/bJ9MKqylUvSCRRUpz7dPpItQ0PeO6sZ/reHWFJTvHtJzD7UxdJ0F91Z6RtxxWHLSoiPoFSL5JKPfG7GmHM/A9V9BWq7gdcGaMtW4YU3KwQ7HbNRKVgyrt8kbh/T0IeT98kNLNA8fvOKdx54R++VwiRmFp9W7Tb6XHmqcSBjeY2y356qeivdc7DkT0KKSXjhZarNeH6l7y9eA/b79+p8K9yId+z6LqxVhvTwf9wQUYotA1wjtasphrNXdcrFM5qvVqwN7r67aDwYMDoN0DnKh82V8h7P+x2Iar2Yv44iKHem8DcoDjHQ4GkGAFqF5f0Fvz0jBNesCfvaCFFv8V/X++WrYqV43p1clYJ0fRGmp3nxdWdSyDO2gjW4nrvP6v7/1ElQHt2mWnsdObMz/vyTJ8Y9gKoE9sH0zgV96wADbrfuXz3vvXev2CAAA", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 08:34:56 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"d3bb7463d29c84cd623b9a3bd218f31b0d8c273e554188441a8c5aec35f8e762\"" + ], + "Last-Modified": [ + "Fri, 12 May 2023 12:07:39 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org, read:org, repo, user, write:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4991" + ], + "X-RateLimit-Reset": [ + "1687339784" + ], + "X-RateLimit-Used": [ + "9" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "9A71:DEFC:46B136A:47587E3:6492B630" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux" + }, + "recorded_at": "2023-06-21T08:34:56" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/public-key" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA6tWyk6tjM9MUbJSMjWzMDI1MDQzNzIxMjWxNDcxVtIByQKlijwiIj1z9b2qfIN8it3NLAxN9C3cvXO9gnKCIwMzzN08/VOcyzz8/F0qi22VagFbbFfDVAAAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 08:34:57 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"8434271b3550491b7cefb89bdfe1b45031999379ccac2972d8b9f434c7870bcd\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4990" + ], + "X-RateLimit-Reset": [ + "1687339784" + ], + "X-RateLimit-Used": [ + "10" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "9A71:DEFC:46B15B5:4758A1D:6492B630" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/public-key" + }, + "recorded_at": "2023-06-21T08:34:57" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "{\"encrypted_value\": \"9JgL1eNoSjB/9cmjYUI00ojLcLxidIgvspXw/g+vmEvlIgqafYXTe1sbVEsz3RyLEyu/\", \"key_id\": \"568250167242549743\", \"visibility\": \"all\"}" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "144" + ], + "Authorization": [ + "token " + ] + }, + "method": "PUT", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_secret" + }, + "response": { + "body": { + "encoding": null, + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 08:34:57 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4989" + ], + "X-RateLimit-Reset": [ + "1687339784" + ], + "X-RateLimit-Used": [ + "11" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Vary": [ + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-GitHub-Request-Id": [ + "9A71:DEFC:46B1688:4758B17:6492B631" + ] + }, + "status": { + "code": 204, + "message": "No Content" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_secret" + }, + "recorded_at": "2023-06-21T08:34:57" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_secret" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA6tWykvMTVWyUnLz948PdnUOcg1R0lFKLkpNLElNiU8sAcoYGRgZ6xqY6RoZhhhYWBlZWpmYRgHVlBak4FJjbGJlag5SU5ZZnJmUmZNZUgk0JzEnR6kWADoHeiVwAAAA", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 08:34:57 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"47601fca2b47ebcad84e58f5c8015a3215a0332be3d5e59470a271acd5302a54\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4988" + ], + "X-RateLimit-Reset": [ + "1687339784" + ], + "X-RateLimit-Used": [ + "12" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "9A71:DEFC:46B1858:4758CCA:6492B631" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_secret" + }, + "recorded_at": "2023-06-21T08:34:57" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/public-key" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA6tWyk6tjM9MUbJSMjWzMDI1MDQzNzIxMjWxNDcxVtIByQKlijwiIj1z9b2qfIN8it3NLAxN9C3cvXO9gnKCIwMzzN08/VOcyzz8/F0qi22VagFbbFfDVAAAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 08:34:57 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"8434271b3550491b7cefb89bdfe1b45031999379ccac2972d8b9f434c7870bcd\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4987" + ], + "X-RateLimit-Reset": [ + "1687339784" + ], + "X-RateLimit-Used": [ + "13" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "9A71:DEFC:46B1943:4758DBE:6492B631" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/public-key" + }, + "recorded_at": "2023-06-21T08:34:57" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "{\"encrypted_value\": \"9JgL1eNoSjB/9cmjYUI00ojLcLxidIgvspXw/g+vmEvlIgqafYXTe1sbVEsz3RyLEyu/\", \"key_id\": \"568250167242549743\", \"visibility\": \"selected\", \"selected_repository_ids\": [245713798, 517639342]}" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "200" + ], + "Authorization": [ + "token " + ] + }, + "method": "PUT", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_shared_secret" + }, + "response": { + "body": { + "encoding": "utf-8", + "string": "{}" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 08:34:58 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "\"1923af92edfe862e341f7a5ce25631a4a86fd7165fd7a83f5228c919890ec865\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4986" + ], + "X-RateLimit-Reset": [ + "1687339784" + ], + "X-RateLimit-Used": [ + "14" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "X-GitHub-Request-Id": [ + "9A71:DEFC:46B1A2F:4758E98:6492B631" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_shared_secret" + }, + "recorded_at": "2023-06-21T08:34:58" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_shared_secret" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA4WPwQqCQBRF/2XW5ZhWiLsoo52grtoMoz70gTrDvDdRRP/ebIKgRbu7OPdw71MsegaRi3NZqvpyqIqTqotjVTRiJToHmqFXmgOQxEm6jvfrZNPEWZ5u8112DYy3/V/mhoQtTsiP4CGYoAvW0P1E5cAaQjYOgZR3U8BGZku5lNpiNCCPvo06M0vjBpKDdj0sEy7+LnXHaBaSBGEtk/z5Ib/l4vUGY7dSMfEAAAA=", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 08:34:58 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"5b44cd275c659668b8dff95d39c78216e7271de6d00873ebee65f05b401ba82c\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4985" + ], + "X-RateLimit-Reset": [ + "1687339784" + ], + "X-RateLimit-Used": [ + "15" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "9A71:DEFC:46B1B68:4758FF0:6492B632" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_shared_secret" + }, + "recorded_at": "2023-06-21T08:34:58" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/FOO_SHARED_SECRET/repositories?per_page=100" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA+2YUW/bNhDHv4qn13lmErvNHKDoQ7NlG5YZK1Kg3TAYlExLnClRIymnjuDvvjtSsmUHs+OQeRiQl8SWdT+ejnen47+OjDRUTBNZFSa6uuhHipVScyMVZzq6+rOO+Ayuj95cng8vx9/3o0LO2BSvRbfXP9xPxC8iuRk/0M8fl0mxWP12/Wl4e3c7nNyl7yK4meYM7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mX9uVQpBaiUPkXD49p8qiPv5Vf4ASQCll1f5w+lRx6SdV/ljky14Fto9uv9v5Q/XDHZ1jw8/kw/XvcpwoXtblcPJHthYfCSOpjehNHHyKxRs/UQNBIRVM5D4IjIGgv30CyQEES4QFFqxQGYAqQIxITUK5AUTJ+wW+qgSCAgoR7S4MDpESwsgQGwcC6M8IC6g5IC4QFpD41kjVUAr9RIZkNYFAM9HXbDOhZMVOjirS9infZ6e4B7U2gYREtp8C6YgtA6GlQ6Q+hKaQZs36G0AsaB5eBQawqkECPWWBxDyAroAYgMIAtvt9VcCkBVSArDh3ygI4c7+yH3xQz8uEuy0j7CQx3ybPFuZIFr/tf4XVRQ1RiMhAAA=", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 08:34:58 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"332bb29eec6d7b92996544fa7939f6c9286ac0d1e6bcf68ebe15c6a1ae7988f1\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4984" + ], + "X-RateLimit-Reset": [ + "1687339784" + ], + "X-RateLimit-Used": [ + "16" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "9A71:DEFC:46B1C64:47590EA:6492B632" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/FOO_SHARED_SECRET/repositories?per_page=100" + }, + "recorded_at": "2023-06-21T08:34:58" + } + ], + "recorded_with": "betamax/0.8.1" +} \ No newline at end of file diff --git a/tests/cassettes/OrganizationSecrets_delete_repo_from_shared_secret.json b/tests/cassettes/OrganizationSecrets_delete_repo_from_shared_secret.json new file mode 100644 index 00000000..50e79447 --- /dev/null +++ b/tests/cassettes/OrganizationSecrets_delete_repo_from_shared_secret.json @@ -0,0 +1,760 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA61VTXPjRBD9K0ZnJ5b8lbWqKDgAOQCVosgB9jLVktryxKMZMR/2mlT++z592JGdwK4pfLJn+nVP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+ "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 12:57:38 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"deed4f9b30f709f900ecde6fac47c9d91b2aae62a65dd341f974c3d3cc8a2aa4\"" + ], + "Last-Modified": [ + "Fri, 12 May 2023 12:07:39 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org, read:org, repo, user, write:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4993" + ], + "X-RateLimit-Reset": [ + "1687355856" + ], + "X-RateLimit-Used": [ + "7" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "C95D:D3D8:511269B:51D8F8D:6492F3C2" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux" + }, + "recorded_at": "2023-06-21T12:57:38" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/public-key" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA6tWyk6tjM9MUbJSMjWzMDI1MDQzNzIxMjWxNDcxVtIByQKlijwiIj1z9b2qfIN8it3NLAxN9C3cvXO9gnKCIwMzzN08/VOcyzz8/F0qi22VagFbbFfDVAAAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 12:57:39 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"8434271b3550491b7cefb89bdfe1b45031999379ccac2972d8b9f434c7870bcd\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4992" + ], + "X-RateLimit-Reset": [ + "1687355856" + ], + "X-RateLimit-Used": [ + "8" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "C95D:D3D8:5112900:51D9205:6492F3C2" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/public-key" + }, + "recorded_at": "2023-06-21T12:57:39" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "{\"encrypted_value\": \"9JgL1eNoSjB/9cmjYUI00ojLcLxidIgvspXw/g+vmEvlIgqafYXTe1sbVEsz3RyLEyu/\", \"key_id\": \"568250167242549743\", \"visibility\": \"selected\", \"selected_repository_ids\": [245713798, 517639342]}" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "200" + ], + "Authorization": [ + "token " + ] + }, + "method": "PUT", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_shared_secret" + }, + "response": { + "body": { + "encoding": null, + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 12:57:39 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4991" + ], + "X-RateLimit-Reset": [ + "1687355856" + ], + "X-RateLimit-Used": [ + "9" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Vary": [ + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-GitHub-Request-Id": [ + "C95D:D3D8:51129C9:51D92EE:6492F3C3" + ] + }, + "status": { + "code": 204, + "message": "No Content" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_shared_secret" + }, + "recorded_at": "2023-06-21T12:57:39" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_shared_secret" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA23PwQqCQBCA4XfZc7amWba3KKOboJ66LJsONqCu7IxRRO/edgiCug3Dx8/MQwymB6HEIc91edwW2V6X2a7IKjETtQPD0GjDHkRhFAfhKogWVZiqeKmS9OTNNDZ/zSJSyVrFm7e5IuEZO+S77xB0UPuq339G7WC0hGwdAunJdZ5dmEdSUpoR5y3yZTrPa9tL61qSrXENDB0O002amtEOJAn8tUzy5w/5HRfPF8ldjGDxAAAA", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 12:57:39 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"4e35acedaa42379e0f945afe30e0a4722ceb10df19bb5b123c458b19bbd41ad9\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4990" + ], + "X-RateLimit-Reset": [ + "1687355856" + ], + "X-RateLimit-Used": [ + "10" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "C95D:D3D8:5112B4C:51D9455:6492F3C3" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_shared_secret" + }, + "recorded_at": "2023-06-21T12:57:39" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "0" + ], + "Authorization": [ + "token " + ] + }, + "method": "DELETE", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/FOO_SHARED_SECRET/repositories/517639342" + }, + "response": { + "body": { + "encoding": null, + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 12:57:39 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4989" + ], + "X-RateLimit-Reset": [ + "1687355856" + ], + "X-RateLimit-Used": [ + "11" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Vary": [ + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-GitHub-Request-Id": [ + "C95D:D3D8:5112C1B:51D9527:6492F3C3" + ] + }, + "status": { + "code": 204, + "message": "No Content" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/FOO_SHARED_SECRET/repositories/517639342" + }, + "recorded_at": "2023-06-21T12:57:39" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/FOO_SHARED_SECRET/repositories?per_page=100" + }, + "response": {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Z0iyA2pThZTSYTWwL1U3QFKrKCAwFRVGUlTooxOm3HwKmnosZP50snM8dpnUuaR/l2B0FgCGOM1kDox7/GG2uUQA/oEyvGcVSVIq7H7il9tpCGLVn2lCvK8XI7ANl3mokMxpTzMWatYRnDPMZboIsiDpwQ56FAwNfA/xiE2wkHTOkorysIDEvCxTKHmstNdBfqYZLtf9vf1hz14EMRAAA=", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 12:57:40 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"f4157eb6ba87af2ec45e37a7e9190ca16cdf6f65e5296d9474e3d427d02cb78a\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4988" + ], + "X-RateLimit-Reset": [ + "1687355856" + ], + "X-RateLimit-Used": [ + "12" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "C95D:D3D8:5112D8A:51D96AA:6492F3C3" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/FOO_SHARED_SECRET/repositories?per_page=100" + }, + "recorded_at": "2023-06-21T12:57:40" + } + ], + "recorded_with": "betamax/0.8.1" +} \ No newline at end of file diff --git a/tests/cassettes/OrganizationSecrets_delete_secret.json b/tests/cassettes/OrganizationSecrets_delete_secret.json new file mode 100644 index 00000000..91fcb7ea --- /dev/null +++ b/tests/cassettes/OrganizationSecrets_delete_secret.json @@ -0,0 +1,376 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA61VTXPjRBD9K0ZnJ5b8lbWqKDgAOQCVosgB9jLVktryxKMZMR/2mlT++z592JGdwK4pfLJn+nVPv/e6/RwpU0odpVFJtmCtpA6fonEkiyhdJqv5PE7m40ibgkVzFP36w4+Hh+3q8HH6U6A/6k1xr3bZ05+fHh5/i3EXAxqsQuDG+9qlkwnV8raUfhOy29xUE2NLNzkvZbk2TlyFmrQY1OIda38tuAMBvTFmey24xTQEORf4WnAHArriKmN7LbxHPU+6Ly9IVIdMyVz8t3zn4GFa2pEneylKe+h6OYNjmxvtIUCrbJgc/fLd7ts5nlawy62svTSNvR43PMrY+dHD76O1saP71m5sRxVpKrkY/RzAiGbPbpSr4Dzo+QZZNFUMeBc++qW3JwrWpA9RqoNS4yiDiQeeG/jrVhokUSan/h33bFHx0HinIgmndhn8XnqUFE1XXcnuXDqxYyvXkuF+bwPDNeQEbExa/t0mFbU1T5x7NwxoDSq9sYc31z3rnYXTJD6JWErXJMHB2ihl9mAgSpPp8afU6BGXG1+pC2UGA3Y+W7ll8lwI8qBnGk/jm3h2E394TJbpbJouFh/BQ6iLsxgELG6S6WMyTeO7dLZqYvyhblR4GLTdnBpPCv1JGINF39DdODJ7jZoX5x/QZx/52mgh3RacwwBYN7NZjKAcvVNmLIE89I/tk0mFtVSKXrCoIuX59ol0EQr63lHd+K813JqC8t1Deu6hNoaus+DeSs+IOw5LTlp0BL1CJJ9k9Hsj1pTjGbj+K0jLFbwuWFOmGjesSTnY4ZiNWsmKYfU2eeOQnj6EvF9+aInm4YNXvPPYM2K/HC4xo/C0erfJ99JDjRMJw3uM7fZc1VPxnos9ZwJaVNILJ0tt1usjdW/5GrDft1//U+FepGPfZ3G1IqyX5+OegEJsEegaoV1NOYy1ulsultP5avXqwN6rq/aDAYPDIJ2DXOh8mcRLgLsfiyRezV7GERU70nkblAcY6XA0ggAtQvP+gt6ekYJr1gX87AUptviv6v3z1bBTvW5Or0rAOj+I0lK9+bqyqGUZ2kEb3U5c5/V/f+slqA5u0yw9j53YmP9/SZLjH8FUAntg+2YCv/SAAbZb9y+fAUx0l6r2CAAA", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 11:45:08 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"64e85f15ada62b758f54832ed87f299bc7b3648719796a7993477861c3d42231\"" + ], + "Last-Modified": [ + "Fri, 12 May 2023 12:07:39 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org, read:org, repo, user, write:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4999" + ], + "X-RateLimit-Reset": [ + "1687351508" + ], + "X-RateLimit-Used": [ + "1" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "F83A:8057:4DB0B3E:4E6E9B9:6492E2C4" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux" + }, + "recorded_at": "2023-06-21T11:45:08" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "0" + ], + "Authorization": [ + "token " + ] + }, + "method": "DELETE", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_org_secret" + }, + "response": { + "body": { + "encoding": null, + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 11:45:08 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4998" + ], + "X-RateLimit-Reset": [ + "1687351508" + ], + "X-RateLimit-Used": [ + "2" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Vary": [ + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-GitHub-Request-Id": [ + "F83A:8057:4DB0D6A:4E6EBEA:6492E2C4" + ] + }, + "status": { + "code": 204, + "message": "No Content" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_org_secret" + }, + "recorded_at": "2023-06-21T11:45:09" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "0" + ], + "Authorization": [ + "token " + ] + }, + "method": "DELETE", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_org_secret" + }, + "response": { + "body": { + "encoding": "utf-8", + "string": "{}" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 11:45:09 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4997" + ], + "X-RateLimit-Reset": [ + "1687351508" + ], + "X-RateLimit-Used": [ + "3" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Vary": [ + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-GitHub-Request-Id": [ + "F83A:8057:4DB0EA6:4E6ED2E:6492E2C5" + ] + }, + "status": { + "code": 404, + "message": "Not Found" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/foo_org_secret" + }, + "recorded_at": "2023-06-21T11:45:09" + } + ], + "recorded_with": "betamax/0.8.1" +} \ No newline at end of file diff --git a/tests/cassettes/OrganizationSecrets_public_key.json b/tests/cassettes/OrganizationSecrets_public_key.json new file mode 100644 index 00000000..f0fdb449 --- /dev/null +++ b/tests/cassettes/OrganizationSecrets_public_key.json @@ -0,0 +1,268 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA61VTXPiRhD9K0RnbIT48KKqVHJI4kOScqXiQ7KXqZbUiDGjGWU+YInL/32fPsACO9klFU4w0697+r3XzXOkTCl1lEYl2YK1kjp8isaRLKJ0OV3N5/F0Po60KVg0R9GvP/x4eNiuDh+TnwL9UW+Ke7XLnv789PD4W4y7GNBgFQI33tcunUyolrel9JuQ3eammhhbusl5Kcu1ceIq1KTFoBbvWPtrwR0I6I0x22vBLaYhyLnA14I7ENAVVxnba+E96nnSfXlBojpkSubiv+U7Bw/T0o482UtR2kPXyxkc29xoDwFaZcPk6Jfvdt/O8bSCXW5l7aVp7PW44VHGzo8efh+tjR3dt3ZjO6pIU8nF6OcARjR7dqNcBedBzzfIoqliwLvw0S+9PVGwJn2IUh2UGkcZTDzw3MBft9IgiTI59e+4Z4uKh8Y7FUk4tcvg99KjpGi66kp259KJHVu5lgz3exsYriEnYGPS8u82qaiteeLcu2FAa1DpjT28ue5Z7yycTuOTiKV0TRIcrI1SZg8GonSaHH9KjR5xufGVulBmMGDns5VbJs+FIA96kjiJb+LZTfzhcbpMZ0m6WHwED6EuzmIQsLiZJo/TJI3v0tmqifGHulHhYdB2c2o8KfQnYQwWfUN348jsNWpenH9An33ka6OFdFtwDgNg3cxmyWwc5eidMmMJ5KF/bJ9MKqylUvSCRRUpz7dPpItQ0PeO6sZ/reHWFJTvHtJzD7UxdJ0F91Z6RtxxWHLSoiPoFSL5JKPfG7GmHM/A9V9BWq7gdcGaMtW4YU3KwQ7HbNRKVgyrt8kbh/T0IeT98kNLNA8fvOKdx54R++VwiRmFp9W7Tb6XHmqcSBjeY2y356qeivdc7DkT0KKSXjhZarNeH6l7y9eA/b79+p8K9yId+z6LqxVhvTwf9wQUYotA1wjtasphrNXdcrFM5qvVqwN7r67aDwYMDoN0DnKh82W8XADc/VhM49XsZRxRsSOdt0F5gJEORyMI0CI07y/o7RkpuGZdwM9ekGKL/6reP18NO9Xr5vSqBKzzgygt1ZuvK4talqEdtNHtxHVe//e3XoLq4DbN0vPYiY35/5ckOf4RTCWwB7ZvJvBLDxhgu3X/8hkMLLBc9ggAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 07:35:33 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"da060f4aeca33ca9db31956c71f0051b1c10b11e1ab598a63e4f19cf561effe9\"" + ], + "Last-Modified": [ + "Fri, 12 May 2023 12:07:39 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org, read:org, repo, user, write:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4994" + ], + "X-RateLimit-Reset": [ + "1687335873" + ], + "X-RateLimit-Used": [ + "6" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "B89D:7A4A:308221E:310C0C9:6492A845" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux" + }, + "recorded_at": "2023-06-21T07:35:33" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/public-key" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA6tWyk6tjM9MUbJSMjWzMDI1MDQzNzIxMjWxNDcxVtIByQKlijwiIj1z9b2qfIN8it3NLAxN9C3cvXO9gnKCIwMzzN08/VOcyzz8/F0qi22VagFbbFfDVAAAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 07:35:34 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"8434271b3550491b7cefb89bdfe1b45031999379ccac2972d8b9f434c7870bcd\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4993" + ], + "X-RateLimit-Reset": [ + "1687335873" + ], + "X-RateLimit-Used": [ + "7" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "B89D:7A4A:30823E8:310C284:6492A845" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/public-key" + }, + "recorded_at": "2023-06-21T07:35:34" + } + ], + "recorded_with": "betamax/0.8.1" +} \ No newline at end of file diff --git a/tests/cassettes/OrganizationSecrets_secret.json b/tests/cassettes/OrganizationSecrets_secret.json new file mode 100644 index 00000000..e4006556 --- /dev/null +++ b/tests/cassettes/OrganizationSecrets_secret.json @@ -0,0 +1,268 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA61VTXPiRhD9K0RnbIT48KKqVHJI4kOScqXiQ7KXqZbUiDGjGWU+YInL/32fPsACO9klFU4w0697+r3XzXOkTCl1lEYl2YK1kjp8isaRLKJ0OV3N5/F0Po60KV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 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"c3e9a9baafd0b609d139005aaf3dda2102a8da04fbffb90b324bb3dc210e9de2\"" + ], + "Last-Modified": [ + "Fri, 12 May 2023 12:07:39 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org, read:org, repo, user, write:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4990" + ], + "X-RateLimit-Reset": [ + "1687335873" + ], + "X-RateLimit-Used": [ + "10" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "336B:3232:4351615:43F4FCE:6492AEF9" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux" + }, + "recorded_at": "2023-06-21T08:04:10" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets/FOO_ORG_SECRET" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA32PMQ+CMBCF/0tnoYCKhtWgIwkyuTSlXOASoKR3NRrjf7cOJrq4Xd778uXdQ8x6AlGIY1Wpqj6pc3moy0ashHGgGTqlObRZkq2jJI+ypEnzIt0W2e4SGL90f5jN/s1ckbDFEfkePAQjmGAN+edUDhZLyNYhkPJuDNjAvFAhpV4w7pEH38bGTtK6nmSvXQfziLO/SW0Y7UySIKxlkr9PyG+zeL4AHQxaV+sAAAA=", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 08:04:10 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"50dd839cb8e643d4f8def296638e98f12f5fb20e458b303573c593d85dec4cc9\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4989" + ], + "X-RateLimit-Reset": [ + "1687335873" + ], + "X-RateLimit-Used": [ + "11" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "336B:3232:43518A8:43F525E:6492AEFA" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets/FOO_ORG_SECRET" + }, + "recorded_at": "2023-06-21T08:04:10" + } + ], + "recorded_with": "betamax/0.8.1" +} \ No newline at end of file diff --git a/tests/cassettes/OrganizationSecrets_secrets.json b/tests/cassettes/OrganizationSecrets_secrets.json new file mode 100644 index 00000000..d4c5bc3d --- /dev/null +++ b/tests/cassettes/OrganizationSecrets_secrets.json @@ -0,0 +1,268 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA61VTXPiRhD9K0RnbIT48KKqVHJI4kOScqXiQ7KXqZbUiDGjGWU+YInL/32fPsACO9klFU4w0697+r3XzXOkTCl1lEYl2YK1kjp8isaRLKJ0OV3N5/F0Po60KVg0R9GvP/x4eNiuDh+TnwL9UW+Ke7XLnv789PD4W4y7GNBgFQI33tcunUyolrel9JuQ3eammhhbusl5Kcu1ceIq1KTFoBbvWPtrwR0I6I0x22vBLaYhyLnA14I7ENAVVxnba+E96nnSfXlBojpkSubiv+U7Bw/T0o482UtR2kPXyxkc29xoDwFaZcPk6Jfvdt/O8bSCXW5l7aVp7PW44VHGzo8efh+tjR3dt3ZjO6pIU8nF6OcARjR7dqNcBedBzzfIoqliwLvw0S+9PVGwJn2IUh2UGkcZTDzw3MBft9IgiTI59e+4Z4uKh8Y7FUk4tcvg99KjpGi66kp259KJHVu5lgz3exsYriEnYGPS8u82qaiteeLcu2FAa1DpjT28ue5Z7yycTuOTiKV0TRIcrI1SZg8GonSaHH9KjR5xufGVulBmMGDns5VbJs+FIA96kjiJb+LZTfzhcbpMZ0m6WHwED6EuzmIQsLiZJo/TJI3v0tmqifGHulHhYdB2c2o8KfQnYQwWfUN348jsNWpenH9An33ka6OFdFtwDgNg3cxmyWwc5eidMmMJ5KF/bJ9MKqylUvSCRRUpz7dPpItQ0PeO6sZ/reHWFJTvHtJzD7UxdJ0F91Z6RtxxWHLSoiPoFSL5JKPfG7GmHM/A9V9BWq7gdcGaMtW4YU3KwQ7HbNRKVgyrt8kbh/T0IeT98kNLNA8fvOKdx54R++VwiRmFp9W7Tb6XHmqcSBjeY2y356qeivdc7DkT0KKSXjhZarNeH6l7y9eA/b79+p8K9yId+z6LqxVhvTwf9wQUYotA1wjtasphrNXdcrFM5qvVqwN7r67aDwYMDoN0DnKh82W8XALc/VhM49XsZRxRsSOdt0F5gJEORyMI0CI07y/o7RkpuGZdwM9ekGKL/6reP18NO9Xr5vSqBKzzgygt1ZuvK4talqEdtNHtxHVe//e3XoLq4DbN0vPYiY35/5ckOf4RTCWwB7ZvJvBLDxhgu3X/8hnIbfxB9ggAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 07:39:04 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"6bde15ef67fa53c6fcd004c03977307f39020f736bc0e05995f820db43527cb7\"" + ], + "Last-Modified": [ + "Fri, 12 May 2023 12:07:39 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org, read:org, repo, user, write:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4992" + ], + "X-RateLimit-Reset": [ + "1687335873" + ], + "X-RateLimit-Used": [ + "8" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "3959:B129:44A0C6:455D8F:6492A917" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux" + }, + "recorded_at": "2023-06-21T07:39:04" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/orgs/gardenlinux/actions/secrets?per_page=100" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA83PQUsDMRCG4f8y522zjVoltyrV48LakyIhzQ7bgTRZMhNRSv+7QVSsB8GbtxDe+eA5gCRxwfpUooDRDTD6jMJgHg8Q3R7BwPWqt11/Z+/XN/16Aw3UwgkO1tUT0K0+m7XLmW43i6VZXBh99VCbMg2/NOfvzTMxbSmQvNYdxoC+rtb/z6fNOCUmSZmQbcmhZjuRiY1SbqL5SLIr27lPe5XyyGp0ecAYKJYX5bxQiqw+POoUob4vw7H5st523Z+sl//Reor4YX06vgFByRzo9QEAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Wed, 21 Jun 2023 07:39:04 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"c447d1a88e82772c63d8b336353373f7940acb3a7f37b696a5c966a968b72895\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "admin:org" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4991" + ], + "X-RateLimit-Reset": [ + "1687335873" + ], + "X-RateLimit-Used": [ + "9" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "3959:B129:44A2DB:455F9C:6492A918" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/orgs/gardenlinux/actions/secrets?per_page=100" + }, + "recorded_at": "2023-06-21T07:39:04" + } + ], + "recorded_with": "betamax/0.8.1" +} \ No newline at end of file diff --git a/tests/cassettes/Repository_create_or_update_secret.json b/tests/cassettes/Repository_create_or_update_secret.json new file mode 100644 index 00000000..49b0207a --- /dev/null +++ b/tests/cassettes/Repository_create_or_update_secret.json @@ -0,0 +1,514 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/repos/MrBatschner/github3.py" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA+2bXW/jNhaG/4qhm140sfydjIFBd9oEaYomM03c3WJ2FgItMzYnsqSKVDyJMP99X5KSLXlM+YMpulj4YlqF1nl1eMhDHT6mM4dNnOGg3+u0zt70WidOGE2oJ9ucO+9xevH+l6d+8uWdgw/InKJ1ysQsHXeb8TPaHtIg8PIPbpIfieD+LKSJW7kpTtgTEbB9IAGnJ060wC3OMHOCaMpCSJYsoSmf3en3zs77Z92yOzcXvw3++cdt4H++bt9e+L3bkf+C2wm0SeKlSQClmRAxH7qubuRN7UfKaeJHoaChaPrR3E3dQv+Hp7c9aEyTXEX1Gw1rajHLlbQ55LhbdXom5sGaD/rZyqJ670MUBNECGutOb3mMuzSUkVciLJweJgLDzI3EjCJy6M5XGQTGxd4uKaMM480FJo2U4RiNhE72dSs3g1NydnzN3ITGkdJLx9xPWCxYFO7tXsUYYlEyJSF7IQeJwZhDQzq2tyPKCMb0CZNwb2ttlbkqk/xnGZaE+pQ9Ic6HKa6ZQ1A8xzK9f8dskFFngnpkMpf5qdL26wmSa8c5Xk3/CV2OH/QbP7OTxvV38wZpBGyckOS58RAlDYbsTIgvMC8bC6wwjatr8XM6/o437i7vR413H65xC2yQxoggQxAbJJw0aDKNwmjO/MaCPDcb141FlDw2orDx4VnM8L9uc/B9E93BIx6doUhSLD+1ua3Gq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vALq5bAV3/M4Qz1ZN8N6oHUepYmvvhs5Ml1NjI9M98AzzWsr8pHp5ufoNx1Jr8TqyHTzs+l/89nmI9Mdq59a1HLryolmnNw5+ICzoYBzj0x310POpggema6uy3Y+6GwKpIRQR6Z70GFnU0iPTBensfG1LGZo+YdVNkizrAPZI9OVByWPTPfIdI9M98h0vz1OhvLW6gC06c12ZLp692CIT8GRj0y3/jj0kemqM9l/w4Ho/x+mS/00waFuDz/vxj8SPHOGE9+Zwyl+mIGz4T4JQ3WUHE3qV5EAL8vD9BIKV+/z5BdL8gcAAj8AkAcHNtvBMKRC/nq8OHyv2HT5PERxvP/rfwFw7mZpM0MAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Tue, 20 Jun 2023 15:31:57 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"3c91f0ca90d7f5eff04c30b32011f6aef9a6975b89d34f488e099cb85fd5fd64\"" + ], + "Last-Modified": [ + "Thu, 15 Jun 2023 15:59:54 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "repo" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4875" + ], + "X-RateLimit-Reset": [ + "1687277134" + ], + "X-RateLimit-Used": [ + "125" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "E604:10D70:1A4D1E9:1A7A7C7:6491C66D" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/repos/MrBatschner/github3.py" + }, + "recorded_at": "2023-06-20T15:31:57" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets/public-key" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA6tWyk6tjM9MUbJSMjWzMDI1MDQzNzIxMjWxNDcxVtIByQKlAiuDAyxSnN2qHPONDA0M0wxKvNKrTJ18XZwtDPy9y4vNA4wN9Mvc872ckm2VagEGcCRmVAAAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Tue, 20 Jun 2023 15:31:57 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"a73ed8b0084cbf1da37a3b596223fb96b29c9023cff53eada8ed4508c5c8ccdd\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4874" + ], + "X-RateLimit-Reset": [ + "1687277134" + ], + "X-RateLimit-Used": [ + "126" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "E604:10D70:1A4D2E7:1A7A8D5:6491C66D" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets/public-key" + }, + "recorded_at": "2023-06-20T15:31:57" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "{\"encrypted_value\": \"peJfDjgtbr+FO7AJumPcdWNMjL2X1jYXycIKIlSVljXZLiy0yosjMsgjFF3qA62PUihD\", \"key_id\": \"568250167242549743\"}" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "123" + ], + "Authorization": [ + "token " + ] + }, + "method": "PUT", + "uri": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets/bar_secret" + }, + "response": { + "body": { + "encoding": null, + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Tue, 20 Jun 2023 15:31:58 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4873" + ], + "X-RateLimit-Reset": [ + "1687277134" + ], + "X-RateLimit-Used": [ + "127" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Vary": [ + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-GitHub-Request-Id": [ + "E604:10D70:1A4D372:1A7A967:6491C66D" + ] + }, + "status": { + "code": 204, + "message": "No Content" + }, + "url": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets/bar_secret" + }, + "recorded_at": "2023-06-20T15:31:58" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets/bar_secret" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA6tWykvMTVWyUnJyDIoPdnUOcg1R0lFKLkpNLElNiU8sAcoYGRgZ6xqY6RoZhBiaWhmZWhlaRAHVlBak4FJjbGhlClRTCwA5BMUIXQAAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Tue, 20 Jun 2023 15:31:58 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"d7adcf5841891fc498c73238ebe99a376efb6265a166e9892075706b71a9fc07\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4872" + ], + "X-RateLimit-Reset": [ + "1687277134" + ], + "X-RateLimit-Used": [ + "128" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "E604:10D70:1A4D447:1A7AA36:6491C66E" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets/bar_secret" + }, + "recorded_at": "2023-06-20T15:31:58" + } + ], + "recorded_with": "betamax/0.8.1" +} \ No newline at end of file diff --git a/tests/cassettes/Repository_delete_secret.json b/tests/cassettes/Repository_delete_secret.json new file mode 100644 index 00000000..c7ba95b1 --- /dev/null +++ b/tests/cassettes/Repository_delete_secret.json @@ -0,0 +1,376 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/repos/MrBatschner/github3.py" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA+2bXW/jNhaG/4qhm140sfydjIFBd9oEaYomM03c3WJ2FgItMzYnsqSKVDyJMP99X5KSLXlM+YMpulj4YlqF1nl1eMhDHT6mM4dNnOGg3+u0zt70WidOGE2oJ9ucO+9xevH+l6d+8uWdgw/InKJ1ysQsHXeb8TPaHtIg8PIPbpIfieD+LKSJW7kpTtgTEbB9IAGnJ060wC3OMHOCaMpCSJYsoSmf3en3zs77Z92yOzcXvw3++cdt4H++bt9e+L3bkf+C2wm0SeKlSQClmRAxH7qubuRN7UfKaeJHoaChaPrR3E3dQv+Hp7c9aEyTXEX1Gw1rajHLlbQ55LhbdXom5sGaD/rZyqJ670MUBNECGutOb3mMuzSUkVciLJweJgLDzI3EjCJy6M5XGQTGxd4uKaMM480FJo2U4RiNhE72dSs3g1NydnzN3ITGkdJLx9xPWCxYFO7tXsUYYlEyJSF7IQeJwZhDQzq2tyPKCMb0CZNwb2ttlbkqk/xnGZaE+pQ9Ic6HKa6ZQ1A8xzK9f8dskFFngnpkMpf5qdL26wmSa8c5Xk3/CV2OH/QbP7OTxvV38wZpBGyckOS58RAlDYbsTIgvMC8bC6wwjatr8XM6/o437i7vR413H65xC2yQxoggQxAbJJw0aDKNwmjO/MaCPDcb141FlDw2orDx4VnM8L9uc/B9E93BIx6doUhSLD+1ua3GqZyv1b5InS2jV6eADIY9/HmkzzYy0jxz8d8853wsBmQcJURE21aVWvcqOplb/lPOOUHJ3MZtZQ+dWRRZRVHZQ4dxntKdEqC210qGu0WShel8rFfEXVKrVlkLwFPCOZuGlNpEb6mRucWSjfwJ/ZmVaiGRufpKjTOZ2jgqzaEyDqKxjQzen67SyFw+I/oNJTxL36SolKhoJvTB1lEpsdQUid1I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0y3/jj0kemqM9l/w4Ho/x+mS/00waFuDz/vxj8SPHOGE9+Zwyl+mIGz4T4JQ3WUHE3qV5EAL8vD9BIKV+/z5BdL8gcAAj8AkAcHNtvBMKRC/nq8OHyv2HT5PERxvP/rfwFw7mZpM0MAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Tue, 20 Jun 2023 15:36:17 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"3c91f0ca90d7f5eff04c30b32011f6aef9a6975b89d34f488e099cb85fd5fd64\"" + ], + "Last-Modified": [ + "Thu, 15 Jun 2023 15:59:54 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "repo" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4858" + ], + "X-RateLimit-Reset": [ + "1687277134" + ], + "X-RateLimit-Used": [ + "142" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "8664:7E44:1ADD8D9:1B0B71E:6491C771" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/repos/MrBatschner/github3.py" + }, + "recorded_at": "2023-06-20T15:36:17" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "0" + ], + "Authorization": [ + "token " + ] + }, + "method": "DELETE", + "uri": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets/foo_secret" + }, + "response": { + "body": { + "encoding": null, + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Tue, 20 Jun 2023 15:36:17 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4857" + ], + "X-RateLimit-Reset": [ + "1687277134" + ], + "X-RateLimit-Used": [ + "143" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Vary": [ + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-GitHub-Request-Id": [ + "8664:7E44:1ADD9F5:1B0B842:6491C771" + ] + }, + "status": { + "code": 204, + "message": "No Content" + }, + "url": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets/foo_secret" + }, + "recorded_at": "2023-06-20T15:36:17" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "0" + ], + "Authorization": [ + "token " + ] + }, + "method": "DELETE", + "uri": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets/foo_secret" + }, + "response": { + "body": { + "encoding": "utf-8", + "string": "{}" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Tue, 20 Jun 2023 15:36:18 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "2" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4856" + ], + "X-RateLimit-Reset": [ + "1687277134" + ], + "X-RateLimit-Used": [ + "144" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Vary": [ + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-GitHub-Request-Id": [ + "8664:7E44:1ADDB1E:1B0B982:6491C771" + ] + }, + "status": { + "code": 404, + "message": "Not Found" + }, + "url": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets/foo_secret" + }, + "recorded_at": "2023-06-20T15:36:18" + } + ], + "recorded_with": "betamax/0.8.1" +} \ No newline at end of file diff --git a/tests/cassettes/Repository_organization-secrets.json b/tests/cassettes/Repository_organization-secrets.json new file mode 100644 index 00000000..4d2e982f --- /dev/null +++ b/tests/cassettes/Repository_organization-secrets.json @@ -0,0 +1,268 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/repos/gardenlinux/gardenlinux" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA+2Z32/bNhDH/5VMr0si2/ltoOiGNQs6NE2XeliXYRAoibZYS6JKUnYdIf/7vkdKtuymdlLtYQ99SRya9+HxeHc8XipPxN5wcHxy1j86uzjf93IZ84DGvOtXl/Ob9Lc0urq4Zx9uZ1E+Xbx99cfR9ej66GY0eeFhMss4Zk6Yinmeirz8jMFxmabBl9/467MKJWbMQHrMUs33PTnPufKGlZfKici/gJJGp/2L4+Ne/3hDycXN9GJxN/i1ZB+KJL5KZ+HHvz7fjH7vYQM96MOwDlNBqVJQE2MKPfR9N6gPJ8IkZVhqriKZG56bw0hmfuk3a72cvTgGY6JqirUMBjZohahJThw4vbHfxGTphg5ubSuxYUGZpnIOxqbSO5bxx40gHYP9LPLJt0EgWPnSJByWw3YeyAhCm2erZIUqn37BrQijcRqKx89VqxaDUuQpD5WveCEtrwx1pERhhMyfrd6aMGBSTVgu7tk3wSCswSDFnq2IFYIwn8EJny3tpCrfRlW0ILMoHnExg52/jbghDqBZFBTsNy0LkfWF4QGLM4pZG8oP+wiyJ/r6ht/HfHmQWOjKZpW9N5RW9g72RgnfC7k29cBYqj03g6s9Slr6B2iD0ekypWyNUWvv9vpfxKCa7jiGrQjEIgBQacoXnTgkX/n4WYdPhLhmoVTMyF0JYruCa6DKb/9J/mM4yzopbgEAJVJ2s6QFACS0LvmT3Hn7xi1H+03M5GUWugT3lEjZjnYE6Mq0FpOc804WXEIqv8nBoWJ5lHTDNozKd5/sabNJJ1VJHpgwlWEnDu5E30IqXyfM3Tom6KodUYmxBlV83FlVYiyhRnU8b6smQZZIXHoGR99Jz4bhV7VFU5ZPSjbpRl1CcOp0NU/Y/c6CZXvsrChAUjWmRFh2T3IrDmnqagXEezeTrjArqC1Atlc1OwzQKmSsCbJM7CoF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tdmNKzry9ury2ZhYNrNvO+tZdec/95aplbKeufve2uZ/gny+L8ulm2y/0drWfOoVLgCApajJstZutACV0fl4QvFcclELM/tnYQh2zxBjlnercjMG/MCSuhUDxjUA7gBviIHQdxDc9x37Wu93U2oC5HB8cO/DzOJplMbAAA=", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Tue, 20 Jun 2023 16:15:28 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"3259156bd41d348dcc1cb3dadade4761bb08802959e71ad9d05fa859157cc8e9\"" + ], + "Last-Modified": [ + "Wed, 14 Jun 2023 09:15:33 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "repo" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4973" + ], + "X-RateLimit-Reset": [ + "1687280817" + ], + "X-RateLimit-Used": [ + "27" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "3476:F2F1:1B5584A:1B8811C:6491D0A0" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/repos/gardenlinux/gardenlinux" + }, + "recorded_at": "2023-06-20T16:15:28" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/repos/gardenlinux/gardenlinux/actions/organization-secrets?per_page=100" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA6tWKskvScyJT84vzStRsjLSUSpOTS5KLSlWsoquVspLzE1VslJycgyK9w9yjw92dQ5yDVHSUQKqSCxJTYlPBGpRMjIwMtY1MNM1MggxNLMyNLUysogCqiktSCGgplYHboObvz9JNpgTYQNQTW1sLQD/Jjjo4QAAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Tue, 20 Jun 2023 16:15:28 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"7ef2795cc6bc13cec04905babff8c7a4f13b66dc6dd209276082c2d7449823be\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4972" + ], + "X-RateLimit-Reset": [ + "1687280817" + ], + "X-RateLimit-Used": [ + "28" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "3476:F2F1:1B55916:1B881F2:6491D0A0" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/repos/gardenlinux/gardenlinux/actions/organization-secrets?per_page=100" + }, + "recorded_at": "2023-06-20T16:15:28" + } + ], + "recorded_with": "betamax/0.8.1" +} \ No newline at end of file diff --git a/tests/cassettes/Repository_public_key.json b/tests/cassettes/Repository_public_key.json new file mode 100644 index 00000000..cef6e1eb --- /dev/null +++ b/tests/cassettes/Repository_public_key.json @@ -0,0 +1,268 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/repos/MrBatschner/github3.py" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA+2bXW/jNhaG/4qhm140sfydjIFBd9oEaYomM03c3WJ2FgItMzYnsqSKVDyJMP99X5KSLXlM+YMpulj4YlqF1nl1eMhDHT6mM4dNnOGg3+u0zt70WidOGE2oJ9ucO+9xevH+l6d+8uWdgw/InKJ1ysQsHXeb8TPaHtIg8PIPbpIfieD+LKSJW7kpTtgTEbB9IAGnJ060wC3OMHOCaMpCSJYsoSmf3en3zs77Z92yOzcXvw3++cdt4H++bt9e+L3bkf+C2wm0SeKlSQClmRAxH7qubuRN7UfKaeJHoaChaPrR3E3dQv+Hp7c9aEyTXEX1Gw1rajHLlbQ55LhbdXom5sGaD/rZyqJ670MUBNECGutOb3mMuzSUkVciLJweJgLDzI3EjCJy6M5XGQTGxd4uKaMM480FJo2U4RiNhE72dSs3g1NydnzN3ITGkdJLx9xPWCxYFO7tXsUYYlEyJSF7IQeJwZhDQzq2tyPKCMb0CZNwb2ttlbkqk/xnGZaE+pQ9Ic6HKa6ZQ1A8xzK9f8dskFFngnpkMpf5qdL26wmSa8c5Xk3/CV2OH/QbP7OTxvV38wZpBGyckOS58RAlDYbsTIgvMC8bC6wwjatr8XM6/o437i7vR413H65xC2yQxoggQxAbJJw0aDKNwmjO/MaCPDcb141FlDw2orDx4VnM8L9uc/B9E93BIx6doUhSLD+1ua3GqZyv1b5InS2jV6eADIY9/HmkzzYy0jxz8d8853wsBmQcJURE21aVWvcqOplb/lPOOUHJ3MZtZQ+dWRRZRVHZQ4dxntKdEqC210qGu0WShel8rFfEXVKrVlkLwFPCOZuGlNpE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IRQR6Z70GFnU0iPTBensfG1LGZo+YdVNkizrAPZI9OVByWPTPfIdI9M98h0vz1OhvLW6gC06c12ZLp692CIT8GRj0y3/jj0kemqM9l/w4Ho/x+mS/00waFuDz/vxj8SPHOGE9+Zwyl+mIGz4T4JQ3WUHE3qV5EAL8vD9BIKV+/z5BdL8gcAAj8AkAcHNtvBMKRC/nq8OHyv2HT5PERxvP/rfwFw7mZpM0MAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Tue, 20 Jun 2023 15:31:58 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"3c91f0ca90d7f5eff04c30b32011f6aef9a6975b89d34f488e099cb85fd5fd64\"" + ], + "Last-Modified": [ + "Thu, 15 Jun 2023 15:59:54 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "repo" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4870" + ], + "X-RateLimit-Reset": [ + "1687277134" + ], + "X-RateLimit-Used": [ + "130" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "FDC1:2383:1772AA7:17A0084:6491C66E" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/repos/MrBatschner/github3.py" + }, + "recorded_at": "2023-06-20T15:31:58" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets/public-key" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA6tWyk6tjM9MUbJSMjWzMDI1MDQzNzIxMjWxNDcxVtIByQKlAiuDAyxSnN2qHPONDA0M0wxKvNKrTJ18XZwtDPy9y4vNA4wN9Mvc872ckm2VagEGcCRmVAAAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Tue, 20 Jun 2023 15:31:59 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"a73ed8b0084cbf1da37a3b596223fb96b29c9023cff53eada8ed4508c5c8ccdd\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4869" + ], + "X-RateLimit-Reset": [ + "1687277134" + ], + "X-RateLimit-Used": [ + "131" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "FDC1:2383:1772B6F:17A015B:6491C66E" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets/public-key" + }, + "recorded_at": "2023-06-20T15:31:59" + } + ], + "recorded_with": "betamax/0.8.1" +} \ No newline at end of file diff --git a/tests/cassettes/Repository_secret.json b/tests/cassettes/Repository_secret.json new file mode 100644 index 00000000..3081b924 --- /dev/null +++ b/tests/cassettes/Repository_secret.json @@ -0,0 +1,268 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/repos/MrBatschner/github3.py" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA+2bXW/jNhaG/4qhm140sfydjIFBd9oEaYomM03c3WJ2FgItMzYnsqSKVDyJMP99X5KSLXlM+YMpulj4YlqF1nl1eMhDHT6mM4dNnOGg3+u0zt70WidOGE2oJ9ucO+9xevH+l6d+8uWdgw/InKJ1ysQsHXeb8TPaHtIg8PIPbpIfieD+LKSJW7kpTtgTEbB9IAGnJ060wC3OMHOCaMpCSJYsoSmf3en3zs77Z92yOzcXvw3++cdt4H++bt9e+L3bkf+C2wm0SeKlSQClmRAxH7qubuRN7UfKaeJHoaChaPrR3E3dQv+Hp7c9aEyTXEX1Gw1rajHLlbQ55LhbdXom5sGaD/rZyqJ670MUBNECGutOb3mMuzSUkVciLJweJgLDzI3EjCJy6M5XGQTGxd4uKaMM480FJo2U4RiNhE72dSs3g1NydnzN3ITGkdJLx9xPWCxYFO7tXsUYYlEyJSF7IQeJwZhDQzq2tyPKCMb0CZNwb2ttlbkqk/xnGZaE+pQ9Ic6HKa6ZQ1A8xzK9f8dskFFngnpkMpf5qdL26wmSa8c5Xk3/CV2OH/QbP7OTxvV38wZpBGyckOS58RAlDYbsTIgvMC8bC6wwjatr8XM6/o437i7vR413H65xC2yQxoggQxAbJJw0aDKNwmjO/MaCPDcb141FlDw2orDx4VnM8L9uc/B9E93BIx6doUhSLD+1ua3GqZyv1b5InS2jV6eADIY9/HmkzzYy0jxz8d8853wsBmQcJURE21aVWvcqOplb/lPOOUHJ3MZtZQ+dWRRZRVHZQ4dxntKdEqC210qGu0W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ICzoYBzj0x310POpggema6uy3Y+6GwKpIRQR6Z70GFnU0iPTBensfG1LGZo+YdVNkizrAPZI9OVByWPTPfIdI9M98h0vz1OhvLW6gC06c12ZLp692CIT8GRj0y3/jj0kemqM9l/w4Ho/x+mS/00waFuDz/vxj8SPHOGE9+Zwyl+mIGz4T4JQ3WUHE3qV5EAL8vD9BIKV+/z5BdL8gcAAj8AkAcHNtvBMKRC/nq8OHyv2HT5PERxvP/rfwFw7mZpM0MAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Tue, 20 Jun 2023 15:31:59 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"3c91f0ca90d7f5eff04c30b32011f6aef9a6975b89d34f488e099cb85fd5fd64\"" + ], + "Last-Modified": [ + "Thu, 15 Jun 2023 15:59:54 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "repo" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4868" + ], + "X-RateLimit-Reset": [ + "1687277134" + ], + "X-RateLimit-Used": [ + "132" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "0638:3232:183CA23:186A031:6491C66F" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/repos/MrBatschner/github3.py" + }, + "recorded_at": "2023-06-20T15:31:59" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets/BAR_SECRET" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA6tWykvMTVWyUnJyDIoPdnUOcg1R0lFKLkpNLElNiU8sAcoYGRgZ6xqY6RoZhBiaWhmZWhlaRAHVlBak4FJjbGhlClRTCwA5BMUIXQAAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Tue, 20 Jun 2023 15:31:59 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"d7adcf5841891fc498c73238ebe99a376efb6265a166e9892075706b71a9fc07\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4867" + ], + "X-RateLimit-Reset": [ + "1687277134" + ], + "X-RateLimit-Used": [ + "133" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "0638:3232:183CB1B:186A112:6491C66F" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets/BAR_SECRET" + }, + "recorded_at": "2023-06-20T15:31:59" + } + ], + "recorded_with": "betamax/0.8.1" +} \ No newline at end of file diff --git a/tests/cassettes/Repository_secrets.json b/tests/cassettes/Repository_secrets.json new file mode 100644 index 00000000..a15b2eea --- /dev/null +++ b/tests/cassettes/Repository_secrets.json @@ -0,0 +1,268 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/repos/MrBatschner/github3.py" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA+2bXW/jNhaG/4qhm140sfydjIFBd9oEaYomM03c3WJ2FgItMzYnsqSKVDyJMP99X5KSLXlM+YMpulj4YlqF1nl1eMhDHT6mM4dNnOGg3+u0zt70WidOGE2oJ9ucO+9xevH+l6d+8uWdgw/InKJ1ysQsHXeb8TPaHtIg8PIPbpIfieD+LKSJW7kpTtgTEbB9IAGnJ060wC3OMHOCaMpCSJYsoSmf3en3zs77Z92yOzcXvw3++cdt4H++bt9e+L3bkf+C2wm0SeKlSQClmRAxH7qubuRN7UfKaeJHoaChaPrR3E3dQv+Hp7c9aEyTXEX1Gw1rajHLlbQ55LhbdXom5sGaD/rZyqJ670MUBNECGutOb3mMuzSUkVciLJweJgLDzI3EjCJy6M5XGQTGxd4uKaMM480FJo2U4RiNhE72dSs3g1NydnzN3ITGkdJLx9xPWCxYFO7tXsUYYlEyJSF7IQeJwZhDQzq2tyPKCMb0CZNwb2ttlbkqk/xnGZaE+pQ9Ic6HKa6ZQ1A8xzK9f8dskFFngnpkMpf5qdL26wmSa8c5Xk3/CV2OH/QbP7OTxvV38wZpBGyckOS58RAlDYbsTIgvMC8bC6wwjatr8XM6/o437i7vR413H65xC2yQxoggQxAbJJw0aDKNwmjO/MaCPDcb141FlDw2orDx4VnM8L9uc/B9E93BIx6doUhSLD+1ua3GqZyv1b5InS2jV6eADIY9/HmkzzYy0jxz8d8853wsBmQcJURE21aVWvcqOplb/lPOOUHJ3MZtZQ+dWRRZRVHZQ4dx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a1HLryolmnNw5+ICzoYBzj0x310POpggema6uy3Y+6GwKpIRQR6Z70GFnU0iPTBensfG1LGZo+YdVNkizrAPZI9OVByWPTPfIdI9M98h0vz1OhvLW6gC06c12ZLp692CIT8GRj0y3/jj0kemqM9l/w4Ho/x+mS/00waFuDz/vxj8SPHOGE9+Zwyl+mIGz4T4JQ3WUHE3qV5EAL8vD9BIKV+/z5BdL8gcAAj8AkAcHNtvBMKRC/nq8OHyv2HT5PERxvP/rfwFw7mZpM0MAAA==", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Tue, 20 Jun 2023 15:36:18 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"3c91f0ca90d7f5eff04c30b32011f6aef9a6975b89d34f488e099cb85fd5fd64\"" + ], + "Last-Modified": [ + "Thu, 15 Jun 2023 15:59:54 GMT" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "repo" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4855" + ], + "X-RateLimit-Reset": [ + "1687277134" + ], + "X-RateLimit-Used": [ + "145" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "E756:F2F1:191B35F:194918F:6491C772" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/repos/MrBatschner/github3.py" + }, + "recorded_at": "2023-06-20T15:36:18" + }, + { + "request": { + "body": { + "encoding": "utf-8", + "string": "" + }, + "headers": { + "User-Agent": [ + "github3.py/4.0.1" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "application/vnd.github.v3.full+json" + ], + "Connection": [ + "keep-alive" + ], + "Accept-Charset": [ + "utf-8" + ], + "Content-Type": [ + "application/json" + ], + "Authorization": [ + "token " + ] + }, + "method": "GET", + "uri": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets?per_page=100" + }, + "response": { + "body": { + "encoding": "utf-8", + "base64_string": "H4sIAAAAAAAAA6tWKskvScyJT84vzStRsjLSUSpOTS5KLSlWsoquVspLzE1VslJycgyK9wxxDYoPdnUOcg1R0lECKkksSU2JTwTqUTIyMDLWNTDTNTIIMTS1MjS3MjSNAqopLUjBo8YYqKZWB26Fm78/aVaYEGlFbC0AZqID++MAAAA=", + "string": "" + }, + "headers": { + "Server": [ + "GitHub.com" + ], + "Date": [ + "Tue, 20 Jun 2023 15:36:18 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": [ + "W/\"657b45341bcc630e40995d73a6aab919375d35aafb55d32614db87525567b6c2\"" + ], + "X-OAuth-Scopes": [ + "admin:org, admin:public_key, repo" + ], + "X-Accepted-OAuth-Scopes": [ + "" + ], + "github-authentication-token-expiration": [ + "2023-07-14 18:47:26 UTC" + ], + "X-GitHub-Media-Type": [ + "github.v3; param=full; format=json" + ], + "x-github-api-version-selected": [ + "2022-11-28" + ], + "X-RateLimit-Limit": [ + "5000" + ], + "X-RateLimit-Remaining": [ + "4854" + ], + "X-RateLimit-Reset": [ + "1687277134" + ], + "X-RateLimit-Used": [ + "146" + ], + "X-RateLimit-Resource": [ + "core" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubdomains; preload" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Encoding": [ + "gzip" + ], + "X-GitHub-Request-Id": [ + "E756:F2F1:191B464:19492A4:6491C772" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "url": "https://api.github.com/repos/MrBatschner/github3.py/actions/secrets?per_page=100" + }, + "recorded_at": "2023-06-20T15:36:18" + } + ], + "recorded_with": "betamax/0.8.1" +} \ No newline at end of file diff --git a/tests/integration/test_orgs.py b/tests/integration/test_orgs.py index 06a3852c..c3583245 100644 --- a/tests/integration/test_orgs.py +++ b/tests/integration/test_orgs.py @@ -1,5 +1,6 @@ """Integration tests for methods implemented on Organization.""" import pytest +import datetime import github3 from .helper import IntegrationHelper @@ -419,6 +420,190 @@ def test_hooks(self): assert isinstance(hook, github3.orgs.OrganizationHook) +class TestOrganizationSecrets(IntegrationHelper): + + """Integration tests for organization secrets.""" + + encrypted_data = "9JgL1eNoSjB/9cmjYUI00ojLcLxidIgvspXw/g+vmEvlIgqafYXTe1sbVEsz3RyLEyu/" # noqa: E501 + + def test_organization_public_key(self): + """ + Test the ability to retrieve an organization public key. + """ + self.token_login() + cassette_name = self.cassette_name("public_key") + with self.recorder.use_cassette(cassette_name): + org = self.gh.organization("gardenlinux") + public_key = org.public_key() + + assert isinstance(public_key, github3.actions.secrets.PublicKey) + assert public_key.key_id == "568250167242549743" + assert ( + public_key.key == "rHXYIm/JzMRLsG6814/8GKmJRlSYQh7FIOdCvHNODys=" + ) + + def test_organization_secrets(self): + """ + Test the ability to iterate over organization secrets. + """ + self.token_login() + + cassette_name = self.cassette_name("secrets") + secret_count = 0 + + with self.recorder.use_cassette(cassette_name): + org = self.gh.organization("gardenlinux") + secrets_iter = org.secrets() + + for s in secrets_iter: + secret_count += 1 + assert isinstance( + s, github3.actions.secrets.OrganizationSecret + ) + assert ( + s.name == "FOO_ORG_SECRET" or s.name == "BAR_ORG_SECRET" + ) + + assert secret_count == 2 + + def test_organization_secret(self): + """ + Test the ability to fetch a single organization secret. + """ + self.token_login() + + cassette_name = self.cassette_name("secret") + + with self.recorder.use_cassette(cassette_name): + org = self.gh.organization("gardenlinux") + secret = org.secret("FOO_ORG_SECRET") + + assert isinstance(secret, github3.actions.secrets.OrganizationSecret) + assert secret.name == "FOO_ORG_SECRET" + + def test_organization_create_or_update_secret(self): + """ + Test the ability to create or update organization secrets. + """ + self.token_login() + shared_repo_ids = [245713798, 517639342] + + cassette_name = self.cassette_name("create_or_update_secret") + with self.recorder.use_cassette(cassette_name): + org = self.gh.organization("gardenlinux") + secret = org.create_or_update_secret( + "foo_secret", self.encrypted_data, "all", None + ) + + assert isinstance( + secret, github3.actions.secrets.OrganizationSecret + ) + assert secret.name == "FOO_SECRET" + assert isinstance(secret.created_at, datetime.datetime) + assert isinstance(secret.updated_at, datetime.datetime) + assert secret.visibility == "all" + assert secret.selected_repositories() is None + + shared_secret = org.create_or_update_secret( + "foo_shared_secret", + self.encrypted_data, + "selected", + shared_repo_ids, + ) + + assert isinstance( + shared_secret, github3.actions.secrets.OrganizationSecret + ) + assert shared_secret.name == "FOO_SHARED_SECRET" + assert shared_secret.visibility == "selected" + shared_repos = shared_secret.selected_repositories() + assert shared_repos is not None + + shared_repo_count = 0 + for i in shared_repos: + shared_repo_count += 1 + assert i.id in shared_repo_ids + + assert shared_repo_count == 2 + + def test_organization_delete_secret(self): + """ + Test the ability to delete an organization secret. + """ + self.token_login() + + cassette_name = self.cassette_name("delete_secret") + with self.recorder.use_cassette(cassette_name): + org = self.gh.organization("gardenlinux") + first_delete = org.delete_secret("foo_org_secret") + second_delete = org.delete_secret("foo_org_secret") + + assert isinstance(first_delete, bool) + assert first_delete is True + assert isinstance(second_delete, bool) + assert second_delete is False + + def test_add_repo_to_shared_secret(self): + """ + Tests the ability to add a respository to a shared + organization secret. + """ + self.token_login() + + cassette_name = self.cassette_name("add_repo_to_shared_secret") + shared_repo_id_1 = 245713798 + shared_repo_id_2 = 517639342 + + with self.recorder.use_cassette(cassette_name): + org = self.gh.organization("gardenlinux") + secret = org.create_or_update_secret( + "foo_shared_secret", + self.encrypted_data, + "selected", + [shared_repo_id_1], + ) + + success = secret.add_selected_repository(shared_repo_id_2) + assert success is True + + shared_repos = secret.selected_repositories() + shared_repo_count = 0 + for i in shared_repos: + shared_repo_count += 1 + assert i.id in [shared_repo_id_1, shared_repo_id_2] + assert shared_repo_count == 2 + + def test_delete_repo_from_shared_secret(self): + """ + Tests the ability to delete a respository from a shared + organization secret. + """ + self.token_login() + + cassette_name = self.cassette_name("delete_repo_from_shared_secret") + shared_repo_id_1 = 245713798 + shared_repo_id_2 = 517639342 + + with self.recorder.use_cassette(cassette_name): + org = self.gh.organization("gardenlinux") + secret = org.create_or_update_secret( + "foo_shared_secret", + self.encrypted_data, + "selected", + [shared_repo_id_1, shared_repo_id_2], + ) + + success = secret.delete_selected_repository(shared_repo_id_2) + assert success is True + + shared_repos = secret.selected_repositories() + shared_repo_count = 0 + for i in shared_repos: + shared_repo_count += 1 + assert i.id != shared_repo_id_2 + assert shared_repo_count == 1 + + class TestOrganizationHook(IntegrationHelper): """Integration tests for OrganizationHook object.""" diff --git a/tests/integration/test_repos_repo.py b/tests/integration/test_repos_repo.py index 7f41f11d..1855108f 100644 --- a/tests/integration/test_repos_repo.py +++ b/tests/integration/test_repos_repo.py @@ -1423,6 +1423,120 @@ def test_traffic_clones(self): assert isinstance(v["count"], int) assert isinstance(v["uniques"], int) + def test_repository_public_key(self): + """ + Test the ability to retrieve a repository public key. + """ + self.token_login() + cassette_name = self.cassette_name("public_key") + with self.recorder.use_cassette(cassette_name): + repository = self.gh.repository("MrBatschner", "github3.py") + public_key = repository.public_key() + + assert isinstance(public_key, github3.actions.secrets.PublicKey) + assert public_key.key_id == "568250167242549743" + assert ( + public_key.key == "QySP8dCFzAo2101f0tJgz5BMDC80OKws7P30/vGoJBc=" + ) + + def test_repository_secrets(self): + """ + Test the ability to iterate over repository secrets. + """ + self.token_login() + + cassette_name = self.cassette_name("secrets") + secret_count = 0 + + with self.recorder.use_cassette(cassette_name): + repository = self.gh.repository("MrBatschner", "github3.py") + secrets_iter = repository.secrets() + + for s in secrets_iter: + secret_count += 1 + assert isinstance(s, github3.actions.secrets.RepositorySecret) + assert ( + s.name == "FOO_ITER_SECRET" or s.name == "BAR_ITER_SECRET" + ) + + assert secret_count == 2 + + def test_organization_secrets(self): + """ + Tests the ability to list all organization secrets shared with a + repository. + """ + self.token_login() + + cassette_name = self.cassette_name("organization-secrets") + secret_count = 0 + + with self.recorder.use_cassette(cassette_name): + repository = self.gh.repository("gardenlinux", "gardenlinux") + secrets_iter = repository.organization_secrets() + + for s in secrets_iter: + secret_count += 1 + assert isinstance( + s, github3.actions.secrets.SharedOrganizationSecret + ) + assert ( + s.name == "FOO_ORG_SECRET" or s.name == "BAR_ORG_SECRET" + ) + + assert secret_count == 2 + + def test_repository_secret(self): + """ + Test the ability to fetch a single repository secret. + """ + self.token_login() + + cassette_name = self.cassette_name("secret") + + with self.recorder.use_cassette(cassette_name): + repository = self.gh.repository("MrBatschner", "github3.py") + secret = repository.secret("BAR_SECRET") + + assert isinstance(secret, github3.actions.secrets.RepositorySecret) + assert secret.name == "BAR_SECRET" + + def test_repository_create_or_update_secret(self): + """ + Test the ability to create or update a repository secret. + """ + self.token_login() + encrypted_data = "peJfDjgtbr+FO7AJumPcdWNMjL2X1jYXycIKIlSVljXZLiy0yosjMsgjFF3qA62PUihD" # noqa: E501 + + cassette_name = self.cassette_name("create_or_update_secret") + with self.recorder.use_cassette(cassette_name): + repo = self.gh.repository("MrBatschner", "github3.py") + secret = repo.create_or_update_secret( + "bar_secret", encrypted_data + ) + + assert isinstance(secret, github3.actions.secrets.RepositorySecret) + assert secret.name == "BAR_SECRET" + assert isinstance(secret.created_at, datetime.datetime) + assert isinstance(secret.updated_at, datetime.datetime) + + def test_repository_delete_secret(self): + """ + Test the ability to delete a repository secret. + """ + self.token_login() + + cassette_name = self.cassette_name("delete_secret") + with self.recorder.use_cassette(cassette_name): + repo = self.gh.repository("MrBatschner", "github3.py") + first_delete = repo.delete_secret("foo_secret") + second_delete = repo.delete_secret("foo_secret") + + assert isinstance(first_delete, bool) + assert first_delete is True + assert isinstance(second_delete, bool) + assert second_delete is False + class TestContents(helper.IntegrationHelper): diff --git a/tests/unit/json/organization_secret_example b/tests/unit/json/organization_secret_example new file mode 100644 index 00000000..f48864de --- /dev/null +++ b/tests/unit/json/organization_secret_example @@ -0,0 +1,7 @@ +{ + "name": "EXAMPLE_SECRET", + "created_at": "2019-08-10T14:59:22Z", + "updated_at": "2020-01-10T14:59:22Z", + "visibility": "selected", + "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/secrets/EXAMPLE_SECRET/repositories" +} \ No newline at end of file diff --git a/tests/unit/json/secret_example b/tests/unit/json/secret_example new file mode 100644 index 00000000..dd1982ff --- /dev/null +++ b/tests/unit/json/secret_example @@ -0,0 +1,5 @@ +{ + "name": "EXAMPLE_SECRET", + "created_at": "2019-08-10T14:59:22Z", + "updated_at": "2020-01-10T14:59:22Z" +} \ No newline at end of file diff --git a/tests/unit/test_orgs.py b/tests/unit/test_orgs.py index 9a34f3b0..e63d6c9c 100644 --- a/tests/unit/test_orgs.py +++ b/tests/unit/test_orgs.py @@ -316,6 +316,26 @@ def test_remove_membership(self): url_for("memberships/username") ) + def test_create_invalid_organization_secret(self): + """ + Show that creating an organization secret with invalid values + will raise a ValueError. + """ + with pytest.raises(ValueError): + self.instance.create_or_update_secret( + secret_name="foo", + encrypted_value="bar", + visibility="invalid", + ) + + with pytest.raises(ValueError): + self.instance.create_or_update_secret( + secret_name="foo", + encrypted_value="bar", + visibility="selected", + selected_repo_ids=None, + ) + class TestOrganizationRequiresAuth(helper.UnitRequiresAuthenticationHelper): """Unit tests that ensure certain methods require authentication.""" diff --git a/tests/unit/test_secrets.py b/tests/unit/test_secrets.py new file mode 100644 index 00000000..a0361e16 --- /dev/null +++ b/tests/unit/test_secrets.py @@ -0,0 +1,117 @@ +"""Secret unit tests.""" +import pytest + +from . import helper + +import github3 + +get_secret_examlple_data = helper.create_example_data_helper("secret_example") +get_organization_secret_example_data = helper.create_example_data_helper( + "organization_secret_example" +) + + +class TestRepositorySecrets(helper.UnitHelper): + described_class = github3.actions.RepositorySecret + example_data = get_secret_examlple_data() + + def test_repr(self): + """Show that instance string is formatted properly.""" + assert repr(self.instance).startswith("