Fix of a bug in jeb_utils.jeb_utils.validate_topic_name
This commit is contained in:
@@ -77,8 +77,11 @@ pip install jeb-utils --index-url https://jcloud-services.ddns.net/simple/ --ext
|
|||||||
- `create_file_if_not_exists`: Creates a file if it does not exist.
|
- `create_file_if_not_exists`: Creates a file if it does not exist.
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
### Version 0.1.3
|
||||||
|
- Fatal bug fix: `jeb_utils.jeb_utils.validate_topic_name` has not returned `True` if the topic name is valid, it returned `None` (falsy). Now it returns `True` if the topic name is valid.
|
||||||
|
|
||||||
### Version 0.1.2
|
### Version 0.1.2
|
||||||
- Bug fix: `jeb_utils.mktopicpart` tried to raise `jeb_utils.exceptions.exceptions.TopicNotFoundError` instead of `jeb_utils.exceptions.TopicNotFoundError` if the topic does not exist.
|
- Bug fix: `jeb_utils.mktopicpart` has tried to raise `jeb_utils.exceptions.exceptions.TopicNotFoundError` instead of `jeb_utils.exceptions.TopicNotFoundError` if the topic does not exist.
|
||||||
|
|
||||||
### Version 0.1.1
|
### Version 0.1.1
|
||||||
- Support for custom data paths (`jeb_utils.init`)
|
- Support for custom data paths (`jeb_utils.init`)
|
||||||
|
|||||||
+1
-1
@@ -4,6 +4,6 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "jeb-utils"
|
name = "jeb-utils"
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
description = "Common utils for JEB client and server."
|
description = "Common utils for JEB client and server."
|
||||||
dependencies = ["cryptography"]
|
dependencies = ["cryptography"]
|
||||||
@@ -296,6 +296,8 @@ def validate_topic_name(topic_name: str) -> bool:
|
|||||||
|
|
||||||
if topic_name.startswith('.') or topic_name.endswith('.') or topic_name.startswith('..') or topic_name.endswith('..'):
|
if topic_name.startswith('.') or topic_name.endswith('.') or topic_name.startswith('..') or topic_name.endswith('..'):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
def validate_topic_format(topic: str):
|
def validate_topic_format(topic: str):
|
||||||
if topic.count(TOPIC_PARTITION_SEPARATOR) != 1:
|
if topic.count(TOPIC_PARTITION_SEPARATOR) != 1:
|
||||||
|
|||||||
Reference in New Issue
Block a user