Bitwarden updates (#1547)
This commit is contained in:
@@ -358,6 +358,9 @@ class BitwardenService:
|
||||
BitwardenService.sync()
|
||||
session_key = BitwardenService.unlock(master_password)
|
||||
|
||||
if not bw_organization_id and not collection_id:
|
||||
raise BitwardenAccessDeniedError()
|
||||
|
||||
# Step 3: Retrieve the items
|
||||
list_command = [
|
||||
"bw",
|
||||
@@ -513,6 +516,12 @@ class BitwardenService:
|
||||
"--session",
|
||||
session_key,
|
||||
]
|
||||
|
||||
# Bitwarden CLI doesn't support filtering by organization ID or collection ID for credit card data so we just raise an error if no collection ID or organization ID is provided
|
||||
if not bw_organization_id and not collection_id:
|
||||
LOG.error("No collection ID or organization ID provided -- this is required")
|
||||
raise BitwardenAccessDeniedError()
|
||||
|
||||
item_result = BitwardenService.run_command(get_command)
|
||||
|
||||
# Parse the item and extract credit card data
|
||||
@@ -571,8 +580,6 @@ class BitwardenService:
|
||||
"""
|
||||
Get the credit card data from the Bitwarden CLI.
|
||||
"""
|
||||
if not bw_organization_id and not bw_collection_ids:
|
||||
raise BitwardenAccessDeniedError()
|
||||
try:
|
||||
async with asyncio.timeout(settings.BITWARDEN_TIMEOUT_SECONDS):
|
||||
return await BitwardenService._get_credit_card_data(
|
||||
|
||||
@@ -1218,10 +1218,6 @@ class WorkflowService:
|
||||
description=parameter.description,
|
||||
)
|
||||
elif parameter.parameter_type == ParameterType.BITWARDEN_CREDIT_CARD_DATA:
|
||||
if not organization.bw_organization_id and not organization.bw_collection_ids:
|
||||
raise InvalidWorkflowDefinition(
|
||||
message="To use credit card data parameters, please contact us at support@skyvern.com"
|
||||
)
|
||||
parameters[parameter.key] = await self.create_bitwarden_credit_card_data_parameter(
|
||||
workflow_id=workflow.workflow_id,
|
||||
bitwarden_client_id_aws_secret_key=parameter.bitwarden_client_id_aws_secret_key,
|
||||
|
||||
Reference in New Issue
Block a user