Skip to content

Commit

Permalink
Allow colon characters in bucket names
Browse files Browse the repository at this point in the history
  • Loading branch information
lkuchenb committed Nov 19, 2024
1 parent 9cd407f commit 12bc411
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pyproject_generation/pyproject_custom.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "hexkit"
version = "4.0.0"
version = "4.1.0"
description = "A Toolkit for Building Microservices using the Hexagonal Architecture"
requires-python = ">=3.9"
classifiers = [
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ classifiers = [
"Intended Audience :: Developers",
]
name = "hexkit"
version = "4.0.0"
version = "4.1.0"
description = "A Toolkit for Building Microservices using the Hexagonal Architecture"
dependencies = [
"pydantic >=2, <3",
Expand Down
2 changes: 1 addition & 1 deletion src/hexkit/protocols/objstorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ async def _delete_object(self, *, bucket_id: str, object_id: str) -> None:
# (is typically only used by the protocol but may also be used in
# provider-specific code or overwritten by the provider)

_re_bucket_id = re.compile(r"^[a-z0-9\-]{3,63}$")
_re_bucket_id = re.compile(r"^[:a-z0-9\-]{3,63}$")
_re_bucket_id_msg = "must consist of 3-63 lowercase letters, digits or hyphens"

@classmethod
Expand Down
4 changes: 4 additions & 0 deletions src/hexkit/providers/s3/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# ruff: noqa: PLR0913

import asyncio
import re
from functools import lru_cache
from pathlib import Path
from typing import Any, Optional
Expand All @@ -31,6 +32,7 @@
import botocore.config
import botocore.configloader
import botocore.exceptions
import botocore.handlers
from boto3.s3.transfer import TransferConfig
from pydantic import Field, SecretStr
from pydantic_settings import BaseSettings
Expand All @@ -39,6 +41,8 @@
from hexkit.utils import calc_part_size

__all__ = ["ObjectStorageProtocol", "PresignedPostURL"]
# Allow colon character in bucket names to accommodate Ceph multi tenancy S3
botocore.handlers.VALID_BUCKET = re.compile(r"^[:a-zA-Z0-9.\-_]{1,255}$")


class S3Config(BaseSettings):
Expand Down

0 comments on commit 12bc411

Please sign in to comment.