Skip to content

Commit 8c8068c

Browse files
committed
fix: change ulid regex to validate correct range
1 parent 17907b7 commit 8c8068c

File tree

8 files changed

+25
-25
lines changed

8 files changed

+25
-25
lines changed

components/renku_data_services/connected_services/apispec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: api.spec.yaml
3-
# timestamp: 2024-08-13T13:29:50+00:00
3+
# timestamp: 2024-08-12T06:46:18+00:00
44

55
from __future__ import annotations
66

components/renku_data_services/namespace/apispec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: api.spec.yaml
3-
# timestamp: 2024-08-13T13:29:48+00:00
3+
# timestamp: 2024-08-12T06:46:16+00:00
44

55
from __future__ import annotations
66

components/renku_data_services/project/apispec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: api.spec.yaml
3-
# timestamp: 2024-08-13T13:29:47+00:00
3+
# timestamp: 2024-08-12T06:46:15+00:00
44

55
from __future__ import annotations
66

components/renku_data_services/repositories/apispec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: api.spec.yaml
3-
# timestamp: 2024-08-13T13:29:50+00:00
3+
# timestamp: 2024-08-12T06:46:19+00:00
44

55
from __future__ import annotations
66

components/renku_data_services/secrets/apispec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: api.spec.yaml
3-
# timestamp: 2024-08-13T13:29:49+00:00
3+
# timestamp: 2024-08-12T06:46:17+00:00
44

55
from __future__ import annotations
66

components/renku_data_services/storage/api.spec.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ paths:
1616
name: storage_id
1717
required: true
1818
schema:
19-
$ref: "#/components/schemas/UlidId"
19+
$ref: "#/components/schemas/Ulid"
2020
description: the id of the storage
2121
get:
2222
summary: get cloud storage details
@@ -73,7 +73,7 @@ paths:
7373
additionalProperties: false
7474
properties:
7575
project_id:
76-
$ref: "#/components/schemas/UlidId"
76+
$ref: "#/components/schemas/Ulid"
7777
required:
7878
- project_id
7979
responses:
@@ -122,7 +122,7 @@ paths:
122122
name: storage_id
123123
required: true
124124
schema:
125-
$ref: "#/components/schemas/UlidId"
125+
$ref: "#/components/schemas/Ulid"
126126
description: the id of the storage
127127
get:
128128
summary: get cloud storage details
@@ -331,7 +331,7 @@ components:
331331
project_id:
332332
oneOf:
333333
- $ref: "#/components/schemas/GitlabProjectId"
334-
- $ref: "#/components/schemas/UlidId"
334+
- $ref: "#/components/schemas/Ulid"
335335
required:
336336
- project_id
337337
example:
@@ -413,7 +413,7 @@ components:
413413
project_id:
414414
oneOf:
415415
- $ref: "#/components/schemas/GitlabProjectId"
416-
- $ref: "#/components/schemas/UlidId"
416+
- $ref: "#/components/schemas/Ulid"
417417
storage_type:
418418
$ref: "#/components/schemas/StorageType"
419419
name:
@@ -437,7 +437,7 @@ components:
437437
- storage_id
438438
properties:
439439
storage_id:
440-
$ref: "#/components/schemas/UlidId"
440+
$ref: "#/components/schemas/Ulid"
441441
CloudStorageGet:
442442
type: object
443443
description: Get response for a cloud storage. Contains storage and information about fields that are required if the storage is private.
@@ -532,12 +532,12 @@ components:
532532
type: string
533533
description: data type of option value. RClone has more options but they map to the ones listed here.
534534
enum: ["int", "bool", "string", "Time"]
535-
UlidId:
536-
description: ULID identifier of an object
535+
Ulid:
536+
description: ULID identifier
537537
type: string
538538
minLength: 26
539539
maxLength: 26
540-
pattern: "^[A-Z0-9]+$"
540+
pattern: "^[0-7][0-9A-HJKMNP-TV-Z]{25}$" # This is case-insensitive
541541
GitlabProjectId:
542542
description: Project id of a gitlab project (only int project id allowed, encoded as string for future-proofing)
543543
type: string

components/renku_data_services/storage/apispec.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: api.spec.yaml
3-
# timestamp: 2024-08-09T12:39:58+00:00
3+
# timestamp: 2024-08-12T07:20:07+00:00
44

55
from __future__ import annotations
66

@@ -76,13 +76,13 @@ class RCloneOption(BaseAPISpec):
7676
)
7777

7878

79-
class UlidId(RootModel[str]):
79+
class Ulid(RootModel[str]):
8080
root: str = Field(
8181
...,
82-
description="ULID identifier of an object",
82+
description="ULID identifier",
8383
max_length=26,
8484
min_length=26,
85-
pattern="^[A-Z0-9]+$",
85+
pattern="^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
8686
)
8787

8888

@@ -113,10 +113,10 @@ class StorageV2Params(BaseAPISpec):
113113
)
114114
project_id: str = Field(
115115
...,
116-
description="ULID identifier of an object",
116+
description="ULID identifier",
117117
max_length=26,
118118
min_length=26,
119-
pattern="^[A-Z0-9]+$",
119+
pattern="^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
120120
)
121121

122122

@@ -154,7 +154,7 @@ class StorageSchemaObscurePostRequest(BaseAPISpec):
154154

155155

156156
class GitRequest(BaseAPISpec):
157-
project_id: Union[GitlabProjectId, UlidId]
157+
project_id: Union[GitlabProjectId, Ulid]
158158

159159

160160
class CloudStorageUrl(GitRequest):
@@ -197,7 +197,7 @@ class CloudStorage(GitRequest):
197197

198198

199199
class CloudStoragePatch(BaseAPISpec):
200-
project_id: Optional[Union[GitlabProjectId, UlidId]] = None
200+
project_id: Optional[Union[GitlabProjectId, Ulid]] = None
201201
storage_type: Optional[str] = Field(
202202
None,
203203
description="same as rclone prefix/ rclone config type. Ignored in requests, but returned in responses for convenience.",
@@ -229,10 +229,10 @@ class CloudStoragePatch(BaseAPISpec):
229229
class CloudStorageWithId(CloudStorage):
230230
storage_id: str = Field(
231231
...,
232-
description="ULID identifier of an object",
232+
description="ULID identifier",
233233
max_length=26,
234234
min_length=26,
235-
pattern="^[A-Z0-9]+$",
235+
pattern="^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
236236
)
237237

238238

components/renku_data_services/users/apispec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: api.spec.yaml
3-
# timestamp: 2024-08-13T13:29:47+00:00
3+
# timestamp: 2024-08-12T06:46:14+00:00
44

55
from __future__ import annotations
66

0 commit comments

Comments
 (0)