-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.py
52 lines (40 loc) · 1.28 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from enum import Enum
from typing import List, Union
from pydantic import BaseModel, Field
from pydantic_settings import BaseSettings
class OperationKind(str, Enum):
scorecard_reminder = "scorecard_reminder"
scorecard_report = "scorecard_report"
ticket_creator = "ticket_handler"
issue_handler = "issue_handler"
class TargetKind(str, Enum):
slack = "slack"
jira = "jira"
github = "github"
class FilterRule(BaseModel):
property: str
operator: str
value: Union[str, int, List[str], List[int]] = None
class Settings(BaseSettings):
port_client_id: str
port_client_secret: str
github_api_url: str = ""
github_token: str = ""
github_repository: str = ""
slack_webhook_url: str = ""
jira_project_id: str = ""
jira_api_endpoint: str = "https://jira.com"
jira_email: str = ""
jira_resolve_transition_id: str = ""
jira_reopen_transition_id: str = ""
jira_token: str = ""
port_region: str = "eu"
blueprint: str
scorecard: str
filter_rule: Union[FilterRule, str, None] = Field(default=None)
operation_kind: OperationKind = OperationKind.scorecard_reminder
target_kind: TargetKind = TargetKind.slack
log_level: str = "INFO"
class Config:
env_prefix = "INPUT_"
settings = Settings()