Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a default pattern to UpdateConfig #1906

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion assemblyline/odm/models/service.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
from __future__ import annotations

from typing import Optional as Opt

from assemblyline import odm
from assemblyline.common import forge
from assemblyline.common.constants import DEFAULT_SERVICE_ACCEPTS, DEFAULT_SERVICE_REJECTS
from assemblyline.common.constants import (
DEFAULT_SERVICE_ACCEPTS,
DEFAULT_SERVICE_REJECTS,
)

Classification = forge.get_classification()

Expand Down Expand Up @@ -109,6 +113,7 @@ class UpdateConfig(odm.Model):
default="double_new_line",
description="Delimiter used when given a list of signatures")
custom_delimiter = odm.Optional(odm.Keyword(), description="Custom delimiter definition")
default_pattern = odm.Text(default=".*", description="Default pattern used for matching files")


@ odm.model(index=False, store=False, description="Submission Parameters for Service")
Expand Down
4 changes: 2 additions & 2 deletions assemblyline/odm/models/service_delta.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from __future__ import annotations

from assemblyline import odm
from assemblyline.odm.models.service import SIGNATURE_DELIMITERS, FETCH_METHODS

from assemblyline.odm.models.service import FETCH_METHODS, SIGNATURE_DELIMITERS

REF_DEPENDENCY_CONFIG = "Refer to:<br>[Service - DependencyConfig](../service/#dependencyconfig)"
REF_DOCKER_CONFIG = "Refer to:<br>[Service - DockerConfig](../service/#dockerconfig)"
Expand Down Expand Up @@ -84,6 +83,7 @@ class UpdateConfigDelta(odm.Model):
wait_for_update = odm.Optional(odm.Boolean(), description=REF_UPDATE_CONFIG)
signature_delimiter = odm.Optional(odm.Enum(values=SIGNATURE_DELIMITERS.keys()), description=REF_UPDATE_CONFIG)
custom_delimiter = odm.Optional(odm.Keyword(), description=REF_UPDATE_CONFIG)
default_pattern = odm.Optional(odm.Text(), description=REF_UPDATE_CONFIG)


@ odm.model(index=False, store=False)
Expand Down