Skip to content
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
19 changes: 19 additions & 0 deletions utils/credentilal_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,12 @@ def generate_credentials_dict(connector_type, connector_keys):
credentials_dict['argocd_server'] = conn_key.key.value
if conn_key.key_type == SourceKeyType.ARGOCD_TOKEN:
credentials_dict['argocd_token'] = conn_key.key.value
elif connector_type == Source.ARGO_WORKFLOWS:
for conn_key in connector_keys:
if conn_key.key_type == SourceKeyType.ARGO_WORKFLOWS_SERVER:
credentials_dict['argo_workflows_server'] = conn_key.key.value
if conn_key.key_type == SourceKeyType.ARGO_WORKFLOWS_TOKEN:
credentials_dict['argo_workflows_token'] = conn_key.key.value
elif connector_type == Source.JIRA_CLOUD:
for conn_key in connector_keys:
if conn_key.key_type == SourceKeyType.JIRA_CLOUD_API_KEY:
Expand Down Expand Up @@ -776,6 +782,19 @@ def credential_yaml_to_connector_proto(connector_name, credential_yaml, connecto
key_type=SourceKeyType.ARGOCD_TOKEN,
key=StringValue(value=credential_yaml['argocd_token'])
))
elif c_type == 'ARGO_WORKFLOWS':
if 'argo_workflows_server' not in credential_yaml or 'argo_workflows_token' not in credential_yaml:
raise Exception(f'Server or Token not found in credential yaml for Argo Workflows source in '
f'connector: {connector_name}')
c_source = Source.ARGO_WORKFLOWS
c_keys.append(ConnectorKey(
key_type=SourceKeyType.ARGO_WORKFLOWS_SERVER,
key=StringValue(value=credential_yaml['argo_workflows_server'])
))
c_keys.append(ConnectorKey(
key_type=SourceKeyType.ARGO_WORKFLOWS_TOKEN,
key=StringValue(value=credential_yaml['argo_workflows_token'])
))
elif c_type == 'JIRA_CLOUD':
if 'jira_cloud_api_key' not in credential_yaml or 'jira_domain' not in credential_yaml or 'jira_email' not in credential_yaml:
raise Exception(f'Api key or domain or email not found in credential yaml for JIRA Cloud source in '
Expand Down
8 changes: 8 additions & 0 deletions utils/static_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,12 @@
SourceKeyType.ARGOCD_TOKEN,
]
],
Source.ARGO_WORKFLOWS: [
[
SourceKeyType.ARGO_WORKFLOWS_SERVER,
SourceKeyType.ARGO_WORKFLOWS_TOKEN,
]
],
Source.POSTHOG: [
[
SourceKeyType.POSTHOG_API_KEY,
Expand Down Expand Up @@ -490,6 +496,7 @@
Source.LINEAR: 'LINEAR',
Source.GITHUB_ACTIONS: 'GITHUB ACTIONS',
Source.ARGOCD: 'ARGOCD',
Source.ARGO_WORKFLOWS: 'ARGO WORKFLOWS',
Source.ROLLBAR: 'ROLLBAR',
Source.POSTHOG: 'POSTHOG',
Source.SIGNOZ: 'SIGNOZ',
Expand Down Expand Up @@ -558,6 +565,7 @@
SourceKeyType.GITHUB_ACTIONS_TOKEN,
SourceKeyType.SMTP_PASSWORD,
SourceKeyType.ARGOCD_TOKEN,
SourceKeyType.ARGO_WORKFLOWS_TOKEN,
SourceKeyType.ROLLBAR_ACCESS_TOKEN,
SourceKeyType.CUSTOM_STRATEGIES_ACCOUNT_ID,
SourceKeyType.KUBERNETES_CLUSTER_TOKEN,
Expand Down