File: GitCommitVerification.setUp.txt

package info (click to toggle)
pygithub 2.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 33,476 kB
  • sloc: python: 38,409; sh: 7; makefile: 6
file content (10 lines) | stat: -rw-r--r-- 12,870 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
https
GET
api.github.com
None
/repos/PyGithub/PyGithub/commits/801d64a4c5c0fcb63f695e0f6799117e76e5fe67
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Date', 'Wed, 30 Oct 2024 23:23:15 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Cache-Control', 'public, max-age=60, s-maxage=60'), ('Vary', 'Accept,Accept-Encoding, Accept, X-Requested-With'), ('ETag', 'W/"1d5d107249e739729756aee3c59c72fdad7ced99a3c2a080ba8abca01d102f4f"'), ('Last-Modified', 'Wed, 28 Aug 2024 07:41:55 GMT'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '60'), ('X-RateLimit-Remaining', '44'), ('X-RateLimit-Reset', '1730333577'), ('X-RateLimit-Used', '16'), ('X-RateLimit-Resource', 'core'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '0'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Content-Encoding', 'gzip'), ('Server', 'github.com'), ('X-GitHub-Request-Id', '8B5A:2437C0:339FEF4:3660262:6722BFE3'), ('Content-Length', '2818')]
{"sha":"801d64a4c5c0fcb63f695e0f6799117e76e5fe67","node_id":"C_kwDOADYVqtoAKDgwMWQ2NGE0YzVjMGZjYjYzZjY5NWUwZjY3OTkxMTdlNzZlNWZlNjc","commit":{"author":{"name":"Tim Gates","email":"tim.gates@iress.com","date":"2024-08-28T07:41:47Z"},"committer":{"name":"Tim Gates","email":"tim.gates@iress.com","date":"2024-08-28T07:41:55Z"},"message":"Commit verification support\n\nAdd support for verification component of Commit API response to see if\ncommit has been signed and the signature has been checked by Github","tree":{"sha":"4f502b4c4e5f0bdc7ee611f914bbdef51aef5efa","url":"https://api.github.com/repos/PyGithub/PyGithub/git/trees/4f502b4c4e5f0bdc7ee611f914bbdef51aef5efa"},"url":"https://api.github.com/repos/PyGithub/PyGithub/git/commits/801d64a4c5c0fcb63f695e0f6799117e76e5fe67","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN PGP SIGNATURE-----\n\niMgEAAEKADIWIQRbWfY9TlELdM/5UaauO+DVOCPPBQUCZs7U0RQcdGltLmdhdGVz\nQGlyZXNzLmNvbQAKCRCuO+DVOCPPBQ2tBACAaRNONEWlDDNyYkAnIv8bZ55BuIuy\nTvbxVPjI8KLDqKLzgHO60HhQ3h/hCiug6g5fvVzyIrmayj3eEzaWAfa3+f37f3xK\nflZRMtNFUBYQoLTuyTkKvW85UA2AkUvKp3bHT5W6ZoCKqR5xw6pwKxuYQi7eJG9h\nNPrZTezkL6EDng==\n=Ng9G\n-----END PGP SIGNATURE-----","payload":"tree 4f502b4c4e5f0bdc7ee611f914bbdef51aef5efa\nparent 85087354078e426125dbbf88041bbaa6f35d8199\nauthor Tim Gates <tim.gates@iress.com> 1724830907 +1000\ncommitter Tim Gates <tim.gates@iress.com> 1724830915 +1000\n\nCommit verification support\n\nAdd support for verification component of Commit API response to see if\ncommit has been signed and the signature has been checked by Github\n"}},"url":"https://api.github.com/repos/PyGithub/PyGithub/commits/801d64a4c5c0fcb63f695e0f6799117e76e5fe67","html_url":"https://github.com/PyGithub/PyGithub/commit/801d64a4c5c0fcb63f695e0f6799117e76e5fe67","comments_url":"https://api.github.com/repos/PyGithub/PyGithub/commits/801d64a4c5c0fcb63f695e0f6799117e76e5fe67/comments","author":{"login":"timgates42","id":47873678,"node_id":"MDQ6VXNlcjQ3ODczNjc4","avatar_url":"https://avatars.githubusercontent.com/u/47873678?v=4","gravatar_id":"","url":"https://api.github.com/users/timgates42","html_url":"https://github.com/timgates42","followers_url":"https://api.github.com/users/timgates42/followers","following_url":"https://api.github.com/users/timgates42/following{/other_user}","gists_url":"https://api.github.com/users/timgates42/gists{/gist_id}","starred_url":"https://api.github.com/users/timgates42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timgates42/subscriptions","organizations_url":"https://api.github.com/users/timgates42/orgs","repos_url":"https://api.github.com/users/timgates42/repos","events_url":"https://api.github.com/users/timgates42/events{/privacy}","received_events_url":"https://api.github.com/users/timgates42/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"timgates42","id":47873678,"node_id":"MDQ6VXNlcjQ3ODczNjc4","avatar_url":"https://avatars.githubusercontent.com/u/47873678?v=4","gravatar_id":"","url":"https://api.github.com/users/timgates42","html_url":"https://github.com/timgates42","followers_url":"https://api.github.com/users/timgates42/followers","following_url":"https://api.github.com/users/timgates42/following{/other_user}","gists_url":"https://api.github.com/users/timgates42/gists{/gist_id}","starred_url":"https://api.github.com/users/timgates42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timgates42/subscriptions","organizations_url":"https://api.github.com/users/timgates42/orgs","repos_url":"https://api.github.com/users/timgates42/repos","events_url":"https://api.github.com/users/timgates42/events{/privacy}","received_events_url":"https://api.github.com/users/timgates42/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"85087354078e426125dbbf88041bbaa6f35d8199","url":"https://api.github.com/repos/PyGithub/PyGithub/commits/85087354078e426125dbbf88041bbaa6f35d8199","html_url":"https://github.com/PyGithub/PyGithub/commit/85087354078e426125dbbf88041bbaa6f35d8199"}],"stats":{"total":84,"additions":84,"deletions":0},"files":[{"sha":"8ac09116ff74fa5bdb9e06283214486ba4f378d3","filename":"github/Commit.py","status":"modified","additions":11,"deletions":0,"changes":11,"blob_url":"https://github.com/PyGithub/PyGithub/blob/801d64a4c5c0fcb63f695e0f6799117e76e5fe67/github%2FCommit.py","raw_url":"https://github.com/PyGithub/PyGithub/raw/801d64a4c5c0fcb63f695e0f6799117e76e5fe67/github%2FCommit.py","contents_url":"https://api.github.com/repos/PyGithub/PyGithub/contents/github%2FCommit.py?ref=801d64a4c5c0fcb63f695e0f6799117e76e5fe67","patch":"@@ -24,6 +24,7 @@\n # Copyright 2024 Enrico Minack <github@enrico.minack.dev>                      #\n # Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com>        #\n # Copyright 2024 iarspider <iarspider@gmail.com>                               #\n+# Copyright 2024 timgates42 <tim.gates@gmail.com>                              #\n #                                                                              #\n # This file is part of PyGithub.                                               #\n # http://pygithub.readthedocs.io/                                              #\n@@ -57,6 +58,7 @@\n import github.GitCommit\n import github.NamedUser\n import github.PaginatedList\n+import github.CommitVerification\n from github.GithubObject import Attribute, CompletableGithubObject, NotSet, Opt, is_optional\n from github.PaginatedList import PaginatedList\n \n@@ -71,6 +73,7 @@\n     from github.GitCommit import GitCommit\n     from github.NamedUser import NamedUser\n     from github.PullRequest import PullRequest\n+    from github.CommitVerification import CommitVerification\n \n \n class Commit(CompletableGithubObject):\n@@ -92,6 +95,7 @@ def _initAttributes(self) -> None:\n         self._sha: Attribute[str] = NotSet\n         self._stats: Attribute[CommitStats] = NotSet\n         self._url: Attribute[str] = NotSet\n+        self._verification: Attribute[CommitVerification] = NotSet\n \n     def __repr__(self) -> str:\n         return self.get__repr__({\"sha\": self._sha.value})\n@@ -157,6 +161,11 @@ def url(self) -> str:\n         self._completeIfNotSet(self._url)\n         return self._url.value\n \n+    @property\n+    def verification(self) -> CommitVerification:\n+        self._completeIfNotSet(self._verification)\n+        return self._verification.value\n+\n     def create_comment(\n         self,\n         body: str,\n@@ -311,3 +320,5 @@ def _useAttributes(self, attributes: dict[str, Any]) -> None:\n             self._stats = self._makeClassAttribute(github.CommitStats.CommitStats, attributes[\"stats\"])\n         if \"url\" in attributes:  # pragma no branch\n             self._url = self._makeStringAttribute(attributes[\"url\"])\n+        if \"verification\" in attributes:  # pragma no branch\n+            self._verification = self._makeClassAttribute(github.CommitVerification.CommitVerification, attributes[\"verification\"])"},{"sha":"7a5a6ae633da4f3f6649fdf9859e2d7fcef14866","filename":"github/CommitVerification.py","status":"added","additions":73,"deletions":0,"changes":73,"blob_url":"https://github.com/PyGithub/PyGithub/blob/801d64a4c5c0fcb63f695e0f6799117e76e5fe67/github%2FCommitVerification.py","raw_url":"https://github.com/PyGithub/PyGithub/raw/801d64a4c5c0fcb63f695e0f6799117e76e5fe67/github%2FCommitVerification.py","contents_url":"https://api.github.com/repos/PyGithub/PyGithub/contents/github%2FCommitVerification.py?ref=801d64a4c5c0fcb63f695e0f6799117e76e5fe67","patch":"@@ -0,0 +1,73 @@\n+############################ Copyrights and license ############################\n+#                                                                              #\n+# Copyright 2024 timgates42 <tim.gates@gmail.com>                              #\n+#                                                                              #\n+# This file is part of PyGithub.                                               #\n+# http://pygithub.readthedocs.io/                                              #\n+#                                                                              #\n+# PyGithub is free software: you can redistribute it and/or modify it under    #\n+# the terms of the GNU Lesser General Public License as published by the Free  #\n+# Software Foundation, either version 3 of the License, or (at your option)    #\n+# any later version.                                                           #\n+#                                                                              #\n+# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY  #\n+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    #\n+# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #\n+# details.                                                                     #\n+#                                                                              #\n+# You should have received a copy of the GNU Lesser General Public License     #\n+# along with PyGithub. If not, see <http://www.gnu.org/licenses/>.             #\n+#                                                                              #\n+################################################################################\n+\n+from __future__ import annotations\n+\n+from typing import Any\n+\n+from github.GithubObject import (Attribute, CompletableGithubObject, NotSet)\n+\n+\n+class CommitVerification(CompletableGithubObject):\n+    \"\"\"\n+    This class represents CommitVerifications.\n+\n+    The reference can be found here\n+    https://docs.github.com/en/rest/commits/commits\n+\n+    \"\"\"\n+\n+    def _initAttributes(self) -> None:\n+        self._verified: Attribute[bool] = NotSet\n+        self._reason: Attribute[str] = NotSet\n+        self._signature: Attribute[str] = NotSet\n+        self._payload: Attribute[str] = NotSet\n+\n+    @property\n+    def verified(self) -> str:\n+        self._completeIfNotSet(self.verified)\n+        return self._verified.value\n+\n+    @property\n+    def reason(self) -> str:\n+        self._completeIfNotSet(self._reason)\n+        return self._reason.value\n+\n+    @property\n+    def signature(self) -> str:\n+        self._completeIfNotSet(self._signature)\n+        return self._signature.value\n+\n+    @property\n+    def payload(self) -> str:\n+        self._completeIfNotSet(self._payload)\n+        return self._payload.value\n+\n+    def _useAttributes(self, attributes: dict[str, Any]) -> None:\n+        if \"verified\" in attributes:  # pragma no branch\n+            self._verified = self._makeBoolAttribute(attributes[\"verified\"])\n+        if \"reason\" in attributes:  # pragma no branch\n+            self._reason = self._makeStringAttribute(attributes[\"reason\"])\n+        if \"signature\" in attributes:  # pragma no branch\n+            self._signature = self._makeStringAttribute(attributes[\"signature\"])\n+        if \"payload\" in attributes:  # pragma no branch\n+            self._payload = self._makeStringAttribute(attributes[\"payload\"])"}]}