gcp-platforms-auto 0.7.7__py3-none-any.whl → 0.7.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gcp_platforms_auto/models.py +35 -0
- {gcp_platforms_auto-0.7.7.dist-info → gcp_platforms_auto-0.7.8.dist-info}/METADATA +2 -1
- {gcp_platforms_auto-0.7.7.dist-info → gcp_platforms_auto-0.7.8.dist-info}/RECORD +5 -4
- {gcp_platforms_auto-0.7.7.dist-info → gcp_platforms_auto-0.7.8.dist-info}/WHEEL +0 -0
- {gcp_platforms_auto-0.7.7.dist-info → gcp_platforms_auto-0.7.8.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from pydantic import (
|
|
3
|
+
BaseModel,
|
|
4
|
+
ValueError,
|
|
5
|
+
field_validator,
|
|
6
|
+
)
|
|
7
|
+
from google.cloud import logging as cloud_logging
|
|
8
|
+
import re
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# Set up Google Cloud Logging
|
|
12
|
+
gcp_client = cloud_logging.Client()
|
|
13
|
+
gcp_client.setup_logging()
|
|
14
|
+
|
|
15
|
+
# Configure the logger
|
|
16
|
+
logger = logging.getLogger("uvicorn")
|
|
17
|
+
logger.setLevel(logging.INFO)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class RequesterModel(BaseModel):
|
|
21
|
+
email: str
|
|
22
|
+
|
|
23
|
+
@field_validator("email")
|
|
24
|
+
@classmethod
|
|
25
|
+
def validate_email(cls, v: str) -> str:
|
|
26
|
+
logger.info("validating requester email")
|
|
27
|
+
|
|
28
|
+
# Basic email validation
|
|
29
|
+
email_pattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'
|
|
30
|
+
if not re.match(email_pattern, v):
|
|
31
|
+
logger.error("invalid email format")
|
|
32
|
+
raise ValueError("invalid email format")
|
|
33
|
+
|
|
34
|
+
logger.info(f"validated requester email: {v}")
|
|
35
|
+
return v
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gcp_platforms_auto
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.8
|
|
4
4
|
Summary: A brief description of your package
|
|
5
5
|
Author-email: ofir4858 <ofirshasha10@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -17,5 +17,6 @@ Requires-Dist: google-cloud-resource-manager
|
|
|
17
17
|
Requires-Dist: gitpython
|
|
18
18
|
Requires-Dist: sqlalchemy
|
|
19
19
|
Requires-Dist: pg8000
|
|
20
|
+
Requires-Dist: pydantic
|
|
20
21
|
|
|
21
22
|
# gcp_sdk
|
|
@@ -2,7 +2,8 @@ gcp_platforms_auto/__init__.py,sha256=lxzogGyaV44AUl6WVElBOZNlr_gpWLvppZew7QDr1p
|
|
|
2
2
|
gcp_platforms_auto/db.py,sha256=jE5nwmqVHcxT4m6-meUgUz4V4DM8M_sMmeTpvKr2Z2Y,8768
|
|
3
3
|
gcp_platforms_auto/git.py,sha256=NnLDfRzzrzbm9yekepc-qgu8ejYmjNxQ4VDlW46gG2o,5508
|
|
4
4
|
gcp_platforms_auto/iam.py,sha256=zMABOcwhPTCEpwQd1Atm5ccd3-6jOLHPSDJUDq9YuFE,7687
|
|
5
|
-
gcp_platforms_auto
|
|
6
|
-
gcp_platforms_auto-0.7.
|
|
7
|
-
gcp_platforms_auto-0.7.
|
|
8
|
-
gcp_platforms_auto-0.7.
|
|
5
|
+
gcp_platforms_auto/models.py,sha256=ETU5bt6Ge_ZKJ8sOCCM9kb5cJNb1GyXBgfgi0H_1OAo,869
|
|
6
|
+
gcp_platforms_auto-0.7.8.dist-info/METADATA,sha256=hyus_I5wDNQqCQYHIm90wyGX7XxohnF3Z_m2Ib3vDdY,645
|
|
7
|
+
gcp_platforms_auto-0.7.8.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
8
|
+
gcp_platforms_auto-0.7.8.dist-info/top_level.txt,sha256=4q-ofPMmvBaTnIbAzs-Wp_OwheAVxxmJ1fW9vl3-kyE,19
|
|
9
|
+
gcp_platforms_auto-0.7.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|