Bitwarden updates (#1547)
This commit is contained in:
@@ -358,6 +358,9 @@ class BitwardenService:
|
|||||||
BitwardenService.sync()
|
BitwardenService.sync()
|
||||||
session_key = BitwardenService.unlock(master_password)
|
session_key = BitwardenService.unlock(master_password)
|
||||||
|
|
||||||
|
if not bw_organization_id and not collection_id:
|
||||||
|
raise BitwardenAccessDeniedError()
|
||||||
|
|
||||||
# Step 3: Retrieve the items
|
# Step 3: Retrieve the items
|
||||||
list_command = [
|
list_command = [
|
||||||
"bw",
|
"bw",
|
||||||
@@ -513,6 +516,12 @@ class BitwardenService:
|
|||||||
"--session",
|
"--session",
|
||||||
session_key,
|
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)
|
item_result = BitwardenService.run_command(get_command)
|
||||||
|
|
||||||
# Parse the item and extract credit card data
|
# Parse the item and extract credit card data
|
||||||
@@ -571,8 +580,6 @@ class BitwardenService:
|
|||||||
"""
|
"""
|
||||||
Get the credit card data from the Bitwarden CLI.
|
Get the credit card data from the Bitwarden CLI.
|
||||||
"""
|
"""
|
||||||
if not bw_organization_id and not bw_collection_ids:
|
|
||||||
raise BitwardenAccessDeniedError()
|
|
||||||
try:
|
try:
|
||||||
async with asyncio.timeout(settings.BITWARDEN_TIMEOUT_SECONDS):
|
async with asyncio.timeout(settings.BITWARDEN_TIMEOUT_SECONDS):
|
||||||
return await BitwardenService._get_credit_card_data(
|
return await BitwardenService._get_credit_card_data(
|
||||||
|
|||||||
@@ -1218,10 +1218,6 @@ class WorkflowService:
|
|||||||
description=parameter.description,
|
description=parameter.description,
|
||||||
)
|
)
|
||||||
elif parameter.parameter_type == ParameterType.BITWARDEN_CREDIT_CARD_DATA:
|
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(
|
parameters[parameter.key] = await self.create_bitwarden_credit_card_data_parameter(
|
||||||
workflow_id=workflow.workflow_id,
|
workflow_id=workflow.workflow_id,
|
||||||
bitwarden_client_id_aws_secret_key=parameter.bitwarden_client_id_aws_secret_key,
|
bitwarden_client_id_aws_secret_key=parameter.bitwarden_client_id_aws_secret_key,
|
||||||
|
|||||||
Reference in New Issue
Block a user