Skip to content

Commit 1d44114

Browse files
committed
fix: change ulid regex to validate correct range
1 parent 21c4eae commit 1d44114

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:
@@ -177,7 +177,7 @@ paths:
177177
name: storage_id
178178
required: true
179179
schema:
180-
$ref: "#/components/schemas/UlidId"
180+
$ref: "#/components/schemas/Ulid"
181181
description: the id of the storage
182182
get:
183183
summary: get cloud storage details
@@ -386,7 +386,7 @@ components:
386386
project_id:
387387
oneOf:
388388
- $ref: "#/components/schemas/GitlabProjectId"
389-
- $ref: "#/components/schemas/UlidId"
389+
- $ref: "#/components/schemas/Ulid"
390390
required:
391391
- project_id
392392
example:
@@ -468,7 +468,7 @@ components:
468468
project_id:
469469
oneOf:
470470
- $ref: "#/components/schemas/GitlabProjectId"
471-
- $ref: "#/components/schemas/UlidId"
471+
- $ref: "#/components/schemas/Ulid"
472472
storage_type:
473473
$ref: "#/components/schemas/StorageType"
474474
name:
@@ -492,7 +492,7 @@ components:
492492
- storage_id
493493
properties:
494494
storage_id:
495-
$ref: "#/components/schemas/UlidId"
495+
$ref: "#/components/schemas/Ulid"
496496
CloudStorageGet:
497497
type: object
498498
description: Get response for a cloud storage. Contains storage and information about fields that are required if the storage is private.
@@ -640,12 +640,12 @@ components:
640640
type: string
641641
description: data type of option value. RClone has more options but they map to the ones listed here.
642642
enum: ["int", "bool", "string", "Time"]
643-
UlidId:
644-
description: ULID identifier of an object
643+
Ulid:
644+
description: ULID identifier
645645
type: string
646646
minLength: 26
647647
maxLength: 26
648-
pattern: "^[A-Z0-9]+$"
648+
pattern: "^[0-7][0-9A-HJKMNP-TV-Z]{25}$" # This is case-insensitive
649649
GitlabProjectId:
650650
description: Project id of a gitlab project (only int project id allowed, encoded as string for future-proofing)
651651
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 ProjectId(BaseAPISpec):
157-
project_id: Union[GitlabProjectId, UlidId]
157+
project_id: Union[GitlabProjectId, Ulid]
158158

159159

160160
class CloudStorageUrl(ProjectId):
@@ -197,7 +197,7 @@ class CloudStorage(ProjectId):
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)