Squashed 'utils_v2/' changes from f03179d..2b9fdb1
2b9fdb1 (20250620) Minor upgrade to the SMS sending util. 6eb94a1 Merge commit '3dcc80e729011d6ee58e3af70b677f3fd9659c7a' as 'utils_v2' dbcc5b8 Resetting utils subtree. d1c0ce2 (20250614) Ready for deployment with the UI. 584dbfc (20250613) Cert expiry checker now takes io.BytesIO buffers also 8eb8cc0 Merge commit 'f6e7755b2f536bd6a6ba719dd190b69fffb2c3ad' as 'utils_v2' b3748f1 Resetting utils subtree. 00b5aa0 Merge commit 'b53ef86ef83302f2663e591baf8e52b9de3caa58' as 'utils_v2' b53ef86 Squashed 'utils_v2/' content from commit 7f27356 65cceb1 Resetting utils subtree. 9e8a4d6 Merge commit '26158fbca60a548a81a19ebf046842c297b7366b' as 'utils_v2' 26158fb Squashed 'utils_v2/' content from commit 7f27356 6f510c3 Resetting utils subtree. 94a2544 (20250528) Trying not to wait for API-level logging. 5051f73 (20241226) Started working on the server management system. 7607a42 (20241225) Small changes in Async Mongo. 1fd2879 (20241225) Work started on upgrades and server-registration module. 053e2c4 (20241225) Small fix in reconnection attempts for MySQL. d096785 Merge commit 'cf354c722a56c2db220df96adaf6ad45fd343f40' as 'utils_v2' cf354c7 Squashed 'utils_v2/' content from commit 3be5145 b96958f (20241119) Requirements added. 1ffd451 Merge commit 'f32ee8c9af77d79b71756298898bf95d9a43f99f' as 'utils_v2' f32ee8c Squashed 'utils_v2/' content from commit 13ad158 f358a99 Resetting utils subtree. 5c00496 (20241119) Trying it on WTT. 3583c17 (20241010) 50% ready to use. 52b02e0 Merge commit '9ee1467d11386139626e32681ea4c948584321b1' as 'utils_v2' 9ee1467 Squashed 'utils_v2/' content from commit ef9630d 4bb085c (20240930) Adding pages... 15583af (20240930) Let's begin! git-subtree-dir: utils_v2 git-subtree-split: 2b9fdb1c991ddfe1bd239b3a46f118ec39886897
This commit is contained in:
@@ -199,6 +199,7 @@ class AsyncNimbusSMS:
|
||||
|
||||
# Construct the basic structure of the response of this method:
|
||||
summary = SentSMSMessageModel(
|
||||
client = "nimbusSmsIndia",
|
||||
sender = {"senderId": self.__sender_id},
|
||||
recipient = {"recipientNo": recipient_number},
|
||||
text = message,
|
||||
|
||||
@@ -79,6 +79,11 @@ import datetime
|
||||
|
||||
class SentSMSMessageModel(BaseModel):
|
||||
|
||||
client: str = Field(
|
||||
description = "The name of the client (service) that was used.",
|
||||
frozen = True
|
||||
)
|
||||
|
||||
ts: AwareDatetime = Field(
|
||||
description = "the time (utc) at which this message was sent by the sender",
|
||||
frozen = True,
|
||||
|
||||
+9
-1
@@ -35,6 +35,9 @@ import sys
|
||||
sys.path.append(".")
|
||||
sys.path.append("..")
|
||||
|
||||
# System-level activities:
|
||||
import io
|
||||
|
||||
# To check certs through cryptographic algorithms:
|
||||
from cryptography import x509
|
||||
from cryptography.hazmat.backends import default_backend
|
||||
@@ -204,7 +207,7 @@ class CertExpiryCheck:
|
||||
# ┃ ┏┓┏┏┓┃ ┃ ┏┓┏┓╋┏
|
||||
# ┗┛┗┛┗┗┻┗ ┗┛┗ ┛ ┗┛
|
||||
|
||||
def load_local(self, path: str) -> bool:
|
||||
def load_local(self, path: str | io.BytesIO) -> bool:
|
||||
|
||||
"""
|
||||
Loads a certificate stored on a local file path and checks for its validity.
|
||||
@@ -221,8 +224,13 @@ class CertExpiryCheck:
|
||||
try:
|
||||
|
||||
# Read the contents of the certificate file:
|
||||
if isinstance(path, str):
|
||||
with open(path, 'rb') as f:
|
||||
cert_data = f.read()
|
||||
elif isinstance(path, io.BytesIO):
|
||||
path.seek(0)
|
||||
cert_data = path.read()
|
||||
else: cert_data = None
|
||||
|
||||
# Load the certificate:
|
||||
cert = x509.load_pem_x509_certificate(cert_data, default_backend())
|
||||
|
||||
Reference in New Issue
Block a user