diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef1978619a..17efde6c33 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -94,7 +94,18 @@ app_private_key = "my_app_private_key" # Can be left empty if not used ``` If you use 2 factor authentication on your Github account, tests that require a login/password authentication will fail. -You can use `pytest Issue139.testCompletion --record --auth_with_token` to use the `oauth_token` field specified in `GithubCredentials.py` when recording a unit test interaction. Note that the `password = ""` (empty string is ok) must still be present in `GithubCredentials.py` to run the tests even when the `--auth_with_token` arg is used. (Also note that if you record your test data with `--auth_with_token` then you also need to be in token authentication mode when running the test. A simple alternative is to replace `token private_token_removed` with `Basic login_and_password_removed` in all your newly generated ReplayData files.) +You can use `pytest Issue139.testCompletion --record --auth_with_token` to use the `oauth_token` field specified in `GithubCredentials.py` when recording a unit test interaction. Note that the `password = ""` (empty string is ok) must still be present in `GithubCredentials.py` to run the tests even when the `--auth_with_token` arg is used. + +Also note that if you record your test data with `--auth_with_token` then you also need to be in token authentication mode when running the test. You can do this by setting `tokenAuthMode` to be true like so: + +```python + def setUp(self): + self.tokenAuthMode = True + super().setUp() + ... +``` + +A simple alternative is to replace `token private_token_removed` with `Basic login_and_password_removed` in all your newly generated ReplayData files. Similarly, you can use `pytest Issue139.testCompletion --record --auth_with_jwt` to use the `jwt` field specified in `GithubCredentials.py` to access endpoints that require JWT. diff --git a/github/Organization.py b/github/Organization.py index 22d22ac991..b6d4b93450 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -583,13 +583,23 @@ def create_secret( unencrypted_value: str, visibility: str = "all", selected_repositories: Opt[list[github.Repository.Repository]] = NotSet, + secret_type: str = "actions", ) -> github.OrganizationSecret.OrganizationSecret: """ - :calls: `PUT /orgs/{org}/actions/secrets/{secret_name} `_ + :param secret_name: string name of the secret + :param unencrypted_value: string plain text value of the secret + :param visibility: string options all or selected + :param selected_repositories: list of repositrories that the secret will be available in + :param secret_type: string options actions or dependabot + + :calls: `PUT /orgs/{org}/{secret_type}/secrets/{secret_name} `_ """ assert isinstance(secret_name, str), secret_name assert isinstance(unencrypted_value, str), unencrypted_value assert isinstance(visibility, str), visibility + assert is_optional_list(selected_repositories, github.Repository.Repository), selected_repositories + assert secret_type in ["actions", "dependabot"], "secret_type should be actions or dependabot" + if visibility == "selected": assert isinstance(selected_repositories, list) and all( isinstance(element, github.Repository.Repository) for element in selected_repositories @@ -597,7 +607,7 @@ def create_secret( else: assert selected_repositories is NotSet - public_key = self.get_public_key() + public_key = self.get_public_key(secret_type=secret_type) payload = public_key.encrypt(unencrypted_value) put_parameters: dict[str, Any] = { "key_id": public_key.key_id, @@ -605,10 +615,16 @@ def create_secret( "visibility": visibility, } if is_defined(selected_repositories): - put_parameters["selected_repository_ids"] = [element.id for element in selected_repositories] + # Dependbot and Actions endpoint expects different types + # https://docs.github.com/en/rest/dependabot/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret + # https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret + if secret_type == "actions": + put_parameters["selected_repository_ids"] = [element.id for element in selected_repositories] + if secret_type == "dependabot": + put_parameters["selected_repository_ids"] = [str(element.id) for element in selected_repositories] self._requester.requestJsonAndCheck( - "PUT", f"{self.url}/actions/secrets/{urllib.parse.quote(secret_name)}", input=put_parameters + "PUT", f"{self.url}/{secret_type}/secrets/{urllib.parse.quote(secret_name)}", input=put_parameters ) return github.OrganizationSecret.OrganizationSecret( @@ -617,8 +633,8 @@ def create_secret( attributes={ "name": secret_name, "visibility": visibility, - "selected_repositories_url": f"{self.url}/actions/secrets/{urllib.parse.quote(secret_name)}/repositories", - "url": f"{self.url}/actions/secrets/{urllib.parse.quote(secret_name)}", + "selected_repositories_url": f"{self.url}/{secret_type}/secrets/{urllib.parse.quote(secret_name)}/repositories", + "url": f"{self.url}/{secret_type}/secrets/{urllib.parse.quote(secret_name)}", }, completed=False, ) @@ -647,6 +663,7 @@ def get_secret(self, secret_name: str, secret_type: str = "actions") -> Organiza :rtype: github.OrganizationSecret.OrganizationSecret """ assert isinstance(secret_name, str), secret_name + assert secret_type in ["actions", "dependabot"], "secret_type should be actions or dependabot" return github.OrganizationSecret.OrganizationSecret( requester=self._requester, headers={}, @@ -1010,12 +1027,13 @@ def convert_to_outside_collaborator(self, member: NamedUser) -> None: "PUT", f"{self.url}/outside_collaborators/{member._identity}" ) - def get_public_key(self) -> PublicKey: + def get_public_key(self, secret_type: str = "actions") -> PublicKey: """ - :calls: `GET /orgs/{org}/actions/secrets/public-key `_ + :calls: `GET /orgs/{org}/{secret_type}/secrets/public-key `_ + :param secret_type: string options actions or dependabot :rtype: :class:`github.PublicKey.PublicKey` """ - headers, data = self._requester.requestJsonAndCheck("GET", f"{self.url}/actions/secrets/public-key") + headers, data = self._requester.requestJsonAndCheck("GET", f"{self.url}/{secret_type}/secrets/public-key") return github.PublicKey.PublicKey(self._requester, headers, data, completed=True) def get_repo(self, name: str) -> Repository: diff --git a/github/OrganizationSecret.py b/github/OrganizationSecret.py index 97e1173cf6..9c3fc30b91 100644 --- a/github/OrganizationSecret.py +++ b/github/OrganizationSecret.py @@ -70,16 +70,19 @@ def edit( self, value: str, visibility: str = "all", + secret_type: str = "actions", ) -> bool: """ - :calls: `PATCH /orgs/{org}/actions/secrets/{variable_name} `_ + :calls: `PATCH /orgs/{org}/{secret_type}/secrets/{variable_name} `_ :param variable_name: string :param value: string :param visibility: string + :param secret_type: string options actions or dependabot :rtype: bool """ assert isinstance(value, str), value assert isinstance(visibility, str), visibility + assert secret_type in ["actions", "dependabot"], "secret_type should be actions or dependabot" patch_parameters: Dict[str, Any] = { "name": self.name, @@ -89,7 +92,7 @@ def edit( status, _, _ = self._requester.requestJson( "PATCH", - f"{self.url}/actions/secrets/{self.name}", + f"{self.url}/{secret_type}/secrets/{self.name}", input=patch_parameters, ) return status == 204 diff --git a/github/Repository.py b/github/Repository.py index fd0c4a1843..6a02638538 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -1695,53 +1695,73 @@ def create_repository_dispatch(self, event_type: str, client_payload: Opt[dict[s status, headers, data = self._requester.requestJson("POST", f"{self.url}/dispatches", input=post_parameters) return status == 204 - def create_secret(self, secret_name: str, unencrypted_value: str) -> github.Secret.Secret: + def create_secret( + self, + secret_name: str, + unencrypted_value: str, + secret_type: str = "actions", + ) -> github.Secret.Secret: """ - :calls: `PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} `_ + :calls: `PUT /repos/{owner}/{repo}/{secret_type}/secrets/{secret_name} `_ + :param secret_type: string options actions or dependabot """ assert isinstance(secret_name, str), secret_name assert isinstance(unencrypted_value, str), unencrypted_value + assert secret_type in ["actions", "dependabot"], "secret_type should be actions or dependabot" + secret_name = urllib.parse.quote(secret_name) - public_key = self.get_public_key() + public_key = self.get_public_key(secret_type=secret_type) payload = public_key.encrypt(unencrypted_value) put_parameters = { "key_id": public_key.key_id, "encrypted_value": payload, } - self._requester.requestJsonAndCheck("PUT", f"{self.url}/actions/secrets/{secret_name}", input=put_parameters) + self._requester.requestJsonAndCheck( + "PUT", f"{self.url}/{secret_type}/secrets/{secret_name}", input=put_parameters + ) return github.Secret.Secret( requester=self._requester, headers={}, attributes={ "name": secret_name, - "url": f"{self.url}/actions/secrets/{secret_name}", + "url": f"{self.url}/{secret_type}/secrets/{secret_name}", }, completed=False, ) - def get_secrets(self) -> PaginatedList[github.Secret.Secret]: + def get_secrets( + self, + secret_type: str = "actions", + ) -> PaginatedList[github.Secret.Secret]: """ - Gets all repository secrets. + Gets all repository secrets :param secret_type: string options actions or dependabot. """ + assert secret_type in ["actions", "dependabot"], "secret_type should be actions or dependabot" + return PaginatedList( github.Secret.Secret, self._requester, - f"{self.url}/actions/secrets", + f"{self.url}/{secret_type}/secrets", None, - attributesTransformer=PaginatedList.override_attributes({"secrets_url": f"{self.url}/actions/secrets"}), + attributesTransformer=PaginatedList.override_attributes( + {"secrets_url": f"{self.url}/{secret_type}/secrets"} + ), list_item="secrets", ) - def get_secret(self, secret_name: str) -> github.Secret.Secret: + def get_secret(self, secret_name: str, secret_type: str = "actions") -> github.Secret.Secret: """ :calls: 'GET /repos/{owner}/{repo}/actions/secrets/{secret_name} `_ + :param secret_type: string options actions or dependabot """ assert isinstance(secret_name, str), secret_name + assert secret_type in ["actions", "dependabot"], "secret_type should be actions or dependabot" + secret_name = urllib.parse.quote(secret_name) return github.Secret.Secret( requester=self._requester, headers={}, - attributes={"url": f"{self.url}/actions/secrets/{secret_name}"}, + attributes={"url": f"{self.url}/{secret_type}/secrets/{secret_name}"}, completed=False, ) @@ -1795,15 +1815,17 @@ def get_variable(self, variable_name: str) -> github.Variable.Variable: completed=False, ) - def delete_secret(self, secret_name: str) -> bool: + def delete_secret(self, secret_name: str, secret_type: str = "actions") -> bool: """ - :calls: `DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name} `_ + :calls: `DELETE /repos/{owner}/{repo}/{secret_type}/secrets/{secret_name} `_ :param secret_name: string + :param secret_type: string options actions or dependabot :rtype: bool """ assert isinstance(secret_name, str), secret_name + assert secret_type in ["actions", "dependabot"], "secret_type should be actions or dependabot" secret_name = urllib.parse.quote(secret_name) - status, headers, data = self._requester.requestJson("DELETE", f"{self.url}/actions/secrets/{secret_name}") + status, headers, data = self._requester.requestJson("DELETE", f"{self.url}/{secret_type}/secrets/{secret_name}") return status == 204 def delete_variable(self, variable_name: str) -> bool: @@ -3004,12 +3026,15 @@ def get_network_events(self) -> PaginatedList[Event]: None, ) - def get_public_key(self) -> PublicKey: + def get_public_key(self, secret_type: str = "actions") -> PublicKey: """ :calls: `GET /repos/{owner}/{repo}/actions/secrets/public-key `_ + :param secret_type: string options actions or dependabot :rtype: :class:`github.PublicKey.PublicKey` """ - headers, data = self._requester.requestJsonAndCheck("GET", f"{self.url}/actions/secrets/public-key") + assert secret_type in ["actions", "dependabot"], "secret_type should be actions or dependabot" + + headers, data = self._requester.requestJsonAndCheck("GET", f"{self.url}/{secret_type}/secrets/public-key") return github.PublicKey.PublicKey(self._requester, headers, data, completed=True) def get_pull(self, number: int) -> PullRequest: diff --git a/tests/Organization.py b/tests/Organization.py index f0cfb4ca9e..ed64315654 100644 --- a/tests/Organization.py +++ b/tests/Organization.py @@ -429,19 +429,19 @@ def testCreateRepoFromTemplateWithAllArguments(self): self.assertEqual(repo.description, description) self.assertTrue(repo.private) - @mock.patch("github.PublicKey.encrypt") - def testCreateSecret(self, encrypt): - # encrypt returns a non-deterministic value, we need to mock it so the replay data matches - encrypt.return_value = "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b" - secret = self.org.create_secret("secret-name", "secret-value", "all") - self.assertIsNotNone(secret) - @mock.patch("github.PublicKey.encrypt") def testCreateSecretSelected(self, encrypt): repos = [self.org.get_repo("TestPyGithub"), self.org.get_repo("FatherBeaver")] # encrypt returns a non-deterministic value, we need to mock it so the replay data matches encrypt.return_value = "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b" - secret = self.org.create_secret("secret-name", "secret-value", "selected", repos) + secret = self.org.create_secret( + secret_name="secret-name", + unencrypted_value="secret-value", + visibility="selected", + secret_type="actions", + selected_repositories=repos, + ) + self.assertIsNotNone(secret) self.assertEqual(secret.visibility, "selected") self.assertEqual(list(secret.selected_repositories), repos) @@ -569,3 +569,61 @@ def testGetVariable(self): def testGetVariables(self): variables = self.org.get_variables() self.assertEqual(len(list(variables)), 1) + + @mock.patch("github.PublicKey.encrypt") + def testCreateActionsSecret(self, encrypt): + org = self.g.get_organization("demoorg") + # encrypt returns a non-deterministic value, we need to mock it so the replay data matches + encrypt.return_value = "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b" + secret = org.create_secret("secret_name", "secret-value", visibility="all") + self.assertIsNotNone(secret) + + @mock.patch("github.PublicKey.encrypt") + def testCreateDependabotSecret(self, encrypt): + org = self.g.get_organization("demoorg") + # encrypt returns a non-deterministic value, we need to mock it so the replay data matches + encrypt.return_value = "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b" + secret = org.create_secret("secret_name", "secret-value", secret_type="dependabot", visibility="all") + self.assertIsNotNone(secret) + + def testOrgGetSecretAssertion(self): + org = self.g.get_organization("demoorg") + with self.assertRaises(AssertionError) as exc: + org.get_secret(secret_name="splat", secret_type="supersecret") + self.assertEqual(str(exc.exception), "secret_type should be actions or dependabot") + + @mock.patch("github.PublicKey.encrypt") + def testCreateDependabotSecretSelected(self, encrypt): + org = self.g.get_organization("demoorg") + repos = [org.get_repo("demo-repo-1"), org.get_repo("demo-repo-2")] + # encrypt returns a non-deterministic value, we need to mock it so the replay data matches + encrypt.return_value = "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b" + secret = org.create_secret( + secret_name="SECRET_DEP_NAME", + unencrypted_value="secret-value", + visibility="selected", + secret_type="dependabot", + selected_repositories=repos, + ) + + self.assertIsNotNone(secret) + self.assertEqual(secret.visibility, "selected") + self.assertEqual(list(secret.selected_repositories), repos) + + @mock.patch("github.PublicKey.encrypt") + def testOrgSecretEdit(self, encrypt): + org = self.g.get_organization("demoorg") + repos = [org.get_repo("demo-repo-1"), org.get_repo("demo-repo-2")] + # encrypt returns a non-deterministic value, we need to mock it so the replay data matches + encrypt.return_value = "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b" + secret = org.create_secret( + secret_name="secret_act_name", + unencrypted_value="secret-value", + visibility="selected", + secret_type="actions", + selected_repositories=repos, + ) + + with self.assertRaises(AssertionError) as exc: + secret.edit(value="newvalue", secret_type="supersecret") + self.assertEqual(str(exc.exception), "secret_type should be actions or dependabot") diff --git a/tests/ReplayData/Organization.testCreateActionsSecret.txt b/tests/ReplayData/Organization.testCreateActionsSecret.txt new file mode 100644 index 0000000000..447a034cb7 --- /dev/null +++ b/tests/ReplayData/Organization.testCreateActionsSecret.txt @@ -0,0 +1,32 @@ +https +GET +api.github.com +None +/orgs/demoorg +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:38: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/"fdd3ad04d14a1c6deb0a4a1fbcc104a59889084ffa9e75d80a66f6b7a54ec074"'), ('Last-Modified', 'Wed, 17 Jan 2024 22:24:36 GMT'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'admin:org, read:org, repo, user, write:org'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4998'), ('X-RateLimit-Reset', '1706834317'), ('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', 'EDD0:6F665:EB314B6:ED7870E:65BC2B7D')] +{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","url":"https://api.github.com/orgs/demoorg","repos_url":"https://api.github.com/orgs/demoorg/repos","events_url":"https://api.github.com/orgs/demoorg/events","hooks_url":"https://api.github.com/orgs/demoorg/hooks","issues_url":"https://api.github.com/orgs/demoorg/issues","members_url":"https://api.github.com/orgs/demoorg/members{/member}","public_members_url":"https://api.github.com/orgs/demoorg/public_members{/member}","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","description":null,"is_verified":false,"has_organization_projects":true,"has_repository_projects":true,"public_repos":3,"public_gists":0,"followers":0,"following":0,"html_url":"https://github.com/demoorg","created_at":"2024-01-17T20:14:26Z","updated_at":"2024-01-17T22:24:36Z","archived_at":null,"type":"Organization","total_private_repos":0,"owned_private_repos":0,"private_gists":0,"disk_usage":5,"collaborators":0,"billing_email":"me@example.com","default_repository_permission":"read","members_can_create_repositories":true,"two_factor_requirement_enabled":true,"members_allowed_repository_creation_type":"all","members_can_create_public_repositories":true,"members_can_create_private_repositories":true,"members_can_create_internal_repositories":false,"members_can_create_pages":true,"members_can_fork_private_repositories":false,"web_commit_signoff_required":false,"members_can_create_public_pages":true,"members_can_create_private_pages":true,"plan":{"name":"free","space":976562499,"private_repos":10000,"filled_seats":2,"seats":0},"advanced_security_enabled_for_new_repositories":false,"dependabot_alerts_enabled_for_new_repositories":false,"dependabot_security_updates_enabled_for_new_repositories":false,"dependency_graph_enabled_for_new_repositories":false,"secret_scanning_enabled_for_new_repositories":false,"secret_scanning_push_protection_enabled_for_new_repositories":false,"secret_scanning_push_protection_custom_link_enabled":false,"secret_scanning_push_protection_custom_link":null,"secret_scanning_validity_checks_enabled":false} + +https +GET +api.github.com +None +/orgs/demoorg/actions/secrets/public-key +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:38: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/"326d11de4f24fa979dbeeaee53a8d66cd9957752fc68342c1f9b9095f9f7c03b"'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'admin:org'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4997'), ('X-RateLimit-Reset', '1706834317'), ('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'"), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'EDD1:53734:E02874D:E26F579:65BC2B7D')] +{"key_id":"3380204578043523366","key":"lEcXo0mlVf630hnPSTSCuXmGo2CxuIAKT7RRvZ1QjB4="} + +https +PUT +api.github.com +None +/orgs/demoorg/actions/secrets/secret_name +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"key_id": "3380204578043523366", "encrypted_value": "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b", "visibility": "all"} +201 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:38:38 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', '"ef7d1a03b3332b83aecd008a006821ad3613d37a6ec742a794010bc2d93610cf"'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'admin:org'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4996'), ('X-RateLimit-Reset', '1706834317'), ('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'"), ('X-GitHub-Request-Id', 'EDD2:39C98A:1E5CAD8:1EAD780:65BC2B7E')] +{} diff --git a/tests/ReplayData/Organization.testCreateDependabotSecret.txt b/tests/ReplayData/Organization.testCreateDependabotSecret.txt new file mode 100644 index 0000000000..33af3e296e --- /dev/null +++ b/tests/ReplayData/Organization.testCreateDependabotSecret.txt @@ -0,0 +1,32 @@ +https +GET +api.github.com +None +/orgs/demoorg +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:05:44 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/"fdd3ad04d14a1c6deb0a4a1fbcc104a59889084ffa9e75d80a66f6b7a54ec074"'), ('Last-Modified', 'Wed, 17 Jan 2024 22:24:36 GMT'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'admin:org, read:org, repo, user, write:org'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4931'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '69'), ('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', 'ED05:2C9777:E41C658:E65E1E5:65BC23C8')] +{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","url":"https://api.github.com/orgs/demoorg","repos_url":"https://api.github.com/orgs/demoorg/repos","events_url":"https://api.github.com/orgs/demoorg/events","hooks_url":"https://api.github.com/orgs/demoorg/hooks","issues_url":"https://api.github.com/orgs/demoorg/issues","members_url":"https://api.github.com/orgs/demoorg/members{/member}","public_members_url":"https://api.github.com/orgs/demoorg/public_members{/member}","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","description":null,"is_verified":false,"has_organization_projects":true,"has_repository_projects":true,"public_repos":3,"public_gists":0,"followers":0,"following":0,"html_url":"https://github.com/demoorg","created_at":"2024-01-17T20:14:26Z","updated_at":"2024-01-17T22:24:36Z","archived_at":null,"type":"Organization","total_private_repos":0,"owned_private_repos":0,"private_gists":0,"disk_usage":5,"collaborators":0,"billing_email":"me@example.com","default_repository_permission":"read","members_can_create_repositories":true,"two_factor_requirement_enabled":true,"members_allowed_repository_creation_type":"all","members_can_create_public_repositories":true,"members_can_create_private_repositories":true,"members_can_create_internal_repositories":false,"members_can_create_pages":true,"members_can_fork_private_repositories":false,"web_commit_signoff_required":false,"members_can_create_public_pages":true,"members_can_create_private_pages":true,"plan":{"name":"free","space":976562499,"private_repos":10000,"filled_seats":2,"seats":0},"advanced_security_enabled_for_new_repositories":false,"dependabot_alerts_enabled_for_new_repositories":false,"dependabot_security_updates_enabled_for_new_repositories":false,"dependency_graph_enabled_for_new_repositories":false,"secret_scanning_enabled_for_new_repositories":false,"secret_scanning_push_protection_enabled_for_new_repositories":false,"secret_scanning_push_protection_custom_link_enabled":false,"secret_scanning_push_protection_custom_link":null,"secret_scanning_validity_checks_enabled":false} + +https +GET +api.github.com +None +/orgs/demoorg/dependabot/secrets/public-key +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:05:44 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/"4f57ae8fba32f7b438a3b02f56bb750c7bac58f35ae00ae9e366f5a8974888b9"'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'admin:org'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4930'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '70'), ('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', 'ED06:18EF96:DEDD9D3:E11F4DA:65BC23C8')] +{"key_id":"3380217566468950943","key":"HYk6AFuoV0iI+t+geHowOxji1OKAGW6GtngRFeETM14="} + +https +PUT +api.github.com +None +/orgs/demoorg/dependabot/secrets/secret_name +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"key_id": "3380217566468950943", "encrypted_value": "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b", "visibility": "all"} +201 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:05:45 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', '"ef7d1a03b3332b83aecd008a006821ad3613d37a6ec742a794010bc2d93610cf"'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'admin:org'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4929'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '71'), ('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', 'ED07:7E6D9:E68F7CC:E8D1392:65BC23C8')] +{} diff --git a/tests/ReplayData/Organization.testCreateDependabotSecretSelected.txt b/tests/ReplayData/Organization.testCreateDependabotSecretSelected.txt new file mode 100644 index 0000000000..36dc4e6a76 --- /dev/null +++ b/tests/ReplayData/Organization.testCreateDependabotSecretSelected.txt @@ -0,0 +1,65 @@ +https +GET +api.github.com +None +/orgs/demoorg +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:05:45 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/"fdd3ad04d14a1c6deb0a4a1fbcc104a59889084ffa9e75d80a66f6b7a54ec074"'), ('Last-Modified', 'Wed, 17 Jan 2024 22:24:36 GMT'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'admin:org, read:org, repo, user, write:org'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4927'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '73'), ('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', 'ED09:5E18E:E497844:E6D91FF:65BC23C9')] +{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","url":"https://api.github.com/orgs/demoorg","repos_url":"https://api.github.com/orgs/demoorg/repos","events_url":"https://api.github.com/orgs/demoorg/events","hooks_url":"https://api.github.com/orgs/demoorg/hooks","issues_url":"https://api.github.com/orgs/demoorg/issues","members_url":"https://api.github.com/orgs/demoorg/members{/member}","public_members_url":"https://api.github.com/orgs/demoorg/public_members{/member}","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","description":null,"is_verified":false,"has_organization_projects":true,"has_repository_projects":true,"public_repos":3,"public_gists":0,"followers":0,"following":0,"html_url":"https://github.com/demoorg","created_at":"2024-01-17T20:14:26Z","updated_at":"2024-01-17T22:24:36Z","archived_at":null,"type":"Organization","total_private_repos":0,"owned_private_repos":0,"private_gists":0,"disk_usage":5,"collaborators":0,"billing_email":"me@example.com","default_repository_permission":"read","members_can_create_repositories":true,"two_factor_requirement_enabled":true,"members_allowed_repository_creation_type":"all","members_can_create_public_repositories":true,"members_can_create_private_repositories":true,"members_can_create_internal_repositories":false,"members_can_create_pages":true,"members_can_fork_private_repositories":false,"web_commit_signoff_required":false,"members_can_create_public_pages":true,"members_can_create_private_pages":true,"plan":{"name":"free","space":976562499,"private_repos":10000,"filled_seats":2,"seats":0},"advanced_security_enabled_for_new_repositories":false,"dependabot_alerts_enabled_for_new_repositories":false,"dependabot_security_updates_enabled_for_new_repositories":false,"dependency_graph_enabled_for_new_repositories":false,"secret_scanning_enabled_for_new_repositories":false,"secret_scanning_push_protection_enabled_for_new_repositories":false,"secret_scanning_push_protection_custom_link_enabled":false,"secret_scanning_push_protection_custom_link":null,"secret_scanning_validity_checks_enabled":false} + +https +GET +api.github.com +None +/repos/demoorg/demo-repo-1 +{'Accept': 'application/vnd.github.nebula-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:05:46 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/"7d6947bb6dc9709c7b930fe8f18991f5210224d5319fa50eb248979e9acf0627"'), ('Last-Modified', 'Wed, 17 Jan 2024 20:16:00 GMT'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; param=nebula-preview; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4926'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '74'), ('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', 'ED0A:D6070:7130FF9:7257CAB:65BC23C9')] +{"id":744692002,"node_id":"R_kgDOLGMZIg","name":"demo-repo-1","full_name":"demoorg/demo-repo-1","private":false,"owner":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/demoorg/demo-repo-1","description":null,"fork":false,"url":"https://api.github.com/repos/demoorg/demo-repo-1","forks_url":"https://api.github.com/repos/demoorg/demo-repo-1/forks","keys_url":"https://api.github.com/repos/demoorg/demo-repo-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/demoorg/demo-repo-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/demoorg/demo-repo-1/teams","hooks_url":"https://api.github.com/repos/demoorg/demo-repo-1/hooks","issue_events_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues/events{/number}","events_url":"https://api.github.com/repos/demoorg/demo-repo-1/events","assignees_url":"https://api.github.com/repos/demoorg/demo-repo-1/assignees{/user}","branches_url":"https://api.github.com/repos/demoorg/demo-repo-1/branches{/branch}","tags_url":"https://api.github.com/repos/demoorg/demo-repo-1/tags","blobs_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/demoorg/demo-repo-1/statuses/{sha}","languages_url":"https://api.github.com/repos/demoorg/demo-repo-1/languages","stargazers_url":"https://api.github.com/repos/demoorg/demo-repo-1/stargazers","contributors_url":"https://api.github.com/repos/demoorg/demo-repo-1/contributors","subscribers_url":"https://api.github.com/repos/demoorg/demo-repo-1/subscribers","subscription_url":"https://api.github.com/repos/demoorg/demo-repo-1/subscription","commits_url":"https://api.github.com/repos/demoorg/demo-repo-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/demoorg/demo-repo-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/demoorg/demo-repo-1/contents/{+path}","compare_url":"https://api.github.com/repos/demoorg/demo-repo-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/demoorg/demo-repo-1/merges","archive_url":"https://api.github.com/repos/demoorg/demo-repo-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/demoorg/demo-repo-1/downloads","issues_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues{/number}","pulls_url":"https://api.github.com/repos/demoorg/demo-repo-1/pulls{/number}","milestones_url":"https://api.github.com/repos/demoorg/demo-repo-1/milestones{/number}","notifications_url":"https://api.github.com/repos/demoorg/demo-repo-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/demoorg/demo-repo-1/labels{/name}","releases_url":"https://api.github.com/repos/demoorg/demo-repo-1/releases{/id}","deployments_url":"https://api.github.com/repos/demoorg/demo-repo-1/deployments","created_at":"2024-01-17T20:15:59Z","updated_at":"2024-01-17T20:16:00Z","pushed_at":"2024-01-17T20:16:00Z","git_url":"git://github.com/demoorg/demo-repo-1.git","ssh_url":"git@github.com:demoorg/demo-repo-1.git","clone_url":"https://github.com/demoorg/demo-repo-1.git","svn_url":"https://github.com/demoorg/demo-repo-1","homepage":null,"size":5,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main","permissions":{"admin":true,"maintain":true,"push":true,"triage":true,"pull":true},"temp_clone_token":"","allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"allow_auto_merge":false,"delete_branch_on_merge":false,"allow_update_branch":false,"use_squash_pr_title_as_default":false,"squash_merge_commit_message":"COMMIT_MESSAGES","squash_merge_commit_title":"COMMIT_OR_PR_TITLE","merge_commit_message":"PR_TITLE","merge_commit_title":"MERGE_MESSAGE","custom_properties":{},"organization":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"security_and_analysis":{"secret_scanning":{"status":"disabled"},"secret_scanning_push_protection":{"status":"disabled"},"dependabot_security_updates":{"status":"disabled"},"secret_scanning_validity_checks":{"status":"disabled"}},"network_count":0,"subscribers_count":0} + +https +GET +api.github.com +None +/repos/demoorg/demo-repo-2 +{'Accept': 'application/vnd.github.nebula-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:05:46 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/"692b43682cf160985c81fe3af42dc9e2cf18886063e3d33e74568865389a3a33"'), ('Last-Modified', 'Thu, 01 Feb 2024 18:15:57 GMT'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; param=nebula-preview; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4925'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '75'), ('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', 'ED0B:3D0E38:2904481:296D1C5:65BC23CA')] +{"id":751491527,"node_id":"R_kgDOLMrZxw","name":"demo-repo-2","full_name":"demoorg/demo-repo-2","private":false,"owner":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/demoorg/demo-repo-2","description":null,"fork":false,"url":"https://api.github.com/repos/demoorg/demo-repo-2","forks_url":"https://api.github.com/repos/demoorg/demo-repo-2/forks","keys_url":"https://api.github.com/repos/demoorg/demo-repo-2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/demoorg/demo-repo-2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/demoorg/demo-repo-2/teams","hooks_url":"https://api.github.com/repos/demoorg/demo-repo-2/hooks","issue_events_url":"https://api.github.com/repos/demoorg/demo-repo-2/issues/events{/number}","events_url":"https://api.github.com/repos/demoorg/demo-repo-2/events","assignees_url":"https://api.github.com/repos/demoorg/demo-repo-2/assignees{/user}","branches_url":"https://api.github.com/repos/demoorg/demo-repo-2/branches{/branch}","tags_url":"https://api.github.com/repos/demoorg/demo-repo-2/tags","blobs_url":"https://api.github.com/repos/demoorg/demo-repo-2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/demoorg/demo-repo-2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/demoorg/demo-repo-2/git/refs{/sha}","trees_url":"https://api.github.com/repos/demoorg/demo-repo-2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/demoorg/demo-repo-2/statuses/{sha}","languages_url":"https://api.github.com/repos/demoorg/demo-repo-2/languages","stargazers_url":"https://api.github.com/repos/demoorg/demo-repo-2/stargazers","contributors_url":"https://api.github.com/repos/demoorg/demo-repo-2/contributors","subscribers_url":"https://api.github.com/repos/demoorg/demo-repo-2/subscribers","subscription_url":"https://api.github.com/repos/demoorg/demo-repo-2/subscription","commits_url":"https://api.github.com/repos/demoorg/demo-repo-2/commits{/sha}","git_commits_url":"https://api.github.com/repos/demoorg/demo-repo-2/git/commits{/sha}","comments_url":"https://api.github.com/repos/demoorg/demo-repo-2/comments{/number}","issue_comment_url":"https://api.github.com/repos/demoorg/demo-repo-2/issues/comments{/number}","contents_url":"https://api.github.com/repos/demoorg/demo-repo-2/contents/{+path}","compare_url":"https://api.github.com/repos/demoorg/demo-repo-2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/demoorg/demo-repo-2/merges","archive_url":"https://api.github.com/repos/demoorg/demo-repo-2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/demoorg/demo-repo-2/downloads","issues_url":"https://api.github.com/repos/demoorg/demo-repo-2/issues{/number}","pulls_url":"https://api.github.com/repos/demoorg/demo-repo-2/pulls{/number}","milestones_url":"https://api.github.com/repos/demoorg/demo-repo-2/milestones{/number}","notifications_url":"https://api.github.com/repos/demoorg/demo-repo-2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/demoorg/demo-repo-2/labels{/name}","releases_url":"https://api.github.com/repos/demoorg/demo-repo-2/releases{/id}","deployments_url":"https://api.github.com/repos/demoorg/demo-repo-2/deployments","created_at":"2024-02-01T18:02:27Z","updated_at":"2024-02-01T18:15:57Z","pushed_at":"2024-02-01T18:02:28Z","git_url":"git://github.com/demoorg/demo-repo-2.git","ssh_url":"git@github.com:demoorg/demo-repo-2.git","clone_url":"https://github.com/demoorg/demo-repo-2.git","svn_url":"https://github.com/demoorg/demo-repo-2","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":null,"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main","permissions":{"admin":true,"maintain":true,"push":true,"triage":true,"pull":true},"temp_clone_token":"","allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"allow_auto_merge":false,"delete_branch_on_merge":false,"allow_update_branch":false,"use_squash_pr_title_as_default":false,"squash_merge_commit_message":"COMMIT_MESSAGES","squash_merge_commit_title":"COMMIT_OR_PR_TITLE","merge_commit_message":"PR_TITLE","merge_commit_title":"MERGE_MESSAGE","custom_properties":{},"organization":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"security_and_analysis":{"secret_scanning":{"status":"disabled"},"secret_scanning_push_protection":{"status":"disabled"},"dependabot_security_updates":{"status":"disabled"},"secret_scanning_validity_checks":{"status":"disabled"}},"network_count":0,"subscribers_count":0} + +https +GET +api.github.com +None +/orgs/demoorg/dependabot/secrets/public-key +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:05:47 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/"4f57ae8fba32f7b438a3b02f56bb750c7bac58f35ae00ae9e366f5a8974888b9"'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'admin:org'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4924'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '76'), ('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', 'ED0C:18EF96:DEDE0F4:E11FC25:65BC23CA')] +{"key_id":"3380217566468950943","key":"HYk6AFuoV0iI+t+geHowOxji1OKAGW6GtngRFeETM14="} + +https +PUT +api.github.com +None +/orgs/demoorg/dependabot/secrets/SECRET_DEP_NAME +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"key_id": "3380217566468950943", "encrypted_value": "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b", "visibility": "selected", "selected_repository_ids": ["744692002", "751491527"]} +204 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:05:47 GMT'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'admin:org'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4923'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '77'), ('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', 'ED0D:3B4C54:45EB070:469E8E3:65BC23CB')] + + +https +GET +api.github.com +None +/orgs/demoorg/dependabot/secrets/SECRET_DEP_NAME/repositories +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:05:47 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/"fb1e023094152db42e0a786bd0caca69105ead37efff1ca109beb50b277b6988"'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'admin:org'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4922'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '78'), ('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', 'ED0E:19A112:DAF348F:DD351D1:65BC23CB')] +{"total_count":2,"repositories":[{"id":744692002,"node_id":"R_kgDOLGMZIg","name":"demo-repo-1","full_name":"demoorg/demo-repo-1","private":false,"owner":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/demoorg/demo-repo-1","description":null,"fork":false,"url":"https://api.github.com/repos/demoorg/demo-repo-1","forks_url":"https://api.github.com/repos/demoorg/demo-repo-1/forks","keys_url":"https://api.github.com/repos/demoorg/demo-repo-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/demoorg/demo-repo-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/demoorg/demo-repo-1/teams","hooks_url":"https://api.github.com/repos/demoorg/demo-repo-1/hooks","issue_events_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues/events{/number}","events_url":"https://api.github.com/repos/demoorg/demo-repo-1/events","assignees_url":"https://api.github.com/repos/demoorg/demo-repo-1/assignees{/user}","branches_url":"https://api.github.com/repos/demoorg/demo-repo-1/branches{/branch}","tags_url":"https://api.github.com/repos/demoorg/demo-repo-1/tags","blobs_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/demoorg/demo-repo-1/statuses/{sha}","languages_url":"https://api.github.com/repos/demoorg/demo-repo-1/languages","stargazers_url":"https://api.github.com/repos/demoorg/demo-repo-1/stargazers","contributors_url":"https://api.github.com/repos/demoorg/demo-repo-1/contributors","subscribers_url":"https://api.github.com/repos/demoorg/demo-repo-1/subscribers","subscription_url":"https://api.github.com/repos/demoorg/demo-repo-1/subscription","commits_url":"https://api.github.com/repos/demoorg/demo-repo-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/demoorg/demo-repo-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/demoorg/demo-repo-1/contents/{+path}","compare_url":"https://api.github.com/repos/demoorg/demo-repo-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/demoorg/demo-repo-1/merges","archive_url":"https://api.github.com/repos/demoorg/demo-repo-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/demoorg/demo-repo-1/downloads","issues_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues{/number}","pulls_url":"https://api.github.com/repos/demoorg/demo-repo-1/pulls{/number}","milestones_url":"https://api.github.com/repos/demoorg/demo-repo-1/milestones{/number}","notifications_url":"https://api.github.com/repos/demoorg/demo-repo-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/demoorg/demo-repo-1/labels{/name}","releases_url":"https://api.github.com/repos/demoorg/demo-repo-1/releases{/id}","deployments_url":"https://api.github.com/repos/demoorg/demo-repo-1/deployments"},{"id":751491527,"node_id":"R_kgDOLMrZxw","name":"demo-repo-2","full_name":"demoorg/demo-repo-2","private":false,"owner":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/demoorg/demo-repo-2","description":null,"fork":false,"url":"https://api.github.com/repos/demoorg/demo-repo-2","forks_url":"https://api.github.com/repos/demoorg/demo-repo-2/forks","keys_url":"https://api.github.com/repos/demoorg/demo-repo-2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/demoorg/demo-repo-2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/demoorg/demo-repo-2/teams","hooks_url":"https://api.github.com/repos/demoorg/demo-repo-2/hooks","issue_events_url":"https://api.github.com/repos/demoorg/demo-repo-2/issues/events{/number}","events_url":"https://api.github.com/repos/demoorg/demo-repo-2/events","assignees_url":"https://api.github.com/repos/demoorg/demo-repo-2/assignees{/user}","branches_url":"https://api.github.com/repos/demoorg/demo-repo-2/branches{/branch}","tags_url":"https://api.github.com/repos/demoorg/demo-repo-2/tags","blobs_url":"https://api.github.com/repos/demoorg/demo-repo-2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/demoorg/demo-repo-2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/demoorg/demo-repo-2/git/refs{/sha}","trees_url":"https://api.github.com/repos/demoorg/demo-repo-2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/demoorg/demo-repo-2/statuses/{sha}","languages_url":"https://api.github.com/repos/demoorg/demo-repo-2/languages","stargazers_url":"https://api.github.com/repos/demoorg/demo-repo-2/stargazers","contributors_url":"https://api.github.com/repos/demoorg/demo-repo-2/contributors","subscribers_url":"https://api.github.com/repos/demoorg/demo-repo-2/subscribers","subscription_url":"https://api.github.com/repos/demoorg/demo-repo-2/subscription","commits_url":"https://api.github.com/repos/demoorg/demo-repo-2/commits{/sha}","git_commits_url":"https://api.github.com/repos/demoorg/demo-repo-2/git/commits{/sha}","comments_url":"https://api.github.com/repos/demoorg/demo-repo-2/comments{/number}","issue_comment_url":"https://api.github.com/repos/demoorg/demo-repo-2/issues/comments{/number}","contents_url":"https://api.github.com/repos/demoorg/demo-repo-2/contents/{+path}","compare_url":"https://api.github.com/repos/demoorg/demo-repo-2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/demoorg/demo-repo-2/merges","archive_url":"https://api.github.com/repos/demoorg/demo-repo-2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/demoorg/demo-repo-2/downloads","issues_url":"https://api.github.com/repos/demoorg/demo-repo-2/issues{/number}","pulls_url":"https://api.github.com/repos/demoorg/demo-repo-2/pulls{/number}","milestones_url":"https://api.github.com/repos/demoorg/demo-repo-2/milestones{/number}","notifications_url":"https://api.github.com/repos/demoorg/demo-repo-2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/demoorg/demo-repo-2/labels{/name}","releases_url":"https://api.github.com/repos/demoorg/demo-repo-2/releases{/id}","deployments_url":"https://api.github.com/repos/demoorg/demo-repo-2/deployments"}]} diff --git a/tests/ReplayData/Organization.testCreateSecret.txt b/tests/ReplayData/Organization.testCreateSecret.txt deleted file mode 100644 index be828cceaf..0000000000 --- a/tests/ReplayData/Organization.testCreateSecret.txt +++ /dev/null @@ -1,21 +0,0 @@ -https -GET -api.github.com -None -/orgs/BeaverSoftware/actions/secrets/public-key -{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} -None -200 -[('status', '200 OK'), ('x-ratelimit-remaining', '4978'), ('content-length', '487'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1dd282b50e691f8f162ef9355dad8771"'), ('date', 'Thu, 10 May 2012 19:03:19 GMT'), ('content-type', 'application/json; charset=utf-8')] -{"key": "u5e1Z25+z8pmgVVt5Pd8k0z/sKpVL1MXYtRAecE4vm8=", "key_id": "568250167242549743"} - -https -PUT -api.github.com -None -/orgs/BeaverSoftware/actions/secrets/secret-name -{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} -{"encrypted_value": "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b", "key_id": "568250167242549743", "visibility": "all"} -201 -[('Date', 'Fri, 17 Apr 2020 00:12:33 GMT'), ('Server', 'GitHub.com'), ('Content-Length', '2'), ('Content-Type', 'application/json; charset=utf-8'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4984'), ('X-RateLimit-Reset', '1587085388'), ('X-OAuth-Scopes', 'read:org, repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, 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', '1; mode=block'), ('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', 'C290:52DA:50234:B404B:5E98F470')] -{} diff --git a/tests/ReplayData/Organization.testOrgGetSecretAssertion.txt b/tests/ReplayData/Organization.testOrgGetSecretAssertion.txt new file mode 100644 index 0000000000..8f11fa7ea8 --- /dev/null +++ b/tests/ReplayData/Organization.testOrgGetSecretAssertion.txt @@ -0,0 +1,10 @@ +https +GET +api.github.com +None +/orgs/demoorg +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:38:55 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/"fdd3ad04d14a1c6deb0a4a1fbcc104a59889084ffa9e75d80a66f6b7a54ec074"'), ('Last-Modified', 'Wed, 17 Jan 2024 22:24:36 GMT'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'admin:org, read:org, repo, user, write:org'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4994'), ('X-RateLimit-Reset', '1706834317'), ('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', 'EDD5:2508B2:9AE6C80:9C7B574:65BC2B8F')] +{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","url":"https://api.github.com/orgs/demoorg","repos_url":"https://api.github.com/orgs/demoorg/repos","events_url":"https://api.github.com/orgs/demoorg/events","hooks_url":"https://api.github.com/orgs/demoorg/hooks","issues_url":"https://api.github.com/orgs/demoorg/issues","members_url":"https://api.github.com/orgs/demoorg/members{/member}","public_members_url":"https://api.github.com/orgs/demoorg/public_members{/member}","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","description":null,"is_verified":false,"has_organization_projects":true,"has_repository_projects":true,"public_repos":3,"public_gists":0,"followers":0,"following":0,"html_url":"https://github.com/demoorg","created_at":"2024-01-17T20:14:26Z","updated_at":"2024-01-17T22:24:36Z","archived_at":null,"type":"Organization","total_private_repos":0,"owned_private_repos":0,"private_gists":0,"disk_usage":5,"collaborators":0,"billing_email":"me@example.com","default_repository_permission":"read","members_can_create_repositories":true,"two_factor_requirement_enabled":true,"members_allowed_repository_creation_type":"all","members_can_create_public_repositories":true,"members_can_create_private_repositories":true,"members_can_create_internal_repositories":false,"members_can_create_pages":true,"members_can_fork_private_repositories":false,"web_commit_signoff_required":false,"members_can_create_public_pages":true,"members_can_create_private_pages":true,"plan":{"name":"free","space":976562499,"private_repos":10000,"filled_seats":2,"seats":0},"advanced_security_enabled_for_new_repositories":false,"dependabot_alerts_enabled_for_new_repositories":false,"dependabot_security_updates_enabled_for_new_repositories":false,"dependency_graph_enabled_for_new_repositories":false,"secret_scanning_enabled_for_new_repositories":false,"secret_scanning_push_protection_enabled_for_new_repositories":false,"secret_scanning_push_protection_custom_link_enabled":false,"secret_scanning_push_protection_custom_link":null,"secret_scanning_validity_checks_enabled":false} diff --git a/tests/ReplayData/Organization.testOrgSecretEdit.txt b/tests/ReplayData/Organization.testOrgSecretEdit.txt new file mode 100644 index 0000000000..9d02611ce3 --- /dev/null +++ b/tests/ReplayData/Organization.testOrgSecretEdit.txt @@ -0,0 +1,53 @@ +https +GET +api.github.com +None +/orgs/demoorg +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:06:55 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/"fdd3ad04d14a1c6deb0a4a1fbcc104a59889084ffa9e75d80a66f6b7a54ec074"'), ('Last-Modified', 'Wed, 17 Jan 2024 22:24:36 GMT'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'admin:org, read:org, repo, user, write:org'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4920'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '80'), ('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', 'ED12:D6070:71412E7:7268274:65BC240F')] +{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","url":"https://api.github.com/orgs/demoorg","repos_url":"https://api.github.com/orgs/demoorg/repos","events_url":"https://api.github.com/orgs/demoorg/events","hooks_url":"https://api.github.com/orgs/demoorg/hooks","issues_url":"https://api.github.com/orgs/demoorg/issues","members_url":"https://api.github.com/orgs/demoorg/members{/member}","public_members_url":"https://api.github.com/orgs/demoorg/public_members{/member}","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","description":null,"is_verified":false,"has_organization_projects":true,"has_repository_projects":true,"public_repos":3,"public_gists":0,"followers":0,"following":0,"html_url":"https://github.com/demoorg","created_at":"2024-01-17T20:14:26Z","updated_at":"2024-01-17T22:24:36Z","archived_at":null,"type":"Organization","total_private_repos":0,"owned_private_repos":0,"private_gists":0,"disk_usage":5,"collaborators":0,"billing_email":"me@example.com","default_repository_permission":"read","members_can_create_repositories":true,"two_factor_requirement_enabled":true,"members_allowed_repository_creation_type":"all","members_can_create_public_repositories":true,"members_can_create_private_repositories":true,"members_can_create_internal_repositories":false,"members_can_create_pages":true,"members_can_fork_private_repositories":false,"web_commit_signoff_required":false,"members_can_create_public_pages":true,"members_can_create_private_pages":true,"plan":{"name":"free","space":976562499,"private_repos":10000,"filled_seats":2,"seats":0},"advanced_security_enabled_for_new_repositories":false,"dependabot_alerts_enabled_for_new_repositories":false,"dependabot_security_updates_enabled_for_new_repositories":false,"dependency_graph_enabled_for_new_repositories":false,"secret_scanning_enabled_for_new_repositories":false,"secret_scanning_push_protection_enabled_for_new_repositories":false,"secret_scanning_push_protection_custom_link_enabled":false,"secret_scanning_push_protection_custom_link":null,"secret_scanning_validity_checks_enabled":false} + +https +GET +api.github.com +None +/repos/demoorg/demo-repo-1 +{'Accept': 'application/vnd.github.nebula-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:06: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/"7d6947bb6dc9709c7b930fe8f18991f5210224d5319fa50eb248979e9acf0627"'), ('Last-Modified', 'Wed, 17 Jan 2024 20:16:00 GMT'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; param=nebula-preview; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4919'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '81'), ('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', 'ED13:18EF96:DEECAAF:E12E89F:65BC2410')] +{"id":744692002,"node_id":"R_kgDOLGMZIg","name":"demo-repo-1","full_name":"demoorg/demo-repo-1","private":false,"owner":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/demoorg/demo-repo-1","description":null,"fork":false,"url":"https://api.github.com/repos/demoorg/demo-repo-1","forks_url":"https://api.github.com/repos/demoorg/demo-repo-1/forks","keys_url":"https://api.github.com/repos/demoorg/demo-repo-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/demoorg/demo-repo-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/demoorg/demo-repo-1/teams","hooks_url":"https://api.github.com/repos/demoorg/demo-repo-1/hooks","issue_events_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues/events{/number}","events_url":"https://api.github.com/repos/demoorg/demo-repo-1/events","assignees_url":"https://api.github.com/repos/demoorg/demo-repo-1/assignees{/user}","branches_url":"https://api.github.com/repos/demoorg/demo-repo-1/branches{/branch}","tags_url":"https://api.github.com/repos/demoorg/demo-repo-1/tags","blobs_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/demoorg/demo-repo-1/statuses/{sha}","languages_url":"https://api.github.com/repos/demoorg/demo-repo-1/languages","stargazers_url":"https://api.github.com/repos/demoorg/demo-repo-1/stargazers","contributors_url":"https://api.github.com/repos/demoorg/demo-repo-1/contributors","subscribers_url":"https://api.github.com/repos/demoorg/demo-repo-1/subscribers","subscription_url":"https://api.github.com/repos/demoorg/demo-repo-1/subscription","commits_url":"https://api.github.com/repos/demoorg/demo-repo-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/demoorg/demo-repo-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/demoorg/demo-repo-1/contents/{+path}","compare_url":"https://api.github.com/repos/demoorg/demo-repo-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/demoorg/demo-repo-1/merges","archive_url":"https://api.github.com/repos/demoorg/demo-repo-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/demoorg/demo-repo-1/downloads","issues_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues{/number}","pulls_url":"https://api.github.com/repos/demoorg/demo-repo-1/pulls{/number}","milestones_url":"https://api.github.com/repos/demoorg/demo-repo-1/milestones{/number}","notifications_url":"https://api.github.com/repos/demoorg/demo-repo-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/demoorg/demo-repo-1/labels{/name}","releases_url":"https://api.github.com/repos/demoorg/demo-repo-1/releases{/id}","deployments_url":"https://api.github.com/repos/demoorg/demo-repo-1/deployments","created_at":"2024-01-17T20:15:59Z","updated_at":"2024-01-17T20:16:00Z","pushed_at":"2024-01-17T20:16:00Z","git_url":"git://github.com/demoorg/demo-repo-1.git","ssh_url":"git@github.com:demoorg/demo-repo-1.git","clone_url":"https://github.com/demoorg/demo-repo-1.git","svn_url":"https://github.com/demoorg/demo-repo-1","homepage":null,"size":5,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main","permissions":{"admin":true,"maintain":true,"push":true,"triage":true,"pull":true},"temp_clone_token":"","allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"allow_auto_merge":false,"delete_branch_on_merge":false,"allow_update_branch":false,"use_squash_pr_title_as_default":false,"squash_merge_commit_message":"COMMIT_MESSAGES","squash_merge_commit_title":"COMMIT_OR_PR_TITLE","merge_commit_message":"PR_TITLE","merge_commit_title":"MERGE_MESSAGE","custom_properties":{},"organization":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"security_and_analysis":{"secret_scanning":{"status":"disabled"},"secret_scanning_push_protection":{"status":"disabled"},"dependabot_security_updates":{"status":"disabled"},"secret_scanning_validity_checks":{"status":"disabled"}},"network_count":0,"subscribers_count":0} + +https +GET +api.github.com +None +/repos/demoorg/demo-repo-2 +{'Accept': 'application/vnd.github.nebula-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:06: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/"692b43682cf160985c81fe3af42dc9e2cf18886063e3d33e74568865389a3a33"'), ('Last-Modified', 'Thu, 01 Feb 2024 18:15:57 GMT'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; param=nebula-preview; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4918'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '82'), ('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', 'ED14:157E91:E3590BF:E5965E7:65BC2410')] +{"id":751491527,"node_id":"R_kgDOLMrZxw","name":"demo-repo-2","full_name":"demoorg/demo-repo-2","private":false,"owner":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/demoorg/demo-repo-2","description":null,"fork":false,"url":"https://api.github.com/repos/demoorg/demo-repo-2","forks_url":"https://api.github.com/repos/demoorg/demo-repo-2/forks","keys_url":"https://api.github.com/repos/demoorg/demo-repo-2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/demoorg/demo-repo-2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/demoorg/demo-repo-2/teams","hooks_url":"https://api.github.com/repos/demoorg/demo-repo-2/hooks","issue_events_url":"https://api.github.com/repos/demoorg/demo-repo-2/issues/events{/number}","events_url":"https://api.github.com/repos/demoorg/demo-repo-2/events","assignees_url":"https://api.github.com/repos/demoorg/demo-repo-2/assignees{/user}","branches_url":"https://api.github.com/repos/demoorg/demo-repo-2/branches{/branch}","tags_url":"https://api.github.com/repos/demoorg/demo-repo-2/tags","blobs_url":"https://api.github.com/repos/demoorg/demo-repo-2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/demoorg/demo-repo-2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/demoorg/demo-repo-2/git/refs{/sha}","trees_url":"https://api.github.com/repos/demoorg/demo-repo-2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/demoorg/demo-repo-2/statuses/{sha}","languages_url":"https://api.github.com/repos/demoorg/demo-repo-2/languages","stargazers_url":"https://api.github.com/repos/demoorg/demo-repo-2/stargazers","contributors_url":"https://api.github.com/repos/demoorg/demo-repo-2/contributors","subscribers_url":"https://api.github.com/repos/demoorg/demo-repo-2/subscribers","subscription_url":"https://api.github.com/repos/demoorg/demo-repo-2/subscription","commits_url":"https://api.github.com/repos/demoorg/demo-repo-2/commits{/sha}","git_commits_url":"https://api.github.com/repos/demoorg/demo-repo-2/git/commits{/sha}","comments_url":"https://api.github.com/repos/demoorg/demo-repo-2/comments{/number}","issue_comment_url":"https://api.github.com/repos/demoorg/demo-repo-2/issues/comments{/number}","contents_url":"https://api.github.com/repos/demoorg/demo-repo-2/contents/{+path}","compare_url":"https://api.github.com/repos/demoorg/demo-repo-2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/demoorg/demo-repo-2/merges","archive_url":"https://api.github.com/repos/demoorg/demo-repo-2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/demoorg/demo-repo-2/downloads","issues_url":"https://api.github.com/repos/demoorg/demo-repo-2/issues{/number}","pulls_url":"https://api.github.com/repos/demoorg/demo-repo-2/pulls{/number}","milestones_url":"https://api.github.com/repos/demoorg/demo-repo-2/milestones{/number}","notifications_url":"https://api.github.com/repos/demoorg/demo-repo-2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/demoorg/demo-repo-2/labels{/name}","releases_url":"https://api.github.com/repos/demoorg/demo-repo-2/releases{/id}","deployments_url":"https://api.github.com/repos/demoorg/demo-repo-2/deployments","created_at":"2024-02-01T18:02:27Z","updated_at":"2024-02-01T18:15:57Z","pushed_at":"2024-02-01T18:02:28Z","git_url":"git://github.com/demoorg/demo-repo-2.git","ssh_url":"git@github.com:demoorg/demo-repo-2.git","clone_url":"https://github.com/demoorg/demo-repo-2.git","svn_url":"https://github.com/demoorg/demo-repo-2","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":null,"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main","permissions":{"admin":true,"maintain":true,"push":true,"triage":true,"pull":true},"temp_clone_token":"","allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"allow_auto_merge":false,"delete_branch_on_merge":false,"allow_update_branch":false,"use_squash_pr_title_as_default":false,"squash_merge_commit_message":"COMMIT_MESSAGES","squash_merge_commit_title":"COMMIT_OR_PR_TITLE","merge_commit_message":"PR_TITLE","merge_commit_title":"MERGE_MESSAGE","custom_properties":{},"organization":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"security_and_analysis":{"secret_scanning":{"status":"disabled"},"secret_scanning_push_protection":{"status":"disabled"},"dependabot_security_updates":{"status":"disabled"},"secret_scanning_validity_checks":{"status":"disabled"}},"network_count":0,"subscribers_count":0} + +https +GET +api.github.com +None +/orgs/demoorg/actions/secrets/public-key +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:06: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/"326d11de4f24fa979dbeeaee53a8d66cd9957752fc68342c1f9b9095f9f7c03b"'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'admin:org'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4917'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '83'), ('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', 'ED15:45DB9:DF3E31D:E17BD1A:65BC2410')] +{"key_id":"3380204578043523366","key":"lEcXo0mlVf630hnPSTSCuXmGo2CxuIAKT7RRvZ1QjB4="} + +https +PUT +api.github.com +None +/orgs/demoorg/actions/secrets/secret_act_name +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"key_id": "3380204578043523366", "encrypted_value": "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b", "visibility": "selected", "selected_repository_ids": [744692002, 751491527]} +204 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:06:57 GMT'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'admin:org'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4916'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '84'), ('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', 'ED16:5E18E:E4A708A:E6E8D40:65BC2411')] diff --git a/tests/ReplayData/Repository.testCreateRepoActionsSecret.txt b/tests/ReplayData/Repository.testCreateRepoActionsSecret.txt new file mode 100644 index 0000000000..de867e2124 --- /dev/null +++ b/tests/ReplayData/Repository.testCreateRepoActionsSecret.txt @@ -0,0 +1,32 @@ +https +GET +api.github.com +None +/repos/demoorg/demo-repo-1 +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:17:54 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/"9c4b75dd089a2a530c8efb2f9363e83047d8422cc155692914678bf31dcd2880"'), ('Last-Modified', 'Wed, 17 Jan 2024 20:16:00 GMT'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4900'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '100'), ('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', 'ED57:6F665:EA48DC1:EC8CB81:65BC26A2')] +{"id":744692002,"node_id":"R_kgDOLGMZIg","name":"demo-repo-1","full_name":"demoorg/demo-repo-1","private":false,"owner":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/demoorg/demo-repo-1","description":null,"fork":false,"url":"https://api.github.com/repos/demoorg/demo-repo-1","forks_url":"https://api.github.com/repos/demoorg/demo-repo-1/forks","keys_url":"https://api.github.com/repos/demoorg/demo-repo-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/demoorg/demo-repo-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/demoorg/demo-repo-1/teams","hooks_url":"https://api.github.com/repos/demoorg/demo-repo-1/hooks","issue_events_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues/events{/number}","events_url":"https://api.github.com/repos/demoorg/demo-repo-1/events","assignees_url":"https://api.github.com/repos/demoorg/demo-repo-1/assignees{/user}","branches_url":"https://api.github.com/repos/demoorg/demo-repo-1/branches{/branch}","tags_url":"https://api.github.com/repos/demoorg/demo-repo-1/tags","blobs_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/demoorg/demo-repo-1/statuses/{sha}","languages_url":"https://api.github.com/repos/demoorg/demo-repo-1/languages","stargazers_url":"https://api.github.com/repos/demoorg/demo-repo-1/stargazers","contributors_url":"https://api.github.com/repos/demoorg/demo-repo-1/contributors","subscribers_url":"https://api.github.com/repos/demoorg/demo-repo-1/subscribers","subscription_url":"https://api.github.com/repos/demoorg/demo-repo-1/subscription","commits_url":"https://api.github.com/repos/demoorg/demo-repo-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/demoorg/demo-repo-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/demoorg/demo-repo-1/contents/{+path}","compare_url":"https://api.github.com/repos/demoorg/demo-repo-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/demoorg/demo-repo-1/merges","archive_url":"https://api.github.com/repos/demoorg/demo-repo-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/demoorg/demo-repo-1/downloads","issues_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues{/number}","pulls_url":"https://api.github.com/repos/demoorg/demo-repo-1/pulls{/number}","milestones_url":"https://api.github.com/repos/demoorg/demo-repo-1/milestones{/number}","notifications_url":"https://api.github.com/repos/demoorg/demo-repo-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/demoorg/demo-repo-1/labels{/name}","releases_url":"https://api.github.com/repos/demoorg/demo-repo-1/releases{/id}","deployments_url":"https://api.github.com/repos/demoorg/demo-repo-1/deployments","created_at":"2024-01-17T20:15:59Z","updated_at":"2024-01-17T20:16:00Z","pushed_at":"2024-01-17T20:16:00Z","git_url":"git://github.com/demoorg/demo-repo-1.git","ssh_url":"git@github.com:demoorg/demo-repo-1.git","clone_url":"https://github.com/demoorg/demo-repo-1.git","svn_url":"https://github.com/demoorg/demo-repo-1","homepage":null,"size":5,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main","permissions":{"admin":true,"maintain":true,"push":true,"triage":true,"pull":true},"temp_clone_token":"","allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"allow_auto_merge":false,"delete_branch_on_merge":false,"allow_update_branch":false,"use_squash_pr_title_as_default":false,"squash_merge_commit_message":"COMMIT_MESSAGES","squash_merge_commit_title":"COMMIT_OR_PR_TITLE","merge_commit_message":"PR_TITLE","merge_commit_title":"MERGE_MESSAGE","custom_properties":{},"organization":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"security_and_analysis":{"secret_scanning":{"status":"disabled"},"secret_scanning_push_protection":{"status":"disabled"},"dependabot_security_updates":{"status":"disabled"},"secret_scanning_validity_checks":{"status":"disabled"}},"network_count":0,"subscribers_count":0} + +https +GET +api.github.com +None +/repos/demoorg/demo-repo-1/actions/secrets/public-key +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:17:54 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/"63c55f32262fbaf6c8015e5a31e233a90ba8105255746204ba09c641ed874e7d"'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4899'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '101'), ('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', 'ED58:364456:13AEE40:13E87A7:65BC26A2')] +{"key_id":"3380204578043523366","key":"oWxGlztcubVOX/ehKONYj83dSjyS4BZphl6dC6L6W3U="} + +https +PUT +api.github.com +None +/repos/demoorg/demo-repo-1/actions/secrets/secret_name +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"key_id": "3380204578043523366", "encrypted_value": "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b"} +201 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:17:55 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', '"ef7d1a03b3332b83aecd008a006821ad3613d37a6ec742a794010bc2d93610cf"'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4898'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '102'), ('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', 'ED59:157E91:E3DC1C3:E61B2A7:65BC26A3')] +{} diff --git a/tests/ReplayData/Repository.testCreateRepoDependabotSecret.txt b/tests/ReplayData/Repository.testCreateRepoDependabotSecret.txt new file mode 100644 index 0000000000..b617bcbb65 --- /dev/null +++ b/tests/ReplayData/Repository.testCreateRepoDependabotSecret.txt @@ -0,0 +1,32 @@ +https +GET +api.github.com +None +/repos/demoorg/demo-repo-1 +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:17:32 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/"9c4b75dd089a2a530c8efb2f9363e83047d8422cc155692914678bf31dcd2880"'), ('Last-Modified', 'Wed, 17 Jan 2024 20:16:00 GMT'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4905'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '95'), ('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', 'ED51:312C7:E2ACED8:E4EC47F:65BC268B')] +{"id":744692002,"node_id":"R_kgDOLGMZIg","name":"demo-repo-1","full_name":"demoorg/demo-repo-1","private":false,"owner":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/demoorg/demo-repo-1","description":null,"fork":false,"url":"https://api.github.com/repos/demoorg/demo-repo-1","forks_url":"https://api.github.com/repos/demoorg/demo-repo-1/forks","keys_url":"https://api.github.com/repos/demoorg/demo-repo-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/demoorg/demo-repo-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/demoorg/demo-repo-1/teams","hooks_url":"https://api.github.com/repos/demoorg/demo-repo-1/hooks","issue_events_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues/events{/number}","events_url":"https://api.github.com/repos/demoorg/demo-repo-1/events","assignees_url":"https://api.github.com/repos/demoorg/demo-repo-1/assignees{/user}","branches_url":"https://api.github.com/repos/demoorg/demo-repo-1/branches{/branch}","tags_url":"https://api.github.com/repos/demoorg/demo-repo-1/tags","blobs_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/demoorg/demo-repo-1/statuses/{sha}","languages_url":"https://api.github.com/repos/demoorg/demo-repo-1/languages","stargazers_url":"https://api.github.com/repos/demoorg/demo-repo-1/stargazers","contributors_url":"https://api.github.com/repos/demoorg/demo-repo-1/contributors","subscribers_url":"https://api.github.com/repos/demoorg/demo-repo-1/subscribers","subscription_url":"https://api.github.com/repos/demoorg/demo-repo-1/subscription","commits_url":"https://api.github.com/repos/demoorg/demo-repo-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/demoorg/demo-repo-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/demoorg/demo-repo-1/contents/{+path}","compare_url":"https://api.github.com/repos/demoorg/demo-repo-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/demoorg/demo-repo-1/merges","archive_url":"https://api.github.com/repos/demoorg/demo-repo-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/demoorg/demo-repo-1/downloads","issues_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues{/number}","pulls_url":"https://api.github.com/repos/demoorg/demo-repo-1/pulls{/number}","milestones_url":"https://api.github.com/repos/demoorg/demo-repo-1/milestones{/number}","notifications_url":"https://api.github.com/repos/demoorg/demo-repo-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/demoorg/demo-repo-1/labels{/name}","releases_url":"https://api.github.com/repos/demoorg/demo-repo-1/releases{/id}","deployments_url":"https://api.github.com/repos/demoorg/demo-repo-1/deployments","created_at":"2024-01-17T20:15:59Z","updated_at":"2024-01-17T20:16:00Z","pushed_at":"2024-01-17T20:16:00Z","git_url":"git://github.com/demoorg/demo-repo-1.git","ssh_url":"git@github.com:demoorg/demo-repo-1.git","clone_url":"https://github.com/demoorg/demo-repo-1.git","svn_url":"https://github.com/demoorg/demo-repo-1","homepage":null,"size":5,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main","permissions":{"admin":true,"maintain":true,"push":true,"triage":true,"pull":true},"temp_clone_token":"","allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"allow_auto_merge":false,"delete_branch_on_merge":false,"allow_update_branch":false,"use_squash_pr_title_as_default":false,"squash_merge_commit_message":"COMMIT_MESSAGES","squash_merge_commit_title":"COMMIT_OR_PR_TITLE","merge_commit_message":"PR_TITLE","merge_commit_title":"MERGE_MESSAGE","custom_properties":{},"organization":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"security_and_analysis":{"secret_scanning":{"status":"disabled"},"secret_scanning_push_protection":{"status":"disabled"},"dependabot_security_updates":{"status":"disabled"},"secret_scanning_validity_checks":{"status":"disabled"}},"network_count":0,"subscribers_count":0} + +https +GET +api.github.com +None +/repos/demoorg/demo-repo-1/dependabot/secrets/public-key +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:17:32 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/"f426af681aa5a6686aba8e402f462cdfaf20f45bf4386951168a3a7df8c1d8d8"'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4904'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '96'), ('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', 'ED52:45DB9:DFC4616:E203AF7:65BC268C')] +{"key_id":"3380217566468950943","key":"zMhrH6T/7s0pnAFGSEVKt8nH5XTuCdTIhNcSBgdeeyQ="} + +https +PUT +api.github.com +None +/repos/demoorg/demo-repo-1/dependabot/secrets/secret_name +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"key_id": "3380217566468950943", "encrypted_value": "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b"} +201 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:17:32 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', '"ef7d1a03b3332b83aecd008a006821ad3613d37a6ec742a794010bc2d93610cf"'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4903'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '97'), ('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', 'ED53:2EE190:B6710DC:B85CE2C:65BC268C')] +{} diff --git a/tests/ReplayData/Repository.testCreateSecret.txt b/tests/ReplayData/Repository.testCreateSecret.txt deleted file mode 100644 index 91169b37bd..0000000000 --- a/tests/ReplayData/Repository.testCreateSecret.txt +++ /dev/null @@ -1,21 +0,0 @@ -https -GET -api.github.com -None -/repos/jacquev6/PyGithub/actions/secrets/public-key -{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} -None -200 -[('status', '200 OK'), ('x-ratelimit-remaining', '4978'), ('content-length', '487'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1dd282b50e691f8f162ef9355dad8771"'), ('date', 'Thu, 10 May 2012 19:03:19 GMT'), ('content-type', 'application/json; charset=utf-8')] -{"key": "u5e1Z25+z8pmgVVt5Pd8k0z/sKpVL1MXYtRAecE4vm8=", "key_id": "568250167242549743"} - -https -PUT -api.github.com -None -/repos/jacquev6/PyGithub/actions/secrets/secret-name -{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} -{"encrypted_value": "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b", "key_id": "568250167242549743"} -201 -[('Date', 'Fri, 17 Apr 2020 00:12:33 GMT'), ('Server', 'GitHub.com'), ('Content-Length', '2'), ('Content-Type', 'application/json; charset=utf-8'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4984'), ('X-RateLimit-Reset', '1587085388'), ('X-OAuth-Scopes', 'read:org, repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, 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', '1; mode=block'), ('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', 'C290:52DA:50234:B404B:5E98F470')] -{} diff --git a/tests/ReplayData/Repository.testRepoGetSecretAssertion.txt b/tests/ReplayData/Repository.testRepoGetSecretAssertion.txt new file mode 100644 index 0000000000..7c9d666259 --- /dev/null +++ b/tests/ReplayData/Repository.testRepoGetSecretAssertion.txt @@ -0,0 +1,10 @@ +https +GET +api.github.com +None +/repos/demoorg/demo-repo-1 +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 23:18: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/"9c4b75dd089a2a530c8efb2f9363e83047d8422cc155692914678bf31dcd2880"'), ('Last-Modified', 'Wed, 17 Jan 2024 20:16:00 GMT'), ('X-OAuth-Scopes', 'admin:org, admin:public_key, repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('github-authentication-token-expiration', '2024-03-02 22:39:38 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4895'), ('X-RateLimit-Reset', '1706829971'), ('X-RateLimit-Used', '105'), ('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', 'ED5D:D6070:71DB13B:7303E28:65BC26C9')] +{"id":744692002,"node_id":"R_kgDOLGMZIg","name":"demo-repo-1","full_name":"demoorg/demo-repo-1","private":false,"owner":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/demoorg/demo-repo-1","description":null,"fork":false,"url":"https://api.github.com/repos/demoorg/demo-repo-1","forks_url":"https://api.github.com/repos/demoorg/demo-repo-1/forks","keys_url":"https://api.github.com/repos/demoorg/demo-repo-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/demoorg/demo-repo-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/demoorg/demo-repo-1/teams","hooks_url":"https://api.github.com/repos/demoorg/demo-repo-1/hooks","issue_events_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues/events{/number}","events_url":"https://api.github.com/repos/demoorg/demo-repo-1/events","assignees_url":"https://api.github.com/repos/demoorg/demo-repo-1/assignees{/user}","branches_url":"https://api.github.com/repos/demoorg/demo-repo-1/branches{/branch}","tags_url":"https://api.github.com/repos/demoorg/demo-repo-1/tags","blobs_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/demoorg/demo-repo-1/statuses/{sha}","languages_url":"https://api.github.com/repos/demoorg/demo-repo-1/languages","stargazers_url":"https://api.github.com/repos/demoorg/demo-repo-1/stargazers","contributors_url":"https://api.github.com/repos/demoorg/demo-repo-1/contributors","subscribers_url":"https://api.github.com/repos/demoorg/demo-repo-1/subscribers","subscription_url":"https://api.github.com/repos/demoorg/demo-repo-1/subscription","commits_url":"https://api.github.com/repos/demoorg/demo-repo-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/demoorg/demo-repo-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/demoorg/demo-repo-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/demoorg/demo-repo-1/contents/{+path}","compare_url":"https://api.github.com/repos/demoorg/demo-repo-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/demoorg/demo-repo-1/merges","archive_url":"https://api.github.com/repos/demoorg/demo-repo-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/demoorg/demo-repo-1/downloads","issues_url":"https://api.github.com/repos/demoorg/demo-repo-1/issues{/number}","pulls_url":"https://api.github.com/repos/demoorg/demo-repo-1/pulls{/number}","milestones_url":"https://api.github.com/repos/demoorg/demo-repo-1/milestones{/number}","notifications_url":"https://api.github.com/repos/demoorg/demo-repo-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/demoorg/demo-repo-1/labels{/name}","releases_url":"https://api.github.com/repos/demoorg/demo-repo-1/releases{/id}","deployments_url":"https://api.github.com/repos/demoorg/demo-repo-1/deployments","created_at":"2024-01-17T20:15:59Z","updated_at":"2024-01-17T20:16:00Z","pushed_at":"2024-01-17T20:16:00Z","git_url":"git://github.com/demoorg/demo-repo-1.git","ssh_url":"git@github.com:demoorg/demo-repo-1.git","clone_url":"https://github.com/demoorg/demo-repo-1.git","svn_url":"https://github.com/demoorg/demo-repo-1","homepage":null,"size":5,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main","permissions":{"admin":true,"maintain":true,"push":true,"triage":true,"pull":true},"temp_clone_token":"","allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"allow_auto_merge":false,"delete_branch_on_merge":false,"allow_update_branch":false,"use_squash_pr_title_as_default":false,"squash_merge_commit_message":"COMMIT_MESSAGES","squash_merge_commit_title":"COMMIT_OR_PR_TITLE","merge_commit_message":"PR_TITLE","merge_commit_title":"MERGE_MESSAGE","custom_properties":{},"organization":{"login":"demoorg","id":156956893,"node_id":"O_kgDOCVr43Q","avatar_url":"https://avatars.githubusercontent.com/u/156956893?v=4","gravatar_id":"","url":"https://api.github.com/users/demoorg","html_url":"https://github.com/demoorg","followers_url":"https://api.github.com/users/demoorg/followers","following_url":"https://api.github.com/users/demoorg/following{/other_user}","gists_url":"https://api.github.com/users/demoorg/gists{/gist_id}","starred_url":"https://api.github.com/users/demoorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demoorg/subscriptions","organizations_url":"https://api.github.com/users/demoorg/orgs","repos_url":"https://api.github.com/users/demoorg/repos","events_url":"https://api.github.com/users/demoorg/events{/privacy}","received_events_url":"https://api.github.com/users/demoorg/received_events","type":"Organization","site_admin":false},"security_and_analysis":{"secret_scanning":{"status":"disabled"},"secret_scanning_push_protection":{"status":"disabled"},"dependabot_security_updates":{"status":"disabled"},"secret_scanning_validity_checks":{"status":"disabled"}},"network_count":0,"subscribers_count":0} diff --git a/tests/Repository.py b/tests/Repository.py index 18539db9a8..beef276625 100644 --- a/tests/Repository.py +++ b/tests/Repository.py @@ -481,13 +481,6 @@ def testCreateRepositoryDispatch(self): without_payload = self.repo.create_repository_dispatch("type") self.assertTrue(without_payload) - @mock.patch("github.PublicKey.encrypt") - def testCreateSecret(self, encrypt): - # encrypt returns a non-deterministic value, we need to mock it so the replay data matches - encrypt.return_value = "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b" - secret = self.repo.create_secret("secret-name", "secret-value") - self.assertIsNotNone(secret) - @mock.patch("github.PublicKey.encrypt") def testRepoSecrets(self, encrypt): # encrypt returns a non-deterministic value, we need to mock it so the replay data matches @@ -1972,6 +1965,28 @@ def testRepoVariables(self): for matched_repo_variable in matched_repo_variables: matched_repo_variable.delete() + @mock.patch("github.PublicKey.encrypt") + def testCreateRepoActionsSecret(self, encrypt): + repo = self.g.get_repo("demoorg/demo-repo-1") + # encrypt returns a non-deterministic value, we need to mock it so the replay data matches + encrypt.return_value = "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b" + secret = repo.create_secret("secret_name", "secret-value", "actions") + self.assertIsNotNone(secret) + + @mock.patch("github.PublicKey.encrypt") + def testCreateRepoDependabotSecret(self, encrypt): + repo = self.g.get_repo("demoorg/demo-repo-1") + # encrypt returns a non-deterministic value, we need to mock it so the replay data matches + encrypt.return_value = "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b" + secret = repo.create_secret("secret_name", "secret-value", "dependabot") + self.assertIsNotNone(secret) + + def testRepoGetSecretAssertion(self): + repo = self.g.get_repo("demoorg/demo-repo-1") + with self.assertRaises(AssertionError) as exc: + repo.get_secret(secret_name="splat", secret_type="supersecret") + self.assertEqual(str(exc.exception), "secret_type should be actions or dependabot") + class LazyRepository(Framework.TestCase): def setUp(self):