pierre-storage 0.12.1__py3-none-any.whl → 1.0.1__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.
- pierre_storage/client.py +4 -0
- pierre_storage/repo.py +76 -1
- pierre_storage/types.py +25 -1
- pierre_storage/version.py +1 -1
- {pierre_storage-0.12.1.dist-info → pierre_storage-1.0.1.dist-info}/METADATA +76 -27
- pierre_storage-1.0.1.dist-info/RECORD +15 -0
- pierre_storage-1.0.1.dist-info/licenses/LICENSE +189 -0
- pierre_storage-0.12.1.dist-info/RECORD +0 -15
- pierre_storage-0.12.1.dist-info/licenses/LICENSE +0 -21
- {pierre_storage-0.12.1.dist-info → pierre_storage-1.0.1.dist-info}/WHEEL +0 -0
- {pierre_storage-0.12.1.dist-info → pierre_storage-1.0.1.dist-info}/top_level.txt +0 -0
pierre_storage/client.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Main client for Pierre Git Storage SDK."""
|
|
2
2
|
|
|
3
3
|
import uuid
|
|
4
|
+
from datetime import datetime, timezone
|
|
4
5
|
from typing import Any, Dict, Optional, cast
|
|
5
6
|
from urllib.parse import urlencode
|
|
6
7
|
|
|
@@ -216,6 +217,7 @@ class GitStorage:
|
|
|
216
217
|
name,
|
|
217
218
|
api_version,
|
|
218
219
|
self._generate_jwt,
|
|
220
|
+
created_at=datetime.now(timezone.utc).isoformat(),
|
|
219
221
|
)
|
|
220
222
|
|
|
221
223
|
async def list_repos(
|
|
@@ -317,6 +319,7 @@ class GitStorage:
|
|
|
317
319
|
|
|
318
320
|
body = response.json()
|
|
319
321
|
default_branch = body.get("default_branch", "main")
|
|
322
|
+
created_at = body.get("created_at", "")
|
|
320
323
|
|
|
321
324
|
# These are guaranteed to be set in __init__
|
|
322
325
|
api_base_url: str = self.options["api_base_url"] # type: ignore[assignment]
|
|
@@ -332,6 +335,7 @@ class GitStorage:
|
|
|
332
335
|
name,
|
|
333
336
|
api_version,
|
|
334
337
|
self._generate_jwt,
|
|
338
|
+
created_at=created_at,
|
|
335
339
|
)
|
|
336
340
|
|
|
337
341
|
async def delete_repo(
|
pierre_storage/repo.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Repository implementation for Pierre Git Storage SDK."""
|
|
2
2
|
|
|
3
|
+
import warnings
|
|
3
4
|
from datetime import datetime
|
|
4
5
|
from types import TracebackType
|
|
5
6
|
from typing import Any, Callable, Dict, List, Optional
|
|
@@ -111,6 +112,7 @@ class RepoImpl:
|
|
|
111
112
|
name: str,
|
|
112
113
|
api_version: int,
|
|
113
114
|
generate_jwt: Callable[[str, Optional[Dict[str, Any]]], str],
|
|
115
|
+
created_at: str = "",
|
|
114
116
|
) -> None:
|
|
115
117
|
"""Initialize repository.
|
|
116
118
|
|
|
@@ -122,9 +124,11 @@ class RepoImpl:
|
|
|
122
124
|
name: Customer name
|
|
123
125
|
api_version: API version
|
|
124
126
|
generate_jwt: Function to generate JWT tokens
|
|
127
|
+
created_at: Repository creation timestamp
|
|
125
128
|
"""
|
|
126
129
|
self._id = repo_id
|
|
127
130
|
self._default_branch = default_branch
|
|
131
|
+
self._created_at = created_at
|
|
128
132
|
self.api_base_url = api_base_url.rstrip("/")
|
|
129
133
|
self.storage_base_url = storage_base_url
|
|
130
134
|
self.name = name
|
|
@@ -141,6 +145,11 @@ class RepoImpl:
|
|
|
141
145
|
"""Get default branch name."""
|
|
142
146
|
return self._default_branch
|
|
143
147
|
|
|
148
|
+
@property
|
|
149
|
+
def created_at(self) -> str:
|
|
150
|
+
"""Get repository creation timestamp."""
|
|
151
|
+
return self._created_at
|
|
152
|
+
|
|
144
153
|
async def get_remote_url(
|
|
145
154
|
self,
|
|
146
155
|
*,
|
|
@@ -235,6 +244,62 @@ class RepoImpl:
|
|
|
235
244
|
|
|
236
245
|
return StreamingResponse(response, client)
|
|
237
246
|
|
|
247
|
+
async def get_archive_stream(
|
|
248
|
+
self,
|
|
249
|
+
*,
|
|
250
|
+
ref: Optional[str] = None,
|
|
251
|
+
include_globs: Optional[List[str]] = None,
|
|
252
|
+
exclude_globs: Optional[List[str]] = None,
|
|
253
|
+
archive_prefix: Optional[str] = None,
|
|
254
|
+
ttl: Optional[int] = None,
|
|
255
|
+
) -> StreamingResponse:
|
|
256
|
+
"""Get repository archive as streaming response.
|
|
257
|
+
|
|
258
|
+
Args:
|
|
259
|
+
ref: Git ref (branch, tag, or commit SHA)
|
|
260
|
+
include_globs: Optional include globs for archived files
|
|
261
|
+
exclude_globs: Optional exclude globs for archived files
|
|
262
|
+
archive_prefix: Optional archive prefix for tar entries
|
|
263
|
+
ttl: Token TTL in seconds
|
|
264
|
+
|
|
265
|
+
Returns:
|
|
266
|
+
HTTP response with archive stream
|
|
267
|
+
"""
|
|
268
|
+
ttl = ttl or DEFAULT_TOKEN_TTL_SECONDS
|
|
269
|
+
jwt = self.generate_jwt(self._id, {"permissions": ["git:read"], "ttl": ttl})
|
|
270
|
+
|
|
271
|
+
body: Dict[str, Any] = {}
|
|
272
|
+
if ref and ref.strip():
|
|
273
|
+
body["ref"] = ref.strip()
|
|
274
|
+
if include_globs:
|
|
275
|
+
body["include_globs"] = include_globs
|
|
276
|
+
if exclude_globs:
|
|
277
|
+
body["exclude_globs"] = exclude_globs
|
|
278
|
+
if archive_prefix and archive_prefix.strip():
|
|
279
|
+
body["archive"] = {"prefix": archive_prefix.strip()}
|
|
280
|
+
|
|
281
|
+
url = f"{self.api_base_url}/api/v{self.api_version}/repos/archive"
|
|
282
|
+
|
|
283
|
+
client = httpx.AsyncClient()
|
|
284
|
+
try:
|
|
285
|
+
request_kwargs: Dict[str, Any] = {
|
|
286
|
+
"headers": {
|
|
287
|
+
"Authorization": f"Bearer {jwt}",
|
|
288
|
+
"Code-Storage-Agent": get_user_agent(),
|
|
289
|
+
},
|
|
290
|
+
"timeout": 30.0,
|
|
291
|
+
}
|
|
292
|
+
if body:
|
|
293
|
+
request_kwargs["json"] = body
|
|
294
|
+
stream_context = client.stream("POST", url, **request_kwargs)
|
|
295
|
+
response = await stream_context.__aenter__()
|
|
296
|
+
response.raise_for_status()
|
|
297
|
+
except Exception:
|
|
298
|
+
await client.aclose()
|
|
299
|
+
raise
|
|
300
|
+
|
|
301
|
+
return StreamingResponse(response, client)
|
|
302
|
+
|
|
238
303
|
async def list_files(
|
|
239
304
|
self,
|
|
240
305
|
*,
|
|
@@ -785,6 +850,7 @@ class RepoImpl:
|
|
|
785
850
|
*,
|
|
786
851
|
pattern: str,
|
|
787
852
|
ref: Optional[str] = None,
|
|
853
|
+
rev: Optional[str] = None,
|
|
788
854
|
paths: Optional[list[str]] = None,
|
|
789
855
|
case_sensitive: Optional[bool] = None,
|
|
790
856
|
file_filters: Optional[Dict[str, Any]] = None,
|
|
@@ -798,6 +864,7 @@ class RepoImpl:
|
|
|
798
864
|
Args:
|
|
799
865
|
pattern: Regex pattern to search for
|
|
800
866
|
ref: Git ref to search (defaults to server-side default branch)
|
|
867
|
+
rev: Deprecated alias for ref
|
|
801
868
|
paths: Git pathspecs to restrict search
|
|
802
869
|
case_sensitive: Whether search is case-sensitive (default: server default)
|
|
803
870
|
file_filters: Optional filters with include_globs/exclude_globs/extension_filters
|
|
@@ -812,6 +879,12 @@ class RepoImpl:
|
|
|
812
879
|
pattern_clean = pattern.strip()
|
|
813
880
|
if not pattern_clean:
|
|
814
881
|
raise ValueError("grep pattern is required")
|
|
882
|
+
if rev and rev.strip():
|
|
883
|
+
warnings.warn(
|
|
884
|
+
"repo.grep rev is deprecated; use ref instead",
|
|
885
|
+
DeprecationWarning,
|
|
886
|
+
stacklevel=2,
|
|
887
|
+
)
|
|
815
888
|
|
|
816
889
|
ttl_value = ttl or DEFAULT_TOKEN_TTL_SECONDS
|
|
817
890
|
jwt = self.generate_jwt(self._id, {"permissions": ["git:read"], "ttl": ttl_value})
|
|
@@ -825,7 +898,9 @@ class RepoImpl:
|
|
|
825
898
|
if case_sensitive is not None:
|
|
826
899
|
body["query"]["case_sensitive"] = bool(case_sensitive)
|
|
827
900
|
if ref:
|
|
828
|
-
body["
|
|
901
|
+
body["ref"] = ref
|
|
902
|
+
elif rev:
|
|
903
|
+
body["ref"] = rev
|
|
829
904
|
if paths:
|
|
830
905
|
body["paths"] = paths
|
|
831
906
|
if file_filters:
|
pierre_storage/types.py
CHANGED
|
@@ -409,6 +409,11 @@ class Repo(Protocol):
|
|
|
409
409
|
"""Get the default branch name."""
|
|
410
410
|
...
|
|
411
411
|
|
|
412
|
+
@property
|
|
413
|
+
def created_at(self) -> str:
|
|
414
|
+
"""Get the repository creation timestamp."""
|
|
415
|
+
...
|
|
416
|
+
|
|
412
417
|
async def get_remote_url(
|
|
413
418
|
self,
|
|
414
419
|
*,
|
|
@@ -429,6 +434,18 @@ class Repo(Protocol):
|
|
|
429
434
|
"""Get a file as a stream."""
|
|
430
435
|
...
|
|
431
436
|
|
|
437
|
+
async def get_archive_stream(
|
|
438
|
+
self,
|
|
439
|
+
*,
|
|
440
|
+
ref: Optional[str] = None,
|
|
441
|
+
include_globs: Optional[list[str]] = None,
|
|
442
|
+
exclude_globs: Optional[list[str]] = None,
|
|
443
|
+
archive_prefix: Optional[str] = None,
|
|
444
|
+
ttl: Optional[int] = None,
|
|
445
|
+
) -> Any: # httpx.Response
|
|
446
|
+
"""Get a repository archive as a stream."""
|
|
447
|
+
...
|
|
448
|
+
|
|
432
449
|
async def list_files(
|
|
433
450
|
self,
|
|
434
451
|
*,
|
|
@@ -555,6 +572,7 @@ class Repo(Protocol):
|
|
|
555
572
|
*,
|
|
556
573
|
pattern: str,
|
|
557
574
|
ref: Optional[str] = None,
|
|
575
|
+
rev: Optional[str] = None,
|
|
558
576
|
paths: Optional[list[str]] = None,
|
|
559
577
|
case_sensitive: Optional[bool] = None,
|
|
560
578
|
file_filters: Optional[Dict[str, Any]] = None,
|
|
@@ -563,7 +581,13 @@ class Repo(Protocol):
|
|
|
563
581
|
pagination: Optional[Dict[str, Any]] = None,
|
|
564
582
|
ttl: Optional[int] = None,
|
|
565
583
|
) -> "GrepResult":
|
|
566
|
-
"""Run grep against the repository.
|
|
584
|
+
"""Run grep against the repository.
|
|
585
|
+
|
|
586
|
+
Args:
|
|
587
|
+
pattern: Regex pattern to search for.
|
|
588
|
+
ref: Git ref to search (defaults to server-side default branch).
|
|
589
|
+
rev: Deprecated alias for ref.
|
|
590
|
+
"""
|
|
567
591
|
...
|
|
568
592
|
|
|
569
593
|
async def pull_upstream(
|
pierre_storage/version.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pierre-storage
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: Pierre Git Storage SDK for Python
|
|
5
5
|
Author-email: Pierre <support@pierre.io>
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://pierre.io
|
|
8
8
|
Project-URL: Documentation, https://docs.pierre.io
|
|
9
|
-
Project-URL: Repository, https://github.com/pierre
|
|
10
|
-
Project-URL: Issues, https://github.com/pierre/
|
|
9
|
+
Project-URL: Repository, https://github.com/pierrecomputer/pierre
|
|
10
|
+
Project-URL: Issues, https://github.com/pierrecomputer/pierre/issues
|
|
11
11
|
Classifier: Development Status :: 4 - Beta
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
13
13
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -171,6 +171,16 @@ response = await repo.get_file_stream(
|
|
|
171
171
|
text = await response.aread()
|
|
172
172
|
print(text.decode())
|
|
173
173
|
|
|
174
|
+
# Download repository archive (streaming tar.gz)
|
|
175
|
+
archive_response = await repo.get_archive_stream(
|
|
176
|
+
ref="main",
|
|
177
|
+
include_globs=["README.md"],
|
|
178
|
+
exclude_globs=["vendor/**"],
|
|
179
|
+
archive_prefix="repo/",
|
|
180
|
+
)
|
|
181
|
+
archive_bytes = await archive_response.aread()
|
|
182
|
+
print(len(archive_bytes))
|
|
183
|
+
|
|
174
184
|
# List all files in the repository
|
|
175
185
|
files = await repo.list_files(
|
|
176
186
|
ref="main", # optional, defaults to default branch
|
|
@@ -244,7 +254,8 @@ print(commit_diff["files"])
|
|
|
244
254
|
|
|
245
255
|
### Creating Commits
|
|
246
256
|
|
|
247
|
-
The SDK provides a fluent builder API for creating commits with streaming
|
|
257
|
+
The SDK provides a fluent builder API for creating commits with streaming
|
|
258
|
+
support:
|
|
248
259
|
|
|
249
260
|
```python
|
|
250
261
|
# Create a commit
|
|
@@ -268,7 +279,8 @@ print(result["ref_update"]["old_sha"]) # All zeroes when ref is created
|
|
|
268
279
|
The builder exposes:
|
|
269
280
|
|
|
270
281
|
- `add_file(path, source, *, mode=None)` - Attach bytes from various sources
|
|
271
|
-
- `add_file_from_string(path, contents, encoding="utf-8", *, mode=None)` - Add
|
|
282
|
+
- `add_file_from_string(path, contents, encoding="utf-8", *, mode=None)` - Add
|
|
283
|
+
text files (defaults to UTF-8)
|
|
272
284
|
- `delete_path(path)` - Remove files or folders
|
|
273
285
|
- `send()` - Finalize the commit and receive metadata
|
|
274
286
|
|
|
@@ -289,22 +301,29 @@ The builder exposes:
|
|
|
289
301
|
}
|
|
290
302
|
```
|
|
291
303
|
|
|
292
|
-
If the backend reports a failure, the builder raises a `RefUpdateError`
|
|
304
|
+
If the backend reports a failure, the builder raises a `RefUpdateError`
|
|
305
|
+
containing the status, reason, and ref details.
|
|
293
306
|
|
|
294
307
|
**Options:**
|
|
295
308
|
|
|
296
309
|
- `target_branch` (required): Branch name (without `refs/heads/` prefix)
|
|
297
|
-
- `expected_head_sha` (optional): Branch or commit that must match the remote
|
|
298
|
-
|
|
299
|
-
- `
|
|
300
|
-
|
|
310
|
+
- `expected_head_sha` (optional): Branch or commit that must match the remote
|
|
311
|
+
tip
|
|
312
|
+
- `base_branch` (optional): Name of the branch to use as the base when creating
|
|
313
|
+
a new branch (without `refs/heads/` prefix)
|
|
314
|
+
- `ephemeral` (optional): Mark the target branch as ephemeral (stored in
|
|
315
|
+
separate namespace)
|
|
316
|
+
- `ephemeral_base` (optional): Indicates the base branch is ephemeral (requires
|
|
317
|
+
`base_branch`)
|
|
301
318
|
- `commit_message` (required): The commit message
|
|
302
319
|
- `author` (required): Dictionary with `name` and `email`
|
|
303
|
-
- `committer` (optional): Dictionary with `name` and `email` (defaults to
|
|
320
|
+
- `committer` (optional): Dictionary with `name` and `email` (defaults to
|
|
321
|
+
author)
|
|
304
322
|
|
|
305
323
|
### Creating Commits from Diff Streams
|
|
306
324
|
|
|
307
|
-
When you already have a unified diff, you can let the SDK apply it directly
|
|
325
|
+
When you already have a unified diff, you can let the SDK apply it directly
|
|
326
|
+
without building individual file operations:
|
|
308
327
|
|
|
309
328
|
```python
|
|
310
329
|
diff_text = """\
|
|
@@ -327,13 +346,21 @@ result = await repo.create_commit_from_diff(
|
|
|
327
346
|
print(result["commit_sha"])
|
|
328
347
|
```
|
|
329
348
|
|
|
330
|
-
`diff` accepts the same source types as the commit builder (string, bytes, async
|
|
349
|
+
`diff` accepts the same source types as the commit builder (string, bytes, async
|
|
350
|
+
iterator, etc.). The helper automatically streams the diff to the `/diff-commit`
|
|
351
|
+
endpoint and returns a `CommitResult`. On conflicts or validation errors, it
|
|
352
|
+
raises `RefUpdateError` with the server-provided status and message.
|
|
331
353
|
|
|
332
|
-
You can provide the same metadata options as `create_commit`, including
|
|
354
|
+
You can provide the same metadata options as `create_commit`, including
|
|
355
|
+
`expected_head_sha`, `base_branch`, `ephemeral`, `ephemeral_base`, and
|
|
356
|
+
`committer`.
|
|
333
357
|
|
|
334
|
-
> Files are chunked into 4 MiB segments, allowing streaming of large assets
|
|
358
|
+
> Files are chunked into 4 MiB segments, allowing streaming of large assets
|
|
359
|
+
> without buffering in memory.
|
|
335
360
|
|
|
336
|
-
> The `target_branch` must already exist on the remote repository. To seed an
|
|
361
|
+
> The `target_branch` must already exist on the remote repository. To seed an
|
|
362
|
+
> empty repository, omit `expected_head_sha`; the service will create the first
|
|
363
|
+
> commit only when no refs are present.
|
|
337
364
|
|
|
338
365
|
**Branching Example:**
|
|
339
366
|
|
|
@@ -353,7 +380,9 @@ result = await (
|
|
|
353
380
|
|
|
354
381
|
### Ephemeral Branches
|
|
355
382
|
|
|
356
|
-
Ephemeral branches are temporary branches that are stored in a separate
|
|
383
|
+
Ephemeral branches are temporary branches that are stored in a separate
|
|
384
|
+
namespace. They're useful for preview environments, temporary workspaces, or
|
|
385
|
+
short-lived feature branches that don't need to be permanent.
|
|
357
386
|
|
|
358
387
|
**Creating an ephemeral branch:**
|
|
359
388
|
|
|
@@ -424,9 +453,12 @@ print(result["target_branch"]) # "feature/awesome-change"
|
|
|
424
453
|
|
|
425
454
|
- Ephemeral branches are stored separately from regular branches
|
|
426
455
|
- Use `ephemeral=True` when creating commits, reading files, or listing files
|
|
427
|
-
- Use `ephemeral_base=True` when branching off another ephemeral branch
|
|
428
|
-
|
|
429
|
-
-
|
|
456
|
+
- Use `ephemeral_base=True` when branching off another ephemeral branch
|
|
457
|
+
(requires `base_branch`)
|
|
458
|
+
- Promote an ephemeral branch with `repo.promote_ephemeral_branch()`; omit
|
|
459
|
+
`target_branch` to keep the same name
|
|
460
|
+
- Ephemeral branches are ideal for temporary previews, CI/CD environments, or
|
|
461
|
+
experiments
|
|
430
462
|
|
|
431
463
|
### Streaming Large Files
|
|
432
464
|
|
|
@@ -476,9 +508,11 @@ commits = await repo.list_commits()
|
|
|
476
508
|
|
|
477
509
|
**How it works:**
|
|
478
510
|
|
|
479
|
-
1. When you create a repo with `base_repo`, Pierre links it to the specified
|
|
511
|
+
1. When you create a repo with `base_repo`, Pierre links it to the specified
|
|
512
|
+
GitHub repository
|
|
480
513
|
2. The `pull_upstream()` method fetches the latest changes from GitHub
|
|
481
|
-
3. You can then use all Pierre SDK features (diffs, commits, file access) on the
|
|
514
|
+
3. You can then use all Pierre SDK features (diffs, commits, file access) on the
|
|
515
|
+
synced content
|
|
482
516
|
4. The provider is automatically set to `"github"` when using `base_repo`
|
|
483
517
|
|
|
484
518
|
### Forking Repositories
|
|
@@ -564,6 +598,16 @@ class Repo:
|
|
|
564
598
|
ttl: Optional[int] = None,
|
|
565
599
|
) -> Response: ...
|
|
566
600
|
|
|
601
|
+
async def get_archive_stream(
|
|
602
|
+
self,
|
|
603
|
+
*,
|
|
604
|
+
ref: Optional[str] = None,
|
|
605
|
+
include_globs: Optional[List[str]] = None,
|
|
606
|
+
exclude_globs: Optional[List[str]] = None,
|
|
607
|
+
archive_prefix: Optional[str] = None,
|
|
608
|
+
ttl: Optional[int] = None,
|
|
609
|
+
) -> Response: ...
|
|
610
|
+
|
|
567
611
|
async def list_files(
|
|
568
612
|
self,
|
|
569
613
|
*,
|
|
@@ -724,17 +768,20 @@ else:
|
|
|
724
768
|
|
|
725
769
|
## Authentication
|
|
726
770
|
|
|
727
|
-
The SDK uses JWT (JSON Web Tokens) for authentication. When you call
|
|
771
|
+
The SDK uses JWT (JSON Web Tokens) for authentication. When you call
|
|
772
|
+
`get_remote_url()`, it:
|
|
728
773
|
|
|
729
774
|
1. Creates a JWT with your name, repository ID, and requested permissions
|
|
730
775
|
2. Signs it with your private key (ES256, RS256, or EdDSA)
|
|
731
776
|
3. Embeds it in the Git remote URL as the password
|
|
732
777
|
|
|
733
|
-
The generated URLs are compatible with standard Git clients and include all
|
|
778
|
+
The generated URLs are compatible with standard Git clients and include all
|
|
779
|
+
necessary authentication.
|
|
734
780
|
|
|
735
781
|
### Manual JWT Generation
|
|
736
782
|
|
|
737
|
-
For advanced use cases, you can generate JWTs manually using the `generate_jwt`
|
|
783
|
+
For advanced use cases, you can generate JWTs manually using the `generate_jwt`
|
|
784
|
+
helper:
|
|
738
785
|
|
|
739
786
|
```python
|
|
740
787
|
from pierre_storage import generate_jwt
|
|
@@ -761,11 +808,13 @@ git_url = f"https://t:{token}@your-name.code.storage/your-repo-id.git"
|
|
|
761
808
|
- `key_pem` (required): Private key in PEM format (PKCS8)
|
|
762
809
|
- `issuer` (required): Token issuer (your customer name)
|
|
763
810
|
- `repo_id` (required): Repository identifier
|
|
764
|
-
- `scopes` (optional): List of permission scopes. Defaults to
|
|
811
|
+
- `scopes` (optional): List of permission scopes. Defaults to
|
|
812
|
+
`["git:write", "git:read"]`
|
|
765
813
|
- Available scopes: `"git:read"`, `"git:write"`, `"repo:write"`
|
|
766
814
|
- `ttl` (optional): Time-to-live in seconds. Defaults to 31536000 (1 year)
|
|
767
815
|
|
|
768
|
-
The function automatically detects the key type (RSA, EC, or EdDSA) and uses the
|
|
816
|
+
The function automatically detects the key type (RSA, EC, or EdDSA) and uses the
|
|
817
|
+
appropriate signing algorithm (RS256, ES256, or EdDSA).
|
|
769
818
|
|
|
770
819
|
## Error Handling
|
|
771
820
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
pierre_storage/__init__.py,sha256=8t6r3VUY4MSZhSuBXaoxzuxd4FLRAbVLWFxXiC_fcQY,1905
|
|
2
|
+
pierre_storage/auth.py,sha256=aT0KNaUKa9fXERtQvJb8C6zL5IxrfA1KLxMBcprAq5A,2074
|
|
3
|
+
pierre_storage/client.py,sha256=FzX42isIjQO9SzONHkjTVpzaA6N8i5kcjM6c84aw_5w,15098
|
|
4
|
+
pierre_storage/commit.py,sha256=ks5hKScHHricJ3sx8DyLSAASM72CPmVv-tbtUgHbUF4,16766
|
|
5
|
+
pierre_storage/errors.py,sha256=-vuA2BUGwyDlErFtdh2boLdk0fDFDFYBEIohJk4AsIs,2184
|
|
6
|
+
pierre_storage/py.typed,sha256=8PjyZ1aVoQpRVvt71muvuq5qE-jTFZkK-GLHkhdebmc,26
|
|
7
|
+
pierre_storage/repo.py,sha256=5VesZSzoCbhOMN7C7C43mgL-Z5JkVbo4FaNBoZ2Uw8Y,46723
|
|
8
|
+
pierre_storage/types.py,sha256=yDdHX-QTWbUiwWpYWytMEchfk8WT33kJca6hVfo3uPA,15377
|
|
9
|
+
pierre_storage/version.py,sha256=02J7KBSNBg8Ecf2G68x6KSPBF5CdMnTCJthybrQ7etc,316
|
|
10
|
+
pierre_storage/webhook.py,sha256=hyjSmTlU_x35m612erXDqNXbLUh5i5As5GRw7kxylFc,7425
|
|
11
|
+
pierre_storage-1.0.1.dist-info/licenses/LICENSE,sha256=E9kr4Y1c6sUm8zzJa2kCoU0Wjz4dSxa-c48Ppw2n_pg,10899
|
|
12
|
+
pierre_storage-1.0.1.dist-info/METADATA,sha256=jKn9xrdwsRvFNcOW5dgLayGzLZKj7Nb3GZX1-kXHoHU,23935
|
|
13
|
+
pierre_storage-1.0.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
14
|
+
pierre_storage-1.0.1.dist-info/top_level.txt,sha256=RzcYFaSdETlcwX-45G9Q39xUgXWZLJEWcOiK0p6ZepY,15
|
|
15
|
+
pierre_storage-1.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
10
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by the
|
|
13
|
+
copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other
|
|
16
|
+
entities that control, are controlled by, or are under common control with
|
|
17
|
+
that entity. For the purposes of this definition, "control" means (i) the
|
|
18
|
+
power, direct or indirect, to cause the direction or management of such
|
|
19
|
+
entity, whether by contract or otherwise, or (ii) ownership of fifty percent
|
|
20
|
+
(50%) or more of the outstanding shares, or (iii) beneficial ownership of
|
|
21
|
+
such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
24
|
+
permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation source, and
|
|
28
|
+
configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical transformation
|
|
31
|
+
or translation of a Source form, including but not limited to compiled
|
|
32
|
+
object code, generated documentation, and conversions to other media types.
|
|
33
|
+
|
|
34
|
+
"Work" shall mean the work of authorship, whether in Source or Object form,
|
|
35
|
+
made available under the License, as indicated by a copyright notice that is
|
|
36
|
+
included in or attached to the work (an example is provided in the Appendix
|
|
37
|
+
below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object form,
|
|
40
|
+
that is based on (or derived from) the Work and for which the editorial
|
|
41
|
+
revisions, annotations, elaborations, or other modifications represent, as a
|
|
42
|
+
whole, an original work of authorship. For the purposes of this License,
|
|
43
|
+
Derivative Works shall not include works that remain separable from, or
|
|
44
|
+
merely link (or bind by name) to the interfaces of, the Work and Derivative
|
|
45
|
+
Works thereof.
|
|
46
|
+
|
|
47
|
+
"Contribution" shall mean any work of authorship, including the original
|
|
48
|
+
version of the Work and any modifications or additions to that Work or
|
|
49
|
+
Derivative Works thereof, that is intentionally submitted to Licensor for
|
|
50
|
+
inclusion in the Work by the copyright owner or by an individual or Legal
|
|
51
|
+
Entity authorized to submit on behalf of the copyright owner. For the
|
|
52
|
+
purposes of this definition, "submitted" means any form of electronic,
|
|
53
|
+
verbal, or written communication sent to the Licensor or its
|
|
54
|
+
representatives, including but not limited to communication on electronic
|
|
55
|
+
mailing lists, source code control systems, and issue tracking systems that
|
|
56
|
+
are managed by, or on behalf of, the Licensor for the purpose of discussing
|
|
57
|
+
and improving the Work, but excluding communication that is conspicuously
|
|
58
|
+
marked or otherwise designated in writing by the copyright owner as "Not a
|
|
59
|
+
Contribution."
|
|
60
|
+
|
|
61
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on
|
|
62
|
+
behalf of whom a Contribution has been received by Licensor and subsequently
|
|
63
|
+
incorporated within the Work.
|
|
64
|
+
|
|
65
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
66
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
67
|
+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
68
|
+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
|
69
|
+
sublicense, and distribute the Work and such Derivative Works in Source or
|
|
70
|
+
Object form.
|
|
71
|
+
|
|
72
|
+
3. Grant of Patent License. Subject to the terms and conditions of this
|
|
73
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
74
|
+
non-exclusive, no-charge, royalty-free, irrevocable (except as stated in
|
|
75
|
+
this section) patent license to make, have made, use, offer to sell, sell,
|
|
76
|
+
import, and otherwise transfer the Work, where such license applies only to
|
|
77
|
+
those patent claims licensable by such Contributor that are necessarily
|
|
78
|
+
infringed by their Contribution(s) alone or by combination of their
|
|
79
|
+
Contribution(s) with the Work to which such Contribution(s) was submitted.
|
|
80
|
+
If You institute patent litigation against any entity (including a
|
|
81
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
|
|
82
|
+
Contribution incorporated within the Work constitutes direct or contributory
|
|
83
|
+
patent infringement, then any patent licenses granted to You under this
|
|
84
|
+
License for that Work shall terminate as of the date such litigation is
|
|
85
|
+
filed.
|
|
86
|
+
|
|
87
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
88
|
+
Derivative Works thereof in any medium, with or without modifications, and
|
|
89
|
+
in Source or Object form, provided that You meet the following conditions:
|
|
90
|
+
|
|
91
|
+
(a) You must give any other recipients of the Work or Derivative Works a
|
|
92
|
+
copy of this License; and
|
|
93
|
+
|
|
94
|
+
(b) You must cause any modified files to carry prominent notices stating
|
|
95
|
+
that You changed the files; and
|
|
96
|
+
|
|
97
|
+
(c) You must retain, in the Source form of any Derivative Works that You
|
|
98
|
+
distribute, all copyright, patent, trademark, and attribution notices from
|
|
99
|
+
the Source form of the Work, excluding those notices that do not pertain to
|
|
100
|
+
any part of the Derivative Works; and
|
|
101
|
+
|
|
102
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution,
|
|
103
|
+
then any Derivative Works that You distribute must include a readable copy
|
|
104
|
+
of the attribution notices contained within such NOTICE file, excluding
|
|
105
|
+
those notices that do not pertain to any part of the Derivative Works, in at
|
|
106
|
+
least one of the following places: within a NOTICE text file distributed as
|
|
107
|
+
part of the Derivative Works; within the Source form or documentation, if
|
|
108
|
+
provided along with the Derivative Works; or, within a display generated by
|
|
109
|
+
the Derivative Works, if and wherever such third-party notices normally
|
|
110
|
+
appear. The contents of the NOTICE file are for informational purposes only
|
|
111
|
+
and do not modify the License. You may add Your own attribution notices
|
|
112
|
+
within Derivative Works that You distribute, alongside or as an addendum to
|
|
113
|
+
the NOTICE text from the Work, provided that such additional attribution
|
|
114
|
+
notices cannot be construed as modifying the License.
|
|
115
|
+
|
|
116
|
+
You may add Your own copyright statement to Your modifications and may
|
|
117
|
+
provide additional or different license terms and conditions for use,
|
|
118
|
+
reproduction, or distribution of Your modifications, or for any such
|
|
119
|
+
Derivative Works as a whole, provided Your use, reproduction, and
|
|
120
|
+
distribution of the Work otherwise complies with the conditions stated in
|
|
121
|
+
this License.
|
|
122
|
+
|
|
123
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
124
|
+
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
125
|
+
Licensor shall be under the terms and conditions of this License, without
|
|
126
|
+
any additional terms or conditions. Notwithstanding the above, nothing
|
|
127
|
+
herein shall supersede or modify the terms of any separate license agreement
|
|
128
|
+
you may have executed with Licensor regarding such Contributions.
|
|
129
|
+
|
|
130
|
+
6. Trademarks. This License does not grant permission to use the trade names,
|
|
131
|
+
trademarks, service marks, or product names of the Licensor, except as
|
|
132
|
+
required for reasonable and customary use in describing the origin of the
|
|
133
|
+
Work and reproducing the content of the NOTICE file.
|
|
134
|
+
|
|
135
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
136
|
+
writing, Licensor provides the Work (and each Contributor provides its
|
|
137
|
+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
138
|
+
KIND, either express or implied, including, without limitation, any
|
|
139
|
+
warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or
|
|
140
|
+
FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining
|
|
141
|
+
the appropriateness of using or redistributing the Work and assume any risks
|
|
142
|
+
associated with Your exercise of permissions under this License.
|
|
143
|
+
|
|
144
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
145
|
+
tort (including negligence), contract, or otherwise, unless required by
|
|
146
|
+
applicable law (such as deliberate and grossly negligent acts) or agreed to
|
|
147
|
+
in writing, shall any Contributor be liable to You for damages, including
|
|
148
|
+
any direct, indirect, special, incidental, or consequential damages of any
|
|
149
|
+
character arising as a result of this License or out of the use or inability
|
|
150
|
+
to use the Work (including but not limited to damages for loss of goodwill,
|
|
151
|
+
work stoppage, computer failure or malfunction, or any and all other
|
|
152
|
+
commercial damages or losses), even if such Contributor has been advised of
|
|
153
|
+
the possibility of such damages.
|
|
154
|
+
|
|
155
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or
|
|
156
|
+
Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
157
|
+
acceptance of support, warranty, indemnity, or other liability obligations
|
|
158
|
+
and/or rights consistent with this License. However, in accepting such
|
|
159
|
+
obligations, You may act only on Your own behalf and on Your sole
|
|
160
|
+
responsibility, not on behalf of any other Contributor, and only if You
|
|
161
|
+
agree to indemnify, defend, and hold each Contributor harmless for any
|
|
162
|
+
liability incurred by, or claims asserted against, such Contributor by
|
|
163
|
+
reason of your accepting any such warranty or additional liability.
|
|
164
|
+
|
|
165
|
+
END OF TERMS AND CONDITIONS
|
|
166
|
+
|
|
167
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
168
|
+
|
|
169
|
+
To apply the Apache License to your work, attach the following
|
|
170
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
171
|
+
replaced with your own identifying information. (Don't include
|
|
172
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
173
|
+
comment syntax for the file format. We also recommend that a
|
|
174
|
+
file or class name and description of purpose be included on the
|
|
175
|
+
same "printed page" as the copyright notice for easier
|
|
176
|
+
identification within third-party archives.
|
|
177
|
+
|
|
178
|
+
Copyright 2025 Pierre Computer Company
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
181
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
182
|
+
License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
187
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
188
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
189
|
+
specific language governing permissions and limitations under the License.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
pierre_storage/__init__.py,sha256=8t6r3VUY4MSZhSuBXaoxzuxd4FLRAbVLWFxXiC_fcQY,1905
|
|
2
|
-
pierre_storage/auth.py,sha256=aT0KNaUKa9fXERtQvJb8C6zL5IxrfA1KLxMBcprAq5A,2074
|
|
3
|
-
pierre_storage/client.py,sha256=FVUB-r1Oxr112nFAXPEo_rpkGVFdxYvu_NpBXh8aclI,14908
|
|
4
|
-
pierre_storage/commit.py,sha256=ks5hKScHHricJ3sx8DyLSAASM72CPmVv-tbtUgHbUF4,16766
|
|
5
|
-
pierre_storage/errors.py,sha256=-vuA2BUGwyDlErFtdh2boLdk0fDFDFYBEIohJk4AsIs,2184
|
|
6
|
-
pierre_storage/py.typed,sha256=8PjyZ1aVoQpRVvt71muvuq5qE-jTFZkK-GLHkhdebmc,26
|
|
7
|
-
pierre_storage/repo.py,sha256=wnTDVtHx9v8tJTHJ9cHJs8cn5dImsCA3M3xxx7RqhS8,44117
|
|
8
|
-
pierre_storage/types.py,sha256=9THfT19hM_qEkozdNH5qhiL34_USubSGIRFHUw8HY9E,14661
|
|
9
|
-
pierre_storage/version.py,sha256=L7upS30suP-fz3rFGhpCsKcU2OKkpynrjqNIfdNDhFc,316
|
|
10
|
-
pierre_storage/webhook.py,sha256=hyjSmTlU_x35m612erXDqNXbLUh5i5As5GRw7kxylFc,7425
|
|
11
|
-
pierre_storage-0.12.1.dist-info/licenses/LICENSE,sha256=CFzxoMyurfMUB0u0RaXBFZ6IDeUd6FQhKrLR_IeXtuU,1063
|
|
12
|
-
pierre_storage-0.12.1.dist-info/METADATA,sha256=r1wvmVRSZsARL6StuI8cLWRz5b7KYbQByBjEnmv7MXk,23306
|
|
13
|
-
pierre_storage-0.12.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
14
|
-
pierre_storage-0.12.1.dist-info/top_level.txt,sha256=RzcYFaSdETlcwX-45G9Q39xUgXWZLJEWcOiK0p6ZepY,15
|
|
15
|
-
pierre_storage-0.12.1.dist-info/RECORD,,
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Pierre
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
File without changes
|
|
File without changes
|