gcp-attest 0.0.1__tar.gz

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.
@@ -0,0 +1,26 @@
1
+ ---
2
+ repos:
3
+ - repo: https://github.com/asottile/reorder-python-imports
4
+ rev: v3.16.0
5
+ hooks:
6
+ - id: reorder-python-imports
7
+
8
+ - repo: https://github.com/astral-sh/ruff-pre-commit
9
+ rev: v0.15.20
10
+ hooks:
11
+ - id: ruff-check
12
+ args: [--fix, --exit-non-zero-on-fix]
13
+ - id: ruff-format
14
+
15
+ - repo: https://github.com/codespell-project/codespell
16
+ rev: v2.4.2
17
+ hooks:
18
+ - id: codespell
19
+
20
+ - repo: https://github.com/pre-commit/pre-commit-hooks
21
+ rev: v6.0.0
22
+ hooks:
23
+ - id: trailing-whitespace
24
+ - id: end-of-file-fixer
25
+ - id: check-toml
26
+ - id: check-yaml
@@ -0,0 +1 @@
1
+ 3.14
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2026 Nikita Karamov
2
+
3
+ Permission to use, copy, modify, and/or distribute this software for any
4
+ purpose with or without fee is hereby granted, provided that the above
5
+ copyright notice and this permission notice appear in all copies.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,50 @@
1
+ Metadata-Version: 2.4
2
+ Name: gcp-attest
3
+ Version: 0.0.1
4
+ Summary: Digital Attestations and Trusted Publishing via Google Cloud IAM
5
+ Project-URL: Source, https://codeberg.org/kytta/gcp-attest
6
+ Author-email: Nikita Karamov <me@kytta.dev>
7
+ License-Expression: ISC
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Environment :: Console
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Topic :: Software Development
18
+ Requires-Python: >=3.9
19
+ Requires-Dist: google-auth>=2.16.1
20
+ Description-Content-Type: text/markdown
21
+
22
+ # gcp-attest
23
+
24
+ Produce Digital Attestations and use PyPI Trusted Publishing using Google Cloud service accounts.
25
+
26
+ ## Why
27
+
28
+ PyPI encourages Trusted Publishing, but their supported platforms do not include Codeberg. This is understandable: Supporting a new platform means trusting it, and for a long time neither of Codeberg's CI options even had an option to issue OIDC tokens.
29
+
30
+ PyPI trusts Google's OIDC, though. All OIDC tokens issued by Google Cloud IAM can be exchanged against valid PyPI publishing tokens. The same applies to Sigstore and digital attestations.
31
+
32
+ Google Cloud OIDC tokens usually represent a service account. There are multiple ways to "log in" as said account to issue tokens:
33
+
34
+ 1. Inside a Google Cloud workflow. This is the expected way and already supported by [di/id][id] and [pypi-attestations].
35
+ 2. Using a long-lived credentials key file.
36
+ 3. Using [Workload Identity Federation](https://docs.cloud.google.com/iam/docs/workload-identity-federation-with-other-providers)
37
+
38
+ The last one is interesting, as it allows us to exchange OIDC tokens from any valid identity provider for Google Cloud tokens. This way, Google Cloud acts like a proxy between PyPI and not (yet) supported OIDC providers.
39
+
40
+ This project aims to simplify publishing process by offering APIs to create attestations and exchange tokens.
41
+
42
+ ## Licence
43
+
44
+ © 2026 [Nikita Karamov]\
45
+ Licensed under the [ISC License][ISC]
46
+
47
+ [id]: https://github.com/di/id
48
+ [ISC]: https://spdx.org/licenses/ISC.html
49
+ [Nikita Karamov]: https://www.kytta.dev/
50
+ [pypi-attestations]: https://github.com/pypi/pypi-attestations
@@ -0,0 +1,29 @@
1
+ # gcp-attest
2
+
3
+ Produce Digital Attestations and use PyPI Trusted Publishing using Google Cloud service accounts.
4
+
5
+ ## Why
6
+
7
+ PyPI encourages Trusted Publishing, but their supported platforms do not include Codeberg. This is understandable: Supporting a new platform means trusting it, and for a long time neither of Codeberg's CI options even had an option to issue OIDC tokens.
8
+
9
+ PyPI trusts Google's OIDC, though. All OIDC tokens issued by Google Cloud IAM can be exchanged against valid PyPI publishing tokens. The same applies to Sigstore and digital attestations.
10
+
11
+ Google Cloud OIDC tokens usually represent a service account. There are multiple ways to "log in" as said account to issue tokens:
12
+
13
+ 1. Inside a Google Cloud workflow. This is the expected way and already supported by [di/id][id] and [pypi-attestations].
14
+ 2. Using a long-lived credentials key file.
15
+ 3. Using [Workload Identity Federation](https://docs.cloud.google.com/iam/docs/workload-identity-federation-with-other-providers)
16
+
17
+ The last one is interesting, as it allows us to exchange OIDC tokens from any valid identity provider for Google Cloud tokens. This way, Google Cloud acts like a proxy between PyPI and not (yet) supported OIDC providers.
18
+
19
+ This project aims to simplify publishing process by offering APIs to create attestations and exchange tokens.
20
+
21
+ ## Licence
22
+
23
+ © 2026 [Nikita Karamov]\
24
+ Licensed under the [ISC License][ISC]
25
+
26
+ [id]: https://github.com/di/id
27
+ [ISC]: https://spdx.org/licenses/ISC.html
28
+ [Nikita Karamov]: https://www.kytta.dev/
29
+ [pypi-attestations]: https://github.com/pypi/pypi-attestations
@@ -0,0 +1,2 @@
1
+ # Created by coverage.py
2
+ *
@@ -0,0 +1,283 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <title>Coverage report</title>
6
+ <link rel="icon" sizes="32x32" href="favicon_32_cb_c827f16f.png">
7
+ <link rel="stylesheet" href="style_cb_4667309f.css" type="text/css">
8
+ <script src="coverage_html_cb_dd2e7eb5.js" defer></script>
9
+ </head>
10
+ <body class="indexfile">
11
+ <header>
12
+ <div class="content">
13
+ <h1>Coverage report:
14
+ <span class="pc_cov">60%</span>
15
+ </h1>
16
+ <aside id="help_panel_wrapper">
17
+ <input id="help_panel_state" type="checkbox">
18
+ <label for="help_panel_state">
19
+ <img id="keyboard_icon" src="keybd_closed_cb_900cfef5.png" alt="Show/hide keyboard shortcuts">
20
+ </label>
21
+ <div id="help_panel">
22
+ <p class="legend">Shortcuts on this page</p>
23
+ <div class="keyhelp">
24
+ <p>
25
+ <kbd>f</kbd>
26
+ <kbd>n</kbd>
27
+ <kbd>s</kbd>
28
+ <kbd>m</kbd>
29
+ <kbd>x</kbd>
30
+ <kbd>b</kbd>
31
+ <kbd>p</kbd>
32
+ <kbd>c</kbd>
33
+ &nbsp; change column sorting
34
+ </p>
35
+ <p>
36
+ <kbd>[</kbd>
37
+ <kbd>]</kbd>
38
+ &nbsp; prev/next file
39
+ </p>
40
+ <p>
41
+ <kbd>?</kbd> &nbsp; show/hide this help
42
+ </p>
43
+ </div>
44
+ </div>
45
+ </aside>
46
+ <form id="filter_container">
47
+ <input id="filter" type="text" value="" placeholder="filter...">
48
+ <div>
49
+ <input id="hide100" type="checkbox" >
50
+ <label for="hide100">hide covered</label>
51
+ </div>
52
+ </form>
53
+ <h2>
54
+ <a class="button" href="index.html">Files</a>
55
+ <a class="button" href="function_index.html">Functions</a>
56
+ <a class="button current">Classes</a>
57
+ </h2>
58
+ <p class="text">
59
+ <a class="nav" href="https://coverage.readthedocs.io/en/7.15.0">coverage.py v7.15.0</a>,
60
+ created at 2026-07-12 16:04 +0200
61
+ </p>
62
+ </div>
63
+ </header>
64
+ <main id="index">
65
+ <table class="index" data-sortable>
66
+ <thead>
67
+ <tr class="tablehead grouphead">
68
+ <th class="spacer">&nbsp;</th>
69
+ <th class="spacer">&nbsp;</th>
70
+ <th class="spacer">&nbsp;</th>
71
+ <th class="left" colspan="4">Statements</th>
72
+ <th class="spacer">&nbsp;</th>
73
+ <th class="left" colspan="3">Branches</th>
74
+ <th class="spacer">&nbsp;</th>
75
+ <th>Total</th>
76
+ </tr>
77
+ <tr class="tablehead" title="Click to sort">
78
+ <th id="file" class="name" aria-sort="none" data-shortcut="f">File<span class="arrows"></span></th>
79
+ <th id="region" class="name" aria-sort="none" data-default-sort-order="ascending" data-shortcut="n">class<span class="arrows"></span></th>
80
+ <th class="spacer">&nbsp;</th>
81
+ <th id="statements_coverage" aria-sort="none" data-default-sort-order="descending">coverage<span class="arrows"></span></th>
82
+ <th id="statements" aria-sort="none" data-default-sort-order="descending" data-shortcut="s">statements<span class="arrows"></span></th>
83
+ <th id="missing" aria-sort="none" data-default-sort-order="descending" data-shortcut="m">missing<span class="arrows"></span></th>
84
+ <th id="excluded" aria-sort="none" data-default-sort-order="descending" data-shortcut="x">excluded<span class="arrows"></span></th>
85
+ <th class="spacer">&nbsp;</th>
86
+ <th id="branches_coverage" aria-sort="none" data-default-sort-order="descending">coverage<span class="arrows"></span></th>
87
+ <th id="branches" aria-sort="none" data-default-sort-order="descending" data-shortcut="b">branches<span class="arrows"></span></th>
88
+ <th id="partial" aria-sort="none" data-default-sort-order="descending" data-shortcut="p">partial<span class="arrows"></span></th>
89
+ <th class="spacer">&nbsp;</th>
90
+ <th id="coverage" aria-sort="none" data-shortcut="c">coverage<span class="arrows"></span></th>
91
+ </tr>
92
+ </thead>
93
+ <tbody>
94
+ <tr class="region">
95
+ <td class="name"><a href="z_47ba608c6582b065___init___py.html">src<span class="sep">/</span>gcp_attest<span class="sep">/</span>__init__.py</a></td>
96
+ <td class="name"><a href="z_47ba608c6582b065___init___py.html"><data value=''><span class='no-noun'>(no class)</span></data></a></td>
97
+ <td class="spacer">&nbsp;</td>
98
+ <td data-ratio="0 0">100%</td>
99
+ <td>0</td>
100
+ <td>0</td>
101
+ <td>0</td>
102
+ <td class="spacer">&nbsp;</td>
103
+ <td data-ratio="0 0">100%</td>
104
+ <td>0</td>
105
+ <td>0</td>
106
+ <td class="spacer">&nbsp;</td>
107
+ <td data-ratio="0 0">100%</td>
108
+ </tr>
109
+ <tr class="region">
110
+ <td class="name"><a href="z_14602602a5299016___init___py.html">src<span class="sep">/</span>gcp_attest<span class="sep">/</span>_cli<span class="sep">/</span>__init__.py</a></td>
111
+ <td class="name"><a href="z_14602602a5299016___init___py.html"><data value=''><span class='no-noun'>(no class)</span></data></a></td>
112
+ <td class="spacer">&nbsp;</td>
113
+ <td data-ratio="27 34">79%</td>
114
+ <td>34</td>
115
+ <td>7</td>
116
+ <td>3</td>
117
+ <td class="spacer">&nbsp;</td>
118
+ <td data-ratio="1 4">25%</td>
119
+ <td>4</td>
120
+ <td>1</td>
121
+ <td class="spacer">&nbsp;</td>
122
+ <td data-ratio="28 38">74%</td>
123
+ </tr>
124
+ <tr class="region">
125
+ <td class="name"><a href="z_47ba608c6582b065_credentials_py.html#t13">src<span class="sep">/</span>gcp_attest<span class="sep">/</span>credentials.py</a></td>
126
+ <td class="name"><a href="z_47ba608c6582b065_credentials_py.html#t13"><data value='JsonCredentialFormat'>JsonCredentialFormat</data></a></td>
127
+ <td class="spacer">&nbsp;</td>
128
+ <td data-ratio="0 0">100%</td>
129
+ <td>0</td>
130
+ <td>0</td>
131
+ <td>0</td>
132
+ <td class="spacer">&nbsp;</td>
133
+ <td data-ratio="0 0">100%</td>
134
+ <td>0</td>
135
+ <td>0</td>
136
+ <td class="spacer">&nbsp;</td>
137
+ <td data-ratio="0 0">100%</td>
138
+ </tr>
139
+ <tr class="region">
140
+ <td class="name"><a href="z_47ba608c6582b065_credentials_py.html#t18">src<span class="sep">/</span>gcp_attest<span class="sep">/</span>credentials.py</a></td>
141
+ <td class="name"><a href="z_47ba608c6582b065_credentials_py.html#t18"><data value='UrlCredentialSource'>UrlCredentialSource</data></a></td>
142
+ <td class="spacer">&nbsp;</td>
143
+ <td data-ratio="0 0">100%</td>
144
+ <td>0</td>
145
+ <td>0</td>
146
+ <td>0</td>
147
+ <td class="spacer">&nbsp;</td>
148
+ <td data-ratio="0 0">100%</td>
149
+ <td>0</td>
150
+ <td>0</td>
151
+ <td class="spacer">&nbsp;</td>
152
+ <td data-ratio="0 0">100%</td>
153
+ </tr>
154
+ <tr class="region">
155
+ <td class="name"><a href="z_47ba608c6582b065_credentials_py.html#t24">src<span class="sep">/</span>gcp_attest<span class="sep">/</span>credentials.py</a></td>
156
+ <td class="name"><a href="z_47ba608c6582b065_credentials_py.html#t24"><data value='CredentialsConfig'>CredentialsConfig</data></a></td>
157
+ <td class="spacer">&nbsp;</td>
158
+ <td data-ratio="0 0">100%</td>
159
+ <td>0</td>
160
+ <td>0</td>
161
+ <td>0</td>
162
+ <td class="spacer">&nbsp;</td>
163
+ <td data-ratio="0 0">100%</td>
164
+ <td>0</td>
165
+ <td>0</td>
166
+ <td class="spacer">&nbsp;</td>
167
+ <td data-ratio="0 0">100%</td>
168
+ </tr>
169
+ <tr class="region">
170
+ <td class="name"><a href="z_47ba608c6582b065_credentials_py.html">src<span class="sep">/</span>gcp_attest<span class="sep">/</span>credentials.py</a></td>
171
+ <td class="name"><a href="z_47ba608c6582b065_credentials_py.html"><data value=''><span class='no-noun'>(no class)</span></data></a></td>
172
+ <td class="spacer">&nbsp;</td>
173
+ <td data-ratio="32 57">56%</td>
174
+ <td>57</td>
175
+ <td>25</td>
176
+ <td>3</td>
177
+ <td class="spacer">&nbsp;</td>
178
+ <td data-ratio="7 22">32%</td>
179
+ <td>22</td>
180
+ <td>7</td>
181
+ <td class="spacer">&nbsp;</td>
182
+ <td data-ratio="39 79">49%</td>
183
+ </tr>
184
+ <tr class="region">
185
+ <td class="name"><a href="z_a44f0ac069e85531___init___py.html">tests<span class="sep">/</span>__init__.py</a></td>
186
+ <td class="name"><a href="z_a44f0ac069e85531___init___py.html"><data value=''><span class='no-noun'>(no class)</span></data></a></td>
187
+ <td class="spacer">&nbsp;</td>
188
+ <td data-ratio="0 0">100%</td>
189
+ <td>0</td>
190
+ <td>0</td>
191
+ <td>0</td>
192
+ <td class="spacer">&nbsp;</td>
193
+ <td data-ratio="0 0">100%</td>
194
+ <td>0</td>
195
+ <td>0</td>
196
+ <td class="spacer">&nbsp;</td>
197
+ <td data-ratio="0 0">100%</td>
198
+ </tr>
199
+ <tr class="region">
200
+ <td class="name"><a href="z_a44f0ac069e85531_cli_test_py.html">tests<span class="sep">/</span>cli_test.py</a></td>
201
+ <td class="name"><a href="z_a44f0ac069e85531_cli_test_py.html"><data value=''><span class='no-noun'>(no class)</span></data></a></td>
202
+ <td class="spacer">&nbsp;</td>
203
+ <td data-ratio="15 20">75%</td>
204
+ <td>20</td>
205
+ <td>5</td>
206
+ <td>0</td>
207
+ <td class="spacer">&nbsp;</td>
208
+ <td data-ratio="0 0">100%</td>
209
+ <td>0</td>
210
+ <td>0</td>
211
+ <td class="spacer">&nbsp;</td>
212
+ <td data-ratio="15 20">75%</td>
213
+ </tr>
214
+ <tr class="region">
215
+ <td class="name"><a href="z_a44f0ac069e85531_conftest_py.html">tests<span class="sep">/</span>conftest.py</a></td>
216
+ <td class="name"><a href="z_a44f0ac069e85531_conftest_py.html"><data value=''><span class='no-noun'>(no class)</span></data></a></td>
217
+ <td class="spacer">&nbsp;</td>
218
+ <td data-ratio="3 3">100%</td>
219
+ <td>3</td>
220
+ <td>0</td>
221
+ <td>9</td>
222
+ <td class="spacer">&nbsp;</td>
223
+ <td data-ratio="0 0">100%</td>
224
+ <td>0</td>
225
+ <td>0</td>
226
+ <td class="spacer">&nbsp;</td>
227
+ <td data-ratio="3 3">100%</td>
228
+ </tr>
229
+ <tr class="region">
230
+ <td class="name"><a href="z_a44f0ac069e85531_credentials_test_py.html">tests<span class="sep">/</span>credentials_test.py</a></td>
231
+ <td class="name"><a href="z_a44f0ac069e85531_credentials_test_py.html"><data value=''><span class='no-noun'>(no class)</span></data></a></td>
232
+ <td class="spacer">&nbsp;</td>
233
+ <td data-ratio="11 21">52%</td>
234
+ <td>21</td>
235
+ <td>10</td>
236
+ <td>0</td>
237
+ <td class="spacer">&nbsp;</td>
238
+ <td data-ratio="0 0">100%</td>
239
+ <td>0</td>
240
+ <td>0</td>
241
+ <td class="spacer">&nbsp;</td>
242
+ <td data-ratio="11 21">52%</td>
243
+ </tr>
244
+ </tbody>
245
+ <tfoot>
246
+ <tr class="total">
247
+ <td class="name">Total</td>
248
+ <td class="name">&nbsp;</td>
249
+ <td class="spacer">&nbsp;</td>
250
+ <td data-ratio="88 135">65%</td>
251
+ <td>135</td>
252
+ <td>47</td>
253
+ <td>15</td>
254
+ <td class="spacer">&nbsp;</td>
255
+ <td data-ratio="8 26">31%</td>
256
+ <td>26</td>
257
+ <td>8</td>
258
+ <td class="spacer">&nbsp;</td>
259
+ <td data-ratio="96 161">60%</td>
260
+ </tr>
261
+ </tfoot>
262
+ </table>
263
+ <p id="no_rows">
264
+ No items found using the specified filter.
265
+ </p>
266
+ </main>
267
+ <footer>
268
+ <div class="content">
269
+ <p>
270
+ <a class="nav" href="https://coverage.readthedocs.io/en/7.15.0">coverage.py v7.15.0</a>,
271
+ created at 2026-07-12 16:04 +0200
272
+ </p>
273
+ </div>
274
+ <aside class="hidden">
275
+ <a id="prevFileLink" class="nav" href=""></a>
276
+ <a id="nextFileLink" class="nav" href=""></a>
277
+ <button type="button" class="button_prev_file" data-shortcut="["></button>
278
+ <button type="button" class="button_next_file" data-shortcut="]"></button>
279
+ <button type="button" class="button_show_hide_help" data-shortcut="?"></button>
280
+ </aside>
281
+ </footer>
282
+ </body>
283
+ </html>