Skip to content

Commit 0723620

Browse files
authored
Merge pull request #16 from UncoderIO/file-structure-refactoring
files structure refactoring
2 parents f47a762 + 19f4372 commit 0723620

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+58
-63
lines changed

siem-converter/app/converter/converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from app.converter.platforms.roota.parsers.roota import RootAParser
44
from app.converter.core.exceptions.core import UnsupportedPlatform
5-
from app.converter.core.operator_types.output import SiemContainer
5+
from app.converter.core.models.parser_output import SiemContainer
66
from app.converter.managers import RenderManager, ParserManager, render_manager, parser_manager
77
from app.converter.tools.decorators import handle_translation_exceptions
88

siem-converter/app/converter/core/operator_types/tokens.py renamed to siem-converter/app/converter/core/custom_types/tokens.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class OperatorType(CustomEnum):
1414
GTE = ">="
1515
EQ = "="
1616
NEQ = "!="
17-
COLON = ":"
1817
CONTAINS = "contains"
1918
STARTSWITH = "startswith"
2019
ENDSWITH = "endswith"
@@ -25,8 +24,3 @@ class OperatorType(CustomEnum):
2524
class GroupType(CustomEnum):
2625
L_PAREN = "("
2726
R_PAREN = ")"
28-
GROUP = "group"
29-
30-
31-
class ValidTokens(LogicalOperatorType, OperatorType, GroupType):
32-
pass

siem-converter/app/converter/core/mixins/operator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from typing import Union, List, Tuple
2020

2121
from app.converter.core.models.identifier import Identifier
22-
from app.converter.core.operator_types.tokens import OperatorType
22+
from app.converter.core.custom_types.tokens import OperatorType
2323

2424

2525
class WildCardMixin:

siem-converter/app/converter/core/models/field.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from app.converter.core.mapping import SourceMapping
44
from app.converter.core.models.identifier import Identifier
5-
from app.converter.core.operator_types.tokens import OperatorType
5+
from app.converter.core.custom_types.tokens import OperatorType
66

77

88
class Field:

siem-converter/app/converter/core/models/functions/table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from app.converter.core.operator_types.tokens import OperatorType
1+
from app.converter.core.custom_types.tokens import OperatorType
22

33

44
class TableField:

siem-converter/app/converter/core/models/identifier.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
from dataclasses import dataclass
22

3-
from app.converter.core.operator_types.tokens import ValidTokens
3+
from app.converter.core.custom_types.tokens import LogicalOperatorType, OperatorType, GroupType
4+
5+
6+
class _IdentifierTokenType(LogicalOperatorType, OperatorType, GroupType):
7+
pass
48

59

610
@dataclass
711
class Identifier:
812
def __init__(self, *, token_type: str) -> None:
9-
if token_type not in ValidTokens:
13+
if token_type not in _IdentifierTokenType:
1014
raise Exception(f"Unexpected token type: {token_type}")
1115

1216
self.token_type = token_type

siem-converter/app/converter/core/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from app.converter.core.mapping import BasePlatformMappings, SourceMapping
2323
from app.converter.core.models.field import Field
2424
from app.converter.core.models.platform_details import PlatformDetails
25-
from app.converter.core.operator_types.output import SiemContainer, MetaInfoContainer
25+
from app.converter.core.models.parser_output import SiemContainer, MetaInfoContainer
2626
from app.converter.core.tokenizer import QueryTokenizer, TOKEN_TYPE
2727

2828

siem-converter/app/converter/core/render.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
from app.converter.core.models.field import Field, Keyword
2727
from app.converter.core.models.functions.types import ParsedFunctions
2828
from app.converter.core.models.platform_details import PlatformDetails
29-
from app.converter.core.operator_types.output import MetaInfoContainer
30-
from app.converter.core.operator_types.tokens import LogicalOperatorType, OperatorType, GroupType
29+
from app.converter.core.models.parser_output import MetaInfoContainer
30+
from app.converter.core.custom_types.tokens import LogicalOperatorType, OperatorType, GroupType
3131

3232

3333
class BaseQueryFieldValue(ABC):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy