Skip to content

Commit

Permalink
fix ulid regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius committed Aug 13, 2024
1 parent a4ee522 commit dab2f8e
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion bases/renku_data_services/data_api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

def register_all_handlers(app: Sanic, config: Config) -> Sanic:
"""Register all handlers on the application."""
app.router.register_pattern("ulid", ULID.from_str, r"^[0-9A-HJKMNP-TV-Z]{26}$")
app.router.register_pattern("ulid", ULID.from_str, r"^[0-7][0-9A-HJKMNP-TV-Z]{25}$")
app.router.register_pattern("renku_slug", str, r"^[a-zA-Z0-9][a-zA-Z0-9\-_.]*$")

url_prefix = "/api/data"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ components:
type: string
minLength: 26
maxLength: 26
pattern: "^[A-Z0-9]{26}$" # This is case-insensitive
pattern: "^[0-7][0-9A-HJKMNP-TV-Z]{25}$" # This is case-insensitive
ProviderId:
description: ID of a OAuth2 provider, e.g. "gitlab.com".
type: string
Expand Down
4 changes: 2 additions & 2 deletions components/renku_data_services/connected_services/apispec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: api.spec.yaml
# timestamp: 2024-08-06T05:55:35+00:00
# timestamp: 2024-08-13T13:29:50+00:00

from __future__ import annotations

Expand Down Expand Up @@ -153,7 +153,7 @@ class Connection(BaseAPISpec):
description="ULID identifier",
max_length=26,
min_length=26,
pattern="^[A-Z0-9]{26}$",
pattern="^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
)
provider_id: str = Field(
...,
Expand Down
2 changes: 1 addition & 1 deletion components/renku_data_services/crc/apispec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: api.spec.yaml
# timestamp: 2024-08-07T07:12:13+00:00
# timestamp: 2024-08-13T13:29:45+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion components/renku_data_services/namespace/api.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ components:
type: string
minLength: 26
maxLength: 26
pattern: "^[A-Z0-9]{26}$" # This is case-insensitive
pattern: "^[0-7][0-9A-HJKMNP-TV-Z]{25}$" # This is case-insensitive
NamespaceName:
description: Renku group or namespace name
type: string
Expand Down
6 changes: 3 additions & 3 deletions components/renku_data_services/namespace/apispec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: api.spec.yaml
# timestamp: 2024-08-06T08:46:00+00:00
# timestamp: 2024-08-13T13:29:48+00:00

from __future__ import annotations

Expand Down Expand Up @@ -29,7 +29,7 @@ class NamespaceResponse(BaseAPISpec):
description="ULID identifier",
max_length=26,
min_length=26,
pattern="^[A-Z0-9]{26}$",
pattern="^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
)
name: Optional[str] = Field(
None,
Expand Down Expand Up @@ -93,7 +93,7 @@ class GroupResponse(BaseAPISpec):
description="ULID identifier",
max_length=26,
min_length=26,
pattern="^[A-Z0-9]{26}$",
pattern="^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
)
name: str = Field(
...,
Expand Down
2 changes: 1 addition & 1 deletion components/renku_data_services/notebooks/apispec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: api.spec.yaml
# timestamp: 2024-08-06T05:55:38+00:00
# timestamp: 2024-08-13T13:29:51+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion components/renku_data_services/platform/apispec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: api.spec.yaml
# timestamp: 2024-08-06T05:55:39+00:00
# timestamp: 2024-08-13T13:29:52+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion components/renku_data_services/project/api.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ components:
type: string
minLength: 26
maxLength: 26
pattern: "^[A-Z0-9]{26}$" # This is case-insensitive
pattern: "^[0-7][0-9A-HJKMNP-TV-Z]{25}$" # This is case-insensitive
ProjectName:
description: Renku project name
type: string
Expand Down
4 changes: 2 additions & 2 deletions components/renku_data_services/project/apispec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: api.spec.yaml
# timestamp: 2024-08-06T05:55:31+00:00
# timestamp: 2024-08-13T13:29:47+00:00

from __future__ import annotations

Expand Down Expand Up @@ -112,7 +112,7 @@ class Project(BaseAPISpec):
description="ULID identifier",
max_length=26,
min_length=26,
pattern="^[A-Z0-9]{26}$",
pattern="^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
)
name: str = Field(
...,
Expand Down
2 changes: 1 addition & 1 deletion components/renku_data_services/repositories/api.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ components:
type: string
minLength: 26
maxLength: 26
pattern: "^[A-Z0-9]{26}$" # This is case-insensitive
pattern: "^[0-7][0-9A-HJKMNP-TV-Z]{25}$" # This is case-insensitive
ProviderId:
description: ID of a OAuth2 provider, e.g. "gitlab.com".
type: string
Expand Down
4 changes: 2 additions & 2 deletions components/renku_data_services/repositories/apispec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: api.spec.yaml
# timestamp: 2024-08-06T05:55:37+00:00
# timestamp: 2024-08-13T13:29:50+00:00

from __future__ import annotations

Expand Down Expand Up @@ -61,6 +61,6 @@ class RepositoryProviderMatch(BaseAPISpec):
description="ULID identifier",
max_length=26,
min_length=26,
pattern="^[A-Z0-9]{26}$",
pattern="^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
)
repository_metadata: Optional[RepositoryMetadata] = None
2 changes: 1 addition & 1 deletion components/renku_data_services/secrets/api.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ components:
type: string
minLength: 26
maxLength: 26
pattern: "^[A-Z0-9]{26}$" # This is case-insensitive
pattern: "^[0-7][0-9A-HJKMNP-TV-Z]{25}$" # This is case-insensitive
ErrorResponse:
type: object
properties:
Expand Down
4 changes: 2 additions & 2 deletions components/renku_data_services/secrets/apispec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: api.spec.yaml
# timestamp: 2024-08-06T05:55:34+00:00
# timestamp: 2024-08-13T13:29:49+00:00

from __future__ import annotations

Expand All @@ -20,7 +20,7 @@ class Ulid(RootModel[str]):
description="ULID identifier",
max_length=26,
min_length=26,
pattern="^[A-Z0-9]{26}$",
pattern="^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
)


Expand Down
2 changes: 1 addition & 1 deletion components/renku_data_services/session/api.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ components:
type: string
minLength: 26
maxLength: 26
pattern: "^[A-Z0-9]{26}$" # This is case-insensitive
pattern: "^[0-7][0-9A-HJKMNP-TV-Z]{25}$" # This is case-insensitive
SessionName:
description: Renku session name
type: string
Expand Down
2 changes: 1 addition & 1 deletion components/renku_data_services/storage/apispec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: api.spec.yaml
# timestamp: 2024-08-06T05:55:29+00:00
# timestamp: 2024-08-13T13:29:46+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion components/renku_data_services/users/api.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ components:
type: string
minLength: 26
maxLength: 26
pattern: "^[A-Z0-9]{26}$" # This is case-insensitive
pattern: "^[0-7][0-9A-HJKMNP-TV-Z]{25}$" # This is case-insensitive
ModificationDate:
description: The date and time the secret was created or modified (this is always in UTC)
type: string
Expand Down
4 changes: 2 additions & 2 deletions components/renku_data_services/users/apispec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: api.spec.yaml
# timestamp: 2024-08-06T11:43:01+00:00
# timestamp: 2024-08-13T13:29:47+00:00

from __future__ import annotations

Expand Down Expand Up @@ -149,7 +149,7 @@ class SecretWithId(BaseAPISpec):
description="ULID identifier",
max_length=26,
min_length=26,
pattern="^[A-Z0-9]{26}$",
pattern="^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
)
name: str = Field(
...,
Expand Down

0 comments on commit dab2f8e

Please sign in to comment.