mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-19 00:01:29 +00:00
(fix) proxy, dynamo - allow users to set ssl_verify False
This commit is contained in:
parent
023c07b607
commit
d59ac23e82
3 changed files with 29 additions and 5 deletions
|
|
@ -193,6 +193,7 @@ class DynamoDBArgs(LiteLLMBase):
|
|||
billing_mode: Literal["PROVISIONED_THROUGHPUT", "PAY_PER_REQUEST"]
|
||||
read_capacity_units: Optional[int] = None
|
||||
write_capacity_units: Optional[int] = None
|
||||
ssl_verify: Optional[bool] = None
|
||||
region_name: str
|
||||
user_table_name: str = "LiteLLM_UserTable"
|
||||
key_table_name: str = "LiteLLM_VerificationToken"
|
||||
|
|
|
|||
|
|
@ -71,9 +71,15 @@ class DynamoDBWrapper(CustomDB):
|
|||
from aiodynamo.models import ReturnValues
|
||||
from aiodynamo.http.aiohttp import AIOHTTP
|
||||
from aiohttp import ClientSession
|
||||
import aiohttp
|
||||
|
||||
verbose_proxy_logger.debug("DynamoDB Wrapper - Attempting to connect")
|
||||
async with ClientSession() as session:
|
||||
# before making ClientSession check if ssl_verify=False
|
||||
if self.database_arguments.ssl_verify == False:
|
||||
client_session = ClientSession(connector=aiohttp.TCPConnector(ssl=False))
|
||||
else:
|
||||
client_session = ClientSession()
|
||||
async with client_session as session:
|
||||
client = Client(AIOHTTP(session), Credentials.auto(), self.region_name)
|
||||
## User
|
||||
try:
|
||||
|
|
@ -145,8 +151,13 @@ class DynamoDBWrapper(CustomDB):
|
|||
from aiodynamo.models import ReturnValues
|
||||
from aiodynamo.http.aiohttp import AIOHTTP
|
||||
from aiohttp import ClientSession
|
||||
import aiohttp
|
||||
|
||||
async with ClientSession() as session:
|
||||
if self.database_arguments.ssl_verify == False:
|
||||
client_session = ClientSession(connector=aiohttp.TCPConnector(ssl=False))
|
||||
else:
|
||||
client_session = ClientSession()
|
||||
async with client_session as session:
|
||||
client = Client(AIOHTTP(session), Credentials.auto(), self.region_name)
|
||||
table = None
|
||||
if table_name == "user":
|
||||
|
|
@ -178,8 +189,14 @@ class DynamoDBWrapper(CustomDB):
|
|||
from aiodynamo.models import ReturnValues
|
||||
from aiodynamo.http.aiohttp import AIOHTTP
|
||||
from aiohttp import ClientSession
|
||||
import aiohttp
|
||||
|
||||
async with ClientSession() as session:
|
||||
if self.database_arguments.ssl_verify == False:
|
||||
client_session = ClientSession(connector=aiohttp.TCPConnector(ssl=False))
|
||||
else:
|
||||
client_session = ClientSession()
|
||||
|
||||
async with client_session as session:
|
||||
client = Client(AIOHTTP(session), Credentials.auto(), self.region_name)
|
||||
table = None
|
||||
key_name = None
|
||||
|
|
@ -232,8 +249,13 @@ class DynamoDBWrapper(CustomDB):
|
|||
from aiodynamo.models import ReturnValues
|
||||
from aiodynamo.http.aiohttp import AIOHTTP
|
||||
from aiohttp import ClientSession
|
||||
import aiohttp
|
||||
|
||||
async with ClientSession() as session:
|
||||
if self.database_arguments.ssl_verify == False:
|
||||
client_session = ClientSession(connector=aiohttp.TCPConnector(ssl=False))
|
||||
else:
|
||||
client_session = ClientSession()
|
||||
async with client_session as session:
|
||||
client = Client(AIOHTTP(session), Credentials.auto(), self.region_name)
|
||||
table = None
|
||||
key_name = None
|
||||
|
|
|
|||
|
|
@ -55,7 +55,8 @@ general_settings:
|
|||
database_type: "dynamo_db"
|
||||
database_args: { # 👈 all args - https://github.com/BerriAI/litellm/blob/befbcbb7ac8f59835ce47415c128decf37aac328/litellm/proxy/_types.py#L190
|
||||
"billing_mode": "PAY_PER_REQUEST",
|
||||
"region_name": "us-west-2"
|
||||
"region_name": "us-west-2",
|
||||
"ssl_verify": False
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue