Skip to content

Commit

Permalink
precommit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorwalton committed Aug 27, 2024
1 parent 3b3e79b commit 8352d8e
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 37 deletions.
5 changes: 3 additions & 2 deletions backend/app/db/db_populate.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def get_connectors_list():
),
("Graylog", "5.0.7", "username_password", "Connection to Graylog."),
("Shuffle", "1.1.0", "api_key", "Connection to Shuffle."),
#("DFIR-IRIS", "2.0", "api_key", "Connection to DFIR-IRIS."),
# ("DFIR-IRIS", "2.0", "api_key", "Connection to DFIR-IRIS."),
(
"Velociraptor",
"0.6.8",
Expand Down Expand Up @@ -148,6 +148,7 @@ def get_connectors_list():

return [load_connector_data(*connector) for connector in connectors]


def delete_connectors_list():
"""
Get a list of connectors with their respective versions and authentication methods.
Expand All @@ -162,7 +163,6 @@ def delete_connectors_list():
return connectors



async def add_connectors_if_not_exist(session: AsyncSession):
"""
Adds connectors to the database if they do not already exist.
Expand Down Expand Up @@ -191,6 +191,7 @@ async def add_connectors_if_not_exist(session: AsyncSession):

await session.commit()


async def delete_connectors_if_exist(session: AsyncSession):
"""
Deletes connectors from the database if they already exist.
Expand Down
4 changes: 3 additions & 1 deletion backend/app/db/db_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
from app.db.db_populate import add_available_integrations_if_not_exist
from app.db.db_populate import add_available_network_connectors_auth_keys_if_not_exist
from app.db.db_populate import add_available_network_connectors_if_not_exist
from app.db.db_populate import add_connectors_if_not_exist, delete_connectors_if_exist
from app.db.db_populate import add_connectors_if_not_exist
from app.db.db_populate import add_roles_if_not_exist
from app.db.db_populate import delete_connectors_if_exist
from app.db.db_session import SQLALCHEMY_DATABASE_URI
from app.db.db_session import db_password

Expand Down Expand Up @@ -124,6 +125,7 @@ async def add_connectors(async_engine):
await add_connectors_if_not_exist(session)
logger.info("Connectors added successfully")


async def delete_connectors(async_engine):
"""
Deletes connectors from the database.
Expand Down
3 changes: 2 additions & 1 deletion backend/copilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
from app.auth.utils import AuthHandler
from app.db.db_session import SQLALCHEMY_DATABASE_URI_NO_DB
from app.db.db_session import async_engine
from app.db.db_setup import add_connectors, delete_connectors
from app.db.db_setup import add_connectors
from app.db.db_setup import apply_migrations
from app.db.db_setup import create_available_integrations
from app.db.db_setup import create_available_network_connectors
from app.db.db_setup import create_copilot_user_if_not_exists
from app.db.db_setup import create_database_if_not_exists
from app.db.db_setup import create_roles
from app.db.db_setup import delete_connectors
from app.db.db_setup import ensure_admin_user
from app.db.db_setup import ensure_scheduler_user
from app.db.db_setup import ensure_scheduler_user_removed
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@
"engines": {
"node": ">=18.0.0"
}
}
}
2 changes: 1 addition & 1 deletion frontend/src/api/endpoints/soc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default {
time_unit: payload?.unit || "days"
}
/*eslint no-mixed-spaces-and-tabs: "off"*/
}
}
: undefined
)
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/agents/agentFlow/AgentFlowItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<div class="grid gap-2 grid-auto-fit-200 p-7 pt-4" v-if="properties">
<KVCard v-for="(value, key) of properties" :key="key">
<template #key>{{ key }}</template>
<template #value>{{ value === "" ? "-" : (value ?? "-") }}</template>
<template #value>{{ value === "" ? "-" : value ?? "-" }}</template>
</KVCard>
</div>
</n-tab-pane>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<div class="grid gap-2 grid-auto-fit-200 p-7 pt-4" v-if="properties">
<KVCard v-for="(value, key) of properties" :key="key">
<template #key>{{ key }}</template>
<template #value>{{ value === "" ? "-" : (value ?? "-") }}</template>
<template #value>{{ value === "" ? "-" : value ?? "-" }}</template>
</KVCard>
</div>
</n-tab-pane>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/agents/sca/ScaResultItemDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
data.result === 'failed'
? 'text-error-color'
: data.result === 'not applicable'
? 'text-warning-color'
: 'text-success-color'
? 'text-warning-color'
: 'text-success-color'
"
>
{{ data.result }}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/auth/AuthForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const title = computed<string>(() =>
typeRef.value === "signin"
? "SOCFortress CoPilot"
: typeRef.value === "signup"
? "SOCFortress CoPilot"
: "Forgot Password"
? "SOCFortress CoPilot"
: "Forgot Password"
)
function gotoSignIn() {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/cards/CardActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const menuOptions = computed(() =>
key: "reload",
icon: renderIcon(ReloadIcon)
}
]
]
: [
{
label: "Collapse",
Expand All @@ -83,7 +83,7 @@ const menuOptions = computed(() =>
key: "reload",
icon: renderIcon(ReloadIcon)
}
]
]
)
function menuSelect(key: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<Icon :name="ViewIcon" :size="14" class="top-0.5 relative" />
</code>
</div>
<div v-else>{{ value === "" ? "-" : (value ?? "-") }}</div>
<div v-else>{{ value === "" ? "-" : value ?? "-" }}</div>
</template>
</KVCard>
</div>
Expand Down Expand Up @@ -61,7 +61,7 @@
<Icon :name="LinkIcon" :size="14" class="top-0.5 relative" />
</code>
</div>
<div v-else>{{ value === "" ? "-" : (value ?? "-") }}</div>
<div v-else>{{ value === "" ? "-" : value ?? "-" }}</div>
</template>
</KVCard>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<Icon :name="LinkIcon" :size="14" class="top-0.5 relative" />
</code>
</div>
<div v-else>{{ value === "" ? "-" : (value ?? "-") }}</div>
<div v-else>{{ value === "" ? "-" : value ?? "-" }}</div>
</template>
</KVCard>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
alert.status === 'OPEN'
? 'danger'
: alert.status === 'IN_PROGRESS'
? 'warning'
: 'success'
? 'warning'
: 'success'
"
>
<template #iconLeft>
Expand Down Expand Up @@ -96,8 +96,8 @@
alert.status === 'OPEN'
? 'danger'
: alert.status === 'IN_PROGRESS'
? 'warning'
: 'success'
? 'warning'
: 'success'
"
>
<template #iconLeft>
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/components/incidentManagement/cases/CaseItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
caseEntity.case_status === 'OPEN'
? 'danger'
: caseEntity.case_status === 'IN_PROGRESS'
? 'warning'
: caseEntity.case_status === 'CLOSED'
? 'success'
: undefined
? 'warning'
: caseEntity.case_status === 'CLOSED'
? 'success'
: undefined
"
>
<template #iconLeft>
Expand Down Expand Up @@ -80,10 +80,10 @@
caseEntity.case_status === 'OPEN'
? 'danger'
: caseEntity.case_status === 'IN_PROGRESS'
? 'warning'
: caseEntity.case_status === 'CLOSED'
? 'success'
: undefined
? 'warning'
: caseEntity.case_status === 'CLOSED'
? 'success'
: undefined
"
>
<template #iconLeft>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
caseData.case_status === 'OPEN'
? 'danger'
: caseData.case_status === 'IN_PROGRESS'
? 'warning'
: caseData.case_status === 'CLOSED'
? 'success'
: undefined
? 'warning'
: caseData.case_status === 'CLOSED'
? 'success'
: undefined
"
size="lg"
class="grow w-full"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
status === 'OPEN'
? WarningIcon
: status === 'IN_PROGRESS'
? ProgressIcon
: status === 'CLOSED'
? CheckIcon
: UnknownIcon
? ProgressIcon
: status === 'CLOSED'
? CheckIcon
: UnknownIcon
"
:size="size || 16"
/>
Expand Down

0 comments on commit 8352d8e

Please sign in to comment.