PyGithub-asyncio 3.0.0b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- githubasyncio/AccessToken.py +159 -0
- githubasyncio/AdvisoryBase.py +163 -0
- githubasyncio/AdvisoryCredit.py +131 -0
- githubasyncio/AdvisoryCreditDetailed.py +110 -0
- githubasyncio/AdvisoryVulnerability.py +191 -0
- githubasyncio/AdvisoryVulnerabilityPackage.py +93 -0
- githubasyncio/AppAuthentication.py +58 -0
- githubasyncio/ApplicationOAuth.py +200 -0
- githubasyncio/Artifact.py +183 -0
- githubasyncio/Auth.py +560 -0
- githubasyncio/AuthenticatedUser.py +1251 -0
- githubasyncio/Authorization.py +192 -0
- githubasyncio/AuthorizationApplication.py +73 -0
- githubasyncio/Autolink.py +104 -0
- githubasyncio/Branch.py +689 -0
- githubasyncio/BranchProtection.py +224 -0
- githubasyncio/CVSS.py +83 -0
- githubasyncio/CWE.py +75 -0
- githubasyncio/CheckRun.py +315 -0
- githubasyncio/CheckRunAnnotation.py +134 -0
- githubasyncio/CheckRunOutput.py +108 -0
- githubasyncio/CheckSuite.py +319 -0
- githubasyncio/Clones.py +97 -0
- githubasyncio/CodeScanAlert.py +215 -0
- githubasyncio/CodeScanAlertInstance.py +134 -0
- githubasyncio/CodeScanAlertInstanceLocation.py +102 -0
- githubasyncio/CodeScanRule.py +134 -0
- githubasyncio/CodeScanTool.py +94 -0
- githubasyncio/CodeSecurityConfig.py +301 -0
- githubasyncio/CodeSecurityConfigRepository.py +70 -0
- githubasyncio/Commit.py +442 -0
- githubasyncio/CommitCombinedStatus.py +126 -0
- githubasyncio/CommitComment.py +270 -0
- githubasyncio/CommitStats.py +78 -0
- githubasyncio/CommitStatus.py +169 -0
- githubasyncio/Comparison.py +219 -0
- githubasyncio/Consts.py +197 -0
- githubasyncio/ContentFile.py +304 -0
- githubasyncio/Copilot.py +97 -0
- githubasyncio/CopilotSeat.py +132 -0
- githubasyncio/DefaultCodeSecurityConfig.py +93 -0
- githubasyncio/DependabotAlert.py +184 -0
- githubasyncio/DependabotAlertAdvisory.py +82 -0
- githubasyncio/DependabotAlertDependency.py +100 -0
- githubasyncio/DependabotAlertVulnerability.py +85 -0
- githubasyncio/Deployment.py +314 -0
- githubasyncio/DeploymentBranchPolicy.py +102 -0
- githubasyncio/DeploymentStatus.py +201 -0
- githubasyncio/DiscussionBase.py +140 -0
- githubasyncio/DiscussionCommentBase.py +140 -0
- githubasyncio/Download.py +256 -0
- githubasyncio/Enterprise.py +175 -0
- githubasyncio/EnterpriseConsumedLicenses.py +138 -0
- githubasyncio/Environment.py +354 -0
- githubasyncio/EnvironmentDeploymentBranchPolicy.py +87 -0
- githubasyncio/EnvironmentProtectionRule.py +117 -0
- githubasyncio/EnvironmentProtectionRuleReviewer.py +110 -0
- githubasyncio/Event.py +134 -0
- githubasyncio/File.py +142 -0
- githubasyncio/GeneratedReleaseNotes.py +68 -0
- githubasyncio/Gist.py +373 -0
- githubasyncio/GistComment.py +162 -0
- githubasyncio/GistFile.py +106 -0
- githubasyncio/GistHistoryState.py +245 -0
- githubasyncio/GitAuthor.py +94 -0
- githubasyncio/GitBlob.py +123 -0
- githubasyncio/GitCommit.py +208 -0
- githubasyncio/GitCommitVerification.py +103 -0
- githubasyncio/GitObject.py +84 -0
- githubasyncio/GitRef.py +122 -0
- githubasyncio/GitRelease.py +476 -0
- githubasyncio/GitReleaseAsset.py +232 -0
- githubasyncio/GitTag.py +143 -0
- githubasyncio/GitTree.py +113 -0
- githubasyncio/GitTreeElement.py +104 -0
- githubasyncio/GithubApp.py +236 -0
- githubasyncio/GithubException.py +226 -0
- githubasyncio/GithubIntegration.py +365 -0
- githubasyncio/GithubObject.py +910 -0
- githubasyncio/GithubRetry.py +253 -0
- githubasyncio/GitignoreTemplate.py +88 -0
- githubasyncio/GlobalAdvisory.py +141 -0
- githubasyncio/Hook.py +238 -0
- githubasyncio/HookDelivery.py +243 -0
- githubasyncio/HookDescription.py +85 -0
- githubasyncio/HookResponse.py +83 -0
- githubasyncio/InputFileContent.py +63 -0
- githubasyncio/InputGitAuthor.py +71 -0
- githubasyncio/InputGitTreeElement.py +79 -0
- githubasyncio/Installation.py +298 -0
- githubasyncio/InstallationAuthorization.py +138 -0
- githubasyncio/Invitation.py +171 -0
- githubasyncio/Issue.py +955 -0
- githubasyncio/IssueComment.py +309 -0
- githubasyncio/IssueDependenciesSummary.py +77 -0
- githubasyncio/IssueEvent.py +296 -0
- githubasyncio/IssuePullRequest.py +97 -0
- githubasyncio/IssueType.py +123 -0
- githubasyncio/Label.py +186 -0
- githubasyncio/License.py +169 -0
- githubasyncio/MainClass.py +1142 -0
- githubasyncio/Membership.py +154 -0
- githubasyncio/MergedUpstream.py +71 -0
- githubasyncio/Migration.py +281 -0
- githubasyncio/Milestone.py +255 -0
- githubasyncio/NamedEnterpriseUser.py +207 -0
- githubasyncio/NamedUser.py +841 -0
- githubasyncio/Notification.py +182 -0
- githubasyncio/NotificationSubject.py +96 -0
- githubasyncio/Organization.py +2462 -0
- githubasyncio/OrganizationCodeScanAlert.py +65 -0
- githubasyncio/OrganizationCustomProperty.py +215 -0
- githubasyncio/OrganizationDependabotAlert.py +75 -0
- githubasyncio/OrganizationSecret.py +191 -0
- githubasyncio/OrganizationSecretScanAlert.py +112 -0
- githubasyncio/OrganizationVariable.py +141 -0
- githubasyncio/PaginatedList.py +652 -0
- githubasyncio/Path.py +102 -0
- githubasyncio/Permissions.py +113 -0
- githubasyncio/Plan.py +108 -0
- githubasyncio/Project.py +286 -0
- githubasyncio/ProjectCard.py +257 -0
- githubasyncio/ProjectColumn.py +227 -0
- githubasyncio/PublicKey.py +138 -0
- githubasyncio/PullRequest.py +1202 -0
- githubasyncio/PullRequestComment.py +401 -0
- githubasyncio/PullRequestMergeStatus.py +89 -0
- githubasyncio/PullRequestPart.py +110 -0
- githubasyncio/PullRequestReview.py +214 -0
- githubasyncio/Rate.py +123 -0
- githubasyncio/RateLimit.py +210 -0
- githubasyncio/RateLimitOverview.py +104 -0
- githubasyncio/Reaction.py +128 -0
- githubasyncio/Referrer.py +94 -0
- githubasyncio/RepoCodeSecurityConfig.py +93 -0
- githubasyncio/Repository.py +5211 -0
- githubasyncio/RepositoryAdvisory.py +431 -0
- githubasyncio/RepositoryDiscussion.py +221 -0
- githubasyncio/RepositoryDiscussionCategory.py +150 -0
- githubasyncio/RepositoryDiscussionComment.py +159 -0
- githubasyncio/RepositoryKey.py +166 -0
- githubasyncio/RepositoryPreferences.py +82 -0
- githubasyncio/RepositoryRulesetBypassActor.py +75 -0
- githubasyncio/Requester.py +1518 -0
- githubasyncio/RequiredPullRequestReviews.py +269 -0
- githubasyncio/RequiredStatusChecks.py +153 -0
- githubasyncio/Rule.py +134 -0
- githubasyncio/Ruleset.py +292 -0
- githubasyncio/Secret.py +139 -0
- githubasyncio/SecretScanAlert.py +317 -0
- githubasyncio/SecretScanAlertInstance.py +128 -0
- githubasyncio/SecurityAndAnalysis.py +188 -0
- githubasyncio/SecurityAndAnalysisFeature.py +79 -0
- githubasyncio/SelfHostedActionsRunner.py +129 -0
- githubasyncio/SelfHostedActionsRunnerApplication.py +92 -0
- githubasyncio/SelfHostedActionsRunnerJitConfig.py +74 -0
- githubasyncio/SelfHostedActionsRunnerToken.py +118 -0
- githubasyncio/SourceImport.py +260 -0
- githubasyncio/Stargazer.py +88 -0
- githubasyncio/StatsCodeFrequency.py +81 -0
- githubasyncio/StatsCommitActivity.py +86 -0
- githubasyncio/StatsContributor.py +138 -0
- githubasyncio/StatsParticipation.py +78 -0
- githubasyncio/StatsPunchCard.py +76 -0
- githubasyncio/SubIssueSummary.py +70 -0
- githubasyncio/Tag.py +108 -0
- githubasyncio/Team.py +618 -0
- githubasyncio/TeamDiscussion.py +137 -0
- githubasyncio/TimelineEvent.py +164 -0
- githubasyncio/TimelineEventSource.py +81 -0
- githubasyncio/Topic.py +177 -0
- githubasyncio/Traffic.py +95 -0
- githubasyncio/UserKey.py +141 -0
- githubasyncio/Variable.py +155 -0
- githubasyncio/View.py +97 -0
- githubasyncio/Workflow.py +335 -0
- githubasyncio/WorkflowJob.py +253 -0
- githubasyncio/WorkflowRun.py +480 -0
- githubasyncio/WorkflowStep.py +118 -0
- githubasyncio/__init__.py +38 -0
- githubasyncio/compat/__init__.py +52 -0
- githubasyncio/requestlib/__init__.py +29 -0
- pygithub_asyncio-3.0.0b1.dist-info/METADATA +102 -0
- pygithub_asyncio-3.0.0b1.dist-info/RECORD +188 -0
- pygithub_asyncio-3.0.0b1.dist-info/WHEEL +5 -0
- pygithub_asyncio-3.0.0b1.dist-info/licenses/COPYING +674 -0
- pygithub_asyncio-3.0.0b1.dist-info/licenses/COPYING.LESSER +165 -0
- pygithub_asyncio-3.0.0b1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# FILE AUTO GENERATED DO NOT TOUCH
|
|
2
|
+
############################ Copyrights and license ############################
|
|
3
|
+
# #
|
|
4
|
+
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
|
|
5
|
+
# Copyright 2012 Zearin <zearin@gonk.net> #
|
|
6
|
+
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
|
|
7
|
+
# Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net> #
|
|
8
|
+
# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com> #
|
|
9
|
+
# Copyright 2018 Wan Liuyang <tsfdye@gmail.com> #
|
|
10
|
+
# Copyright 2018 sfdye <tsfdye@gmail.com> #
|
|
11
|
+
# Copyright 2019 Adam Baratz <adam.baratz@gmail.com> #
|
|
12
|
+
# Copyright 2019 Nick Campbell <nicholas.j.campbell@gmail.com> #
|
|
13
|
+
# Copyright 2019 Rigas Papathanasopoulos <rigaspapas@gmail.com> #
|
|
14
|
+
# Copyright 2019 Steve Kowalik <steven@wedontsleep.org> #
|
|
15
|
+
# Copyright 2019 Wan Liuyang <tsfdye@gmail.com> #
|
|
16
|
+
# Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
|
|
17
|
+
# Copyright 2022 Liuyang Wan <tsfdye@gmail.com> #
|
|
18
|
+
# Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
|
|
19
|
+
# Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
20
|
+
# Copyright 2023 Trim21 <trim21.me@gmail.com> #
|
|
21
|
+
# Copyright 2023 chantra <chantra@users.noreply.github.com> #
|
|
22
|
+
# Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
|
|
23
|
+
# #
|
|
24
|
+
# This file is part of PyGithub. #
|
|
25
|
+
# http://pygithub.readthedocs.io/ #
|
|
26
|
+
# #
|
|
27
|
+
# PyGithub is free software: you can redistribute it and/or modify it under #
|
|
28
|
+
# the terms of the GNU Lesser General Public License as published by the Free #
|
|
29
|
+
# Software Foundation, either version 3 of the License, or (at your option) #
|
|
30
|
+
# any later version. #
|
|
31
|
+
# #
|
|
32
|
+
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
|
|
33
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
|
34
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
|
|
35
|
+
# details. #
|
|
36
|
+
# #
|
|
37
|
+
# You should have received a copy of the GNU Lesser General Public License #
|
|
38
|
+
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
|
39
|
+
# #
|
|
40
|
+
################################################################################
|
|
41
|
+
|
|
42
|
+
from __future__ import annotations
|
|
43
|
+
|
|
44
|
+
from datetime import datetime, timedelta, timezone
|
|
45
|
+
from typing import Any
|
|
46
|
+
|
|
47
|
+
from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class AccessToken(NonCompletableGithubObject):
|
|
51
|
+
"""
|
|
52
|
+
This class represents access tokens.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
_created: datetime
|
|
56
|
+
|
|
57
|
+
def _initAttributes(self) -> None:
|
|
58
|
+
self._expires_in: Attribute[int | None] = NotSet
|
|
59
|
+
self._refresh_expires_in: Attribute[int | None] = NotSet
|
|
60
|
+
self._refresh_token: Attribute[str] = NotSet
|
|
61
|
+
self._scope: Attribute[str] = NotSet
|
|
62
|
+
self._token: Attribute[str] = NotSet
|
|
63
|
+
self._type: Attribute[str] = NotSet
|
|
64
|
+
|
|
65
|
+
def __repr__(self) -> str:
|
|
66
|
+
return self.get__repr__(
|
|
67
|
+
{
|
|
68
|
+
"token": f"{self._token.value[:5]}...",
|
|
69
|
+
"scope": self.scope,
|
|
70
|
+
"type": self._type.value,
|
|
71
|
+
"expires_in": self.expires_in,
|
|
72
|
+
"refresh_token": (f"{self.refresh_token[:5]}..." if self.refresh_token else None),
|
|
73
|
+
"refresh_token_expires_in": self.refresh_expires_in,
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
@property
|
|
78
|
+
def created(self) -> datetime:
|
|
79
|
+
"""
|
|
80
|
+
:type: datetime
|
|
81
|
+
"""
|
|
82
|
+
return self._created
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
def expires_at(self) -> datetime | None:
|
|
86
|
+
"""
|
|
87
|
+
:type: Optional[datetime]
|
|
88
|
+
"""
|
|
89
|
+
seconds = self.expires_in
|
|
90
|
+
if seconds is not None:
|
|
91
|
+
return self._created + timedelta(seconds=seconds)
|
|
92
|
+
return None
|
|
93
|
+
|
|
94
|
+
@property
|
|
95
|
+
def expires_in(self) -> int | None:
|
|
96
|
+
"""
|
|
97
|
+
:type: Optional[int]
|
|
98
|
+
"""
|
|
99
|
+
return self._expires_in.value
|
|
100
|
+
|
|
101
|
+
@property
|
|
102
|
+
def refresh_expires_at(self) -> datetime | None:
|
|
103
|
+
"""
|
|
104
|
+
:type: Optional[datetime]
|
|
105
|
+
"""
|
|
106
|
+
seconds = self.refresh_expires_in
|
|
107
|
+
if seconds is not None:
|
|
108
|
+
return self._created + timedelta(seconds=seconds)
|
|
109
|
+
return None
|
|
110
|
+
|
|
111
|
+
@property
|
|
112
|
+
def refresh_expires_in(self) -> int | None:
|
|
113
|
+
"""
|
|
114
|
+
:type: Optional[int]
|
|
115
|
+
"""
|
|
116
|
+
return self._refresh_expires_in.value
|
|
117
|
+
|
|
118
|
+
@property
|
|
119
|
+
def refresh_token(self) -> str | None:
|
|
120
|
+
"""
|
|
121
|
+
:type: Optional[string]
|
|
122
|
+
"""
|
|
123
|
+
return self._refresh_token.value
|
|
124
|
+
|
|
125
|
+
@property
|
|
126
|
+
def scope(self) -> str:
|
|
127
|
+
"""
|
|
128
|
+
:type: string
|
|
129
|
+
"""
|
|
130
|
+
return self._scope.value
|
|
131
|
+
|
|
132
|
+
@property
|
|
133
|
+
def token(self) -> str:
|
|
134
|
+
"""
|
|
135
|
+
:type: string
|
|
136
|
+
"""
|
|
137
|
+
return self._token.value
|
|
138
|
+
|
|
139
|
+
@property
|
|
140
|
+
def type(self) -> str:
|
|
141
|
+
"""
|
|
142
|
+
:type: string
|
|
143
|
+
"""
|
|
144
|
+
return self._type.value
|
|
145
|
+
|
|
146
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
147
|
+
self._created = datetime.now(timezone.utc)
|
|
148
|
+
if "access_token" in attributes: # pragma no branch
|
|
149
|
+
self._token = self._makeStringAttribute(attributes["access_token"])
|
|
150
|
+
if "expires_in" in attributes: # pragma no branch
|
|
151
|
+
self._expires_in = self._makeIntAttribute(attributes["expires_in"])
|
|
152
|
+
if "refresh_token" in attributes: # pragma no branch
|
|
153
|
+
self._refresh_token = self._makeStringAttribute(attributes["refresh_token"])
|
|
154
|
+
if "refresh_token_expires_in" in attributes: # pragma no branch
|
|
155
|
+
self._refresh_expires_in = self._makeIntAttribute(attributes["refresh_token_expires_in"])
|
|
156
|
+
if "scope" in attributes: # pragma no branch
|
|
157
|
+
self._scope = self._makeStringAttribute(attributes["scope"])
|
|
158
|
+
if "token_type" in attributes: # pragma no branch
|
|
159
|
+
self._type = self._makeStringAttribute(attributes["token_type"])
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# FILE AUTO GENERATED DO NOT TOUCH
|
|
2
|
+
############################ Copyrights and license ############################
|
|
3
|
+
# #
|
|
4
|
+
# Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
|
|
5
|
+
# Copyright 2023 Joseph Henrich <crimsonknave@gmail.com> #
|
|
6
|
+
# Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
|
|
7
|
+
# Copyright 2024 Thomas Cooper <coopernetes@proton.me> #
|
|
8
|
+
# Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
|
|
9
|
+
# Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
|
|
10
|
+
# #
|
|
11
|
+
# This file is part of PyGithub. #
|
|
12
|
+
# http://pygithub.readthedocs.io/ #
|
|
13
|
+
# #
|
|
14
|
+
# PyGithub is free software: you can redistribute it and/or modify it under #
|
|
15
|
+
# the terms of the GNU Lesser General Public License as published by the Free #
|
|
16
|
+
# Software Foundation, either version 3 of the License, or (at your option) #
|
|
17
|
+
# any later version. #
|
|
18
|
+
# #
|
|
19
|
+
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
|
|
20
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
|
21
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
|
|
22
|
+
# details. #
|
|
23
|
+
# #
|
|
24
|
+
# You should have received a copy of the GNU Lesser General Public License #
|
|
25
|
+
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
|
26
|
+
# #
|
|
27
|
+
################################################################################
|
|
28
|
+
|
|
29
|
+
from __future__ import annotations
|
|
30
|
+
|
|
31
|
+
from datetime import datetime
|
|
32
|
+
from typing import TYPE_CHECKING, Any
|
|
33
|
+
|
|
34
|
+
import githubasyncio.CVSS
|
|
35
|
+
import githubasyncio.CWE
|
|
36
|
+
from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
|
|
37
|
+
|
|
38
|
+
if TYPE_CHECKING:
|
|
39
|
+
from githubasyncio.CVSS import CVSS
|
|
40
|
+
from githubasyncio.CWE import CWE
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class AdvisoryBase(NonCompletableGithubObject):
|
|
44
|
+
"""
|
|
45
|
+
This class represents the shared attributes between GlobalAdvisory, RepositoryAdvisory and DependabotAdvisory
|
|
46
|
+
https://docs.github.com/en/rest/security-advisories/global-advisories
|
|
47
|
+
https://docs.github.com/en/rest/security-advisories/repository-advisories
|
|
48
|
+
https://docs.github.com/en/rest/dependabot/alerts
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
def _initAttributes(self) -> None:
|
|
52
|
+
self._cve_id: Attribute[str] = NotSet
|
|
53
|
+
self._cvss: Attribute[CVSS] = NotSet
|
|
54
|
+
self._cvss_severities: Attribute[dict[str, Any]] = NotSet
|
|
55
|
+
self._cwes: Attribute[list[CWE]] = NotSet
|
|
56
|
+
self._description: Attribute[str] = NotSet
|
|
57
|
+
self._ghsa_id: Attribute[str] = NotSet
|
|
58
|
+
self._html_url: Attribute[str] = NotSet
|
|
59
|
+
self._identifiers: Attribute[list[dict]] = NotSet
|
|
60
|
+
self._published_at: Attribute[datetime] = NotSet
|
|
61
|
+
self._severity: Attribute[str] = NotSet
|
|
62
|
+
self._summary: Attribute[str] = NotSet
|
|
63
|
+
self._updated_at: Attribute[datetime] = NotSet
|
|
64
|
+
self._url: Attribute[str] = NotSet
|
|
65
|
+
self._withdrawn_at: Attribute[datetime] = NotSet
|
|
66
|
+
|
|
67
|
+
def __repr__(self) -> str:
|
|
68
|
+
return self.get__repr__({"ghsa_id": self.ghsa_id, "summary": self.summary})
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def cve_id(self) -> str:
|
|
72
|
+
return self._cve_id.value
|
|
73
|
+
|
|
74
|
+
@property
|
|
75
|
+
def cvss(self) -> CVSS:
|
|
76
|
+
return self._cvss.value
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def cvss_severities(self) -> dict[str, Any]:
|
|
80
|
+
return self._cvss_severities.value
|
|
81
|
+
|
|
82
|
+
@property
|
|
83
|
+
def cwes(self) -> list[CWE]:
|
|
84
|
+
return self._cwes.value
|
|
85
|
+
|
|
86
|
+
@property
|
|
87
|
+
def description(self) -> str:
|
|
88
|
+
return self._description.value
|
|
89
|
+
|
|
90
|
+
@property
|
|
91
|
+
def ghsa_id(self) -> str:
|
|
92
|
+
return self._ghsa_id.value
|
|
93
|
+
|
|
94
|
+
@property
|
|
95
|
+
def html_url(self) -> str:
|
|
96
|
+
return self._html_url.value
|
|
97
|
+
|
|
98
|
+
@property
|
|
99
|
+
def identifiers(self) -> list[dict]:
|
|
100
|
+
return self._identifiers.value
|
|
101
|
+
|
|
102
|
+
@property
|
|
103
|
+
def published_at(self) -> datetime:
|
|
104
|
+
return self._published_at.value
|
|
105
|
+
|
|
106
|
+
@property
|
|
107
|
+
def severity(self) -> str:
|
|
108
|
+
return self._severity.value
|
|
109
|
+
|
|
110
|
+
@property
|
|
111
|
+
def summary(self) -> str:
|
|
112
|
+
return self._summary.value
|
|
113
|
+
|
|
114
|
+
@property
|
|
115
|
+
def updated_at(self) -> datetime:
|
|
116
|
+
return self._updated_at.value
|
|
117
|
+
|
|
118
|
+
@property
|
|
119
|
+
def url(self) -> str:
|
|
120
|
+
return self._url.value
|
|
121
|
+
|
|
122
|
+
@property
|
|
123
|
+
def withdrawn_at(self) -> datetime:
|
|
124
|
+
return self._withdrawn_at.value
|
|
125
|
+
|
|
126
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
127
|
+
if "cve_id" in attributes: # pragma no branch
|
|
128
|
+
self._cve_id = self._makeStringAttribute(attributes["cve_id"])
|
|
129
|
+
if "cvss" in attributes: # pragma no branch
|
|
130
|
+
self._cvss = self._makeClassAttribute(githubasyncio.CVSS.CVSS, attributes["cvss"])
|
|
131
|
+
if "cvss_severities" in attributes: # pragma no branch
|
|
132
|
+
self._cvss_severities = self._makeDictAttribute(attributes["cvss_severities"])
|
|
133
|
+
if "cwes" in attributes: # pragma no branch
|
|
134
|
+
self._cwes = self._makeListOfClassesAttribute(githubasyncio.CWE.CWE, attributes["cwes"])
|
|
135
|
+
if "description" in attributes: # pragma no branch
|
|
136
|
+
self._description = self._makeStringAttribute(attributes["description"])
|
|
137
|
+
if "ghsa_id" in attributes: # pragma no branch
|
|
138
|
+
self._ghsa_id = self._makeStringAttribute(attributes["ghsa_id"])
|
|
139
|
+
if "html_url" in attributes: # pragma no branch
|
|
140
|
+
self._html_url = self._makeStringAttribute(attributes["html_url"])
|
|
141
|
+
if "identifiers" in attributes: # pragma no branch
|
|
142
|
+
self._identifiers = self._makeListOfDictsAttribute(attributes["identifiers"])
|
|
143
|
+
if "published_at" in attributes: # pragma no branch
|
|
144
|
+
assert attributes["published_at"] is None or isinstance(attributes["published_at"], str), attributes[
|
|
145
|
+
"published_at"
|
|
146
|
+
]
|
|
147
|
+
self._published_at = self._makeDatetimeAttribute(attributes["published_at"])
|
|
148
|
+
if "severity" in attributes: # pragma no branch
|
|
149
|
+
self._severity = self._makeStringAttribute(attributes["severity"])
|
|
150
|
+
if "summary" in attributes: # pragma no branch
|
|
151
|
+
self._summary = self._makeStringAttribute(attributes["summary"])
|
|
152
|
+
if "updated_at" in attributes: # pragma no branch
|
|
153
|
+
assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], str), attributes[
|
|
154
|
+
"updated_at"
|
|
155
|
+
]
|
|
156
|
+
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
|
|
157
|
+
if "url" in attributes: # pragma no branch
|
|
158
|
+
self._url = self._makeStringAttribute(attributes["url"])
|
|
159
|
+
if "withdrawn_at" in attributes: # pragma no branch
|
|
160
|
+
assert attributes["withdrawn_at"] is None or isinstance(attributes["withdrawn_at"], str), attributes[
|
|
161
|
+
"withdrawn_at"
|
|
162
|
+
]
|
|
163
|
+
self._withdrawn_at = self._makeDatetimeAttribute(attributes["withdrawn_at"])
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# FILE AUTO GENERATED DO NOT TOUCH
|
|
2
|
+
############################ Copyrights and license ############################
|
|
3
|
+
# #
|
|
4
|
+
# Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
|
|
5
|
+
# Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
6
|
+
# Copyright 2023 Jonathan Leitschuh <jonathan.leitschuh@gmail.com> #
|
|
7
|
+
# Copyright 2023 Joseph Henrich <crimsonknave@gmail.com> #
|
|
8
|
+
# Copyright 2023 Trim21 <trim21.me@gmail.com> #
|
|
9
|
+
# Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
|
|
10
|
+
# Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
11
|
+
# Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
|
|
12
|
+
# Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
|
|
13
|
+
# #
|
|
14
|
+
# This file is part of PyGithub. #
|
|
15
|
+
# http://pygithub.readthedocs.io/ #
|
|
16
|
+
# #
|
|
17
|
+
# PyGithub is free software: you can redistribute it and/or modify it under #
|
|
18
|
+
# the terms of the GNU Lesser General Public License as published by the Free #
|
|
19
|
+
# Software Foundation, either version 3 of the License, or (at your option) #
|
|
20
|
+
# any later version. #
|
|
21
|
+
# #
|
|
22
|
+
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
|
|
23
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
|
24
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
|
|
25
|
+
# details. #
|
|
26
|
+
# #
|
|
27
|
+
# You should have received a copy of the GNU Lesser General Public License #
|
|
28
|
+
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
|
29
|
+
# #
|
|
30
|
+
################################################################################
|
|
31
|
+
|
|
32
|
+
from __future__ import annotations
|
|
33
|
+
|
|
34
|
+
from typing import TYPE_CHECKING, Any, Union
|
|
35
|
+
|
|
36
|
+
import githubasyncio.NamedUser
|
|
37
|
+
from githubasyncio.compat import TypedDict
|
|
38
|
+
from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
|
|
39
|
+
|
|
40
|
+
if TYPE_CHECKING:
|
|
41
|
+
from githubasyncio.NamedUser import NamedUser
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class SimpleCredit(TypedDict):
|
|
45
|
+
"""
|
|
46
|
+
A simple credit for a security advisory.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
login: str | NamedUser
|
|
50
|
+
type: str
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
Credit = Union[SimpleCredit, "AdvisoryCredit"]
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class AdvisoryCredit(NonCompletableGithubObject):
|
|
57
|
+
"""
|
|
58
|
+
This class represents a credit that is assigned to a SecurityAdvisory.
|
|
59
|
+
|
|
60
|
+
The reference can be found here
|
|
61
|
+
https://docs.github.com/en/rest/security-advisories/repository-advisories
|
|
62
|
+
|
|
63
|
+
The OpenAPI schema can be found at
|
|
64
|
+
|
|
65
|
+
- /components/schemas/repository-advisory/properties/credits/items
|
|
66
|
+
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
def _initAttributes(self) -> None:
|
|
70
|
+
self._login: Attribute[str] = NotSet
|
|
71
|
+
self._type: Attribute[str] = NotSet
|
|
72
|
+
|
|
73
|
+
def __repr__(self) -> str:
|
|
74
|
+
return self.get__repr__(
|
|
75
|
+
{
|
|
76
|
+
"login": self._login.value,
|
|
77
|
+
"type": self._type.value,
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
@property
|
|
82
|
+
def login(self) -> str:
|
|
83
|
+
"""
|
|
84
|
+
:type: string
|
|
85
|
+
"""
|
|
86
|
+
return self._login.value
|
|
87
|
+
|
|
88
|
+
@property
|
|
89
|
+
def type(self) -> str:
|
|
90
|
+
"""
|
|
91
|
+
:type: string
|
|
92
|
+
"""
|
|
93
|
+
return self._type.value
|
|
94
|
+
|
|
95
|
+
@staticmethod
|
|
96
|
+
def _validate_credit(credit: Credit) -> None:
|
|
97
|
+
assert isinstance(credit, (dict, AdvisoryCredit)), credit
|
|
98
|
+
if isinstance(credit, dict):
|
|
99
|
+
assert "login" in credit, credit
|
|
100
|
+
assert "type" in credit, credit
|
|
101
|
+
assert isinstance(credit["login"], (str, githubasyncio.NamedUser.NamedUser)), credit["login"]
|
|
102
|
+
assert isinstance(credit["type"], str), credit["type"]
|
|
103
|
+
else:
|
|
104
|
+
assert isinstance(credit.login, str), credit.login
|
|
105
|
+
assert isinstance(credit.type, str), credit.type
|
|
106
|
+
|
|
107
|
+
@staticmethod
|
|
108
|
+
async def _to_github_dict(credit: Credit) -> SimpleCredit:
|
|
109
|
+
assert isinstance(credit, (dict, AdvisoryCredit)), credit
|
|
110
|
+
if isinstance(credit, dict):
|
|
111
|
+
assert "login" in credit, credit
|
|
112
|
+
assert "type" in credit, credit
|
|
113
|
+
assert isinstance(credit["login"], (str, githubasyncio.NamedUser.NamedUser)), credit["login"]
|
|
114
|
+
login = credit["login"]
|
|
115
|
+
if isinstance(login, githubasyncio.NamedUser.NamedUser):
|
|
116
|
+
login = await login.login
|
|
117
|
+
return {
|
|
118
|
+
"login": login,
|
|
119
|
+
"type": credit["type"],
|
|
120
|
+
}
|
|
121
|
+
else:
|
|
122
|
+
return {
|
|
123
|
+
"login": credit.login,
|
|
124
|
+
"type": credit.type,
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
128
|
+
if "login" in attributes: # pragma no branch
|
|
129
|
+
self._login = self._makeStringAttribute(attributes["login"])
|
|
130
|
+
if "type" in attributes: # pragma no branch
|
|
131
|
+
self._type = self._makeStringAttribute(attributes["type"])
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# FILE AUTO GENERATED DO NOT TOUCH
|
|
2
|
+
############################ Copyrights and license ############################
|
|
3
|
+
# #
|
|
4
|
+
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
|
|
5
|
+
# Copyright 2012 Zearin <zearin@gonk.net> #
|
|
6
|
+
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
|
|
7
|
+
# Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net> #
|
|
8
|
+
# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com> #
|
|
9
|
+
# Copyright 2018 Wan Liuyang <tsfdye@gmail.com> #
|
|
10
|
+
# Copyright 2018 sfdye <tsfdye@gmail.com> #
|
|
11
|
+
# Copyright 2019 Adam Baratz <adam.baratz@gmail.com> #
|
|
12
|
+
# Copyright 2019 Nick Campbell <nicholas.j.campbell@gmail.com> #
|
|
13
|
+
# Copyright 2019 Steve Kowalik <steven@wedontsleep.org> #
|
|
14
|
+
# Copyright 2019 Wan Liuyang <tsfdye@gmail.com> #
|
|
15
|
+
# Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
|
|
16
|
+
# Copyright 2021 Steve Kowalik <steven@wedontsleep.org> #
|
|
17
|
+
# Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
|
|
18
|
+
# Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
19
|
+
# Copyright 2023 Jonathan Leitschuh <jonathan.leitschuh@gmail.com> #
|
|
20
|
+
# Copyright 2023 Joseph Henrich <crimsonknave@gmail.com> #
|
|
21
|
+
# Copyright 2023 Trim21 <trim21.me@gmail.com> #
|
|
22
|
+
# Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
|
|
23
|
+
# Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
24
|
+
# Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
|
|
25
|
+
# Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
|
|
26
|
+
# #
|
|
27
|
+
# This file is part of PyGithub. #
|
|
28
|
+
# http://pygithub.readthedocs.io/ #
|
|
29
|
+
# #
|
|
30
|
+
# PyGithub is free software: you can redistribute it and/or modify it under #
|
|
31
|
+
# the terms of the GNU Lesser General Public License as published by the Free #
|
|
32
|
+
# Software Foundation, either version 3 of the License, or (at your option) #
|
|
33
|
+
# any later version. #
|
|
34
|
+
# #
|
|
35
|
+
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
|
|
36
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
|
37
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
|
|
38
|
+
# details. #
|
|
39
|
+
# #
|
|
40
|
+
# You should have received a copy of the GNU Lesser General Public License #
|
|
41
|
+
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
|
42
|
+
# #
|
|
43
|
+
################################################################################
|
|
44
|
+
|
|
45
|
+
from __future__ import annotations
|
|
46
|
+
|
|
47
|
+
from typing import TYPE_CHECKING, Any
|
|
48
|
+
|
|
49
|
+
import githubasyncio.NamedUser
|
|
50
|
+
from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
|
|
51
|
+
|
|
52
|
+
if TYPE_CHECKING:
|
|
53
|
+
from githubasyncio.NamedUser import NamedUser
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class AdvisoryCreditDetailed(NonCompletableGithubObject):
|
|
57
|
+
"""
|
|
58
|
+
This class represents a credit that is assigned to a SecurityAdvisory.
|
|
59
|
+
|
|
60
|
+
The reference can be found here
|
|
61
|
+
https://docs.github.com/en/rest/security-advisories/repository-advisories
|
|
62
|
+
|
|
63
|
+
The OpenAPI schema can be found at
|
|
64
|
+
|
|
65
|
+
- /components/schemas/global-advisory/properties/credits/items
|
|
66
|
+
- /components/schemas/repository-advisory-credit
|
|
67
|
+
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
def _initAttributes(self) -> None:
|
|
71
|
+
self._state: Attribute[str] = NotSet
|
|
72
|
+
self._type: Attribute[str] = NotSet
|
|
73
|
+
self._user: Attribute[NamedUser] = NotSet
|
|
74
|
+
|
|
75
|
+
def __repr__(self) -> str:
|
|
76
|
+
return self.get__repr__(
|
|
77
|
+
{
|
|
78
|
+
"user": self._user.value,
|
|
79
|
+
"type": self._type.value,
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def state(self) -> str:
|
|
85
|
+
"""
|
|
86
|
+
:type: string
|
|
87
|
+
"""
|
|
88
|
+
return self._state.value
|
|
89
|
+
|
|
90
|
+
@property
|
|
91
|
+
def type(self) -> str:
|
|
92
|
+
"""
|
|
93
|
+
:type: string
|
|
94
|
+
"""
|
|
95
|
+
return self._type.value
|
|
96
|
+
|
|
97
|
+
@property
|
|
98
|
+
def user(self) -> NamedUser:
|
|
99
|
+
"""
|
|
100
|
+
:type: :class:`githubasyncio.NamedUser.NamedUser`
|
|
101
|
+
"""
|
|
102
|
+
return self._user.value
|
|
103
|
+
|
|
104
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
105
|
+
if "state" in attributes: # pragma no branch
|
|
106
|
+
self._state = self._makeStringAttribute(attributes["state"])
|
|
107
|
+
if "type" in attributes: # pragma no branch
|
|
108
|
+
self._type = self._makeStringAttribute(attributes["type"])
|
|
109
|
+
if "user" in attributes: # pragma no branch
|
|
110
|
+
self._user = self._makeClassAttribute(githubasyncio.NamedUser.NamedUser, attributes["user"])
|