Skip to content

Commit 012190c

Browse files
Merge branch 'main' into remove-stale-msg-flag
2 parents 5d31541 + 2d949a9 commit 012190c

File tree

233 files changed

+4972
-2726
lines changed

Some content is hidden

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

233 files changed

+4972
-2726
lines changed

.env.development

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ GLOBAL_HASH_SECRET=testsecret
1717
#Dyamno for deployment status
1818
DYNAMO_DEPLOYMENT_HISTORY_CACHE_TABLE_REGION=us-west-1
1919
DYNAMO_DEPLOYMENT_HISTORY_CACHE_TABLE_NAME=deployment-history-cache
20+
DYNAMO_AUDIT_LOG_TABLE_REGION=us-west-1
21+
DYNAMO_AUDIT_LOG_TABLE_NAME=audit-log
2022

2123
# The Postgres URL used to connect to the database and secret for encrypting data
2224
DATABASE_URL=postgres://postgres:[email protected]:5432/jira-dev

.env.e2e

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ DEBUG=nock.*
2121
#Dyamno for deployment status
2222
DYNAMO_DEPLOYMENT_HISTORY_CACHE_TABLE_REGION=us-west-1
2323
DYNAMO_DEPLOYMENT_HISTORY_CACHE_TABLE_NAME=deployment-history-cache
24+
DYNAMO_AUDIT_LOG_TABLE_REGION=us-west-1
25+
DYNAMO_AUDIT_LOG_TABLE_NAME=audit-log
2426

2527
MICROS_AWS_REGION=us-west-1
2628

.env.test

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ DEBUG=nock.*
2626
#Dyamno for deployment status
2727
DYNAMO_DEPLOYMENT_HISTORY_CACHE_TABLE_REGION=us-west-1
2828
DYNAMO_DEPLOYMENT_HISTORY_CACHE_TABLE_NAME=deployment-history-cache
29+
DYNAMO_AUDIT_LOG_TABLE_REGION=us-west-1
30+
DYNAMO_AUDIT_LOG_TABLE_NAME=audit-log
2931

3032
MICROS_AWS_REGION=us-west-1
3133

.eslintrc.json

+13-6
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"eslint:recommended",
1919
"plugin:import/recommended",
2020
"plugin:import/typescript",
21-
"plugin:@typescript-eslint/eslint-recommended",
22-
"plugin:@typescript-eslint/recommended-requiring-type-checking"
21+
"plugin:@typescript-eslint/strict-type-checked"
2322
],
2423
"settings": {
2524
"import/parsers": {
@@ -115,7 +114,9 @@
115114
"@typescript-eslint/no-unsafe-call": "off",
116115
"@typescript-eslint/require-await": "off",
117116
"@typescript-eslint/await-thenable": "off",
118-
"@typescript-eslint/no-misused-promises": "off"
117+
"@typescript-eslint/no-misused-promises": "off",
118+
"@typescript-eslint/no-explicit-any": "off",
119+
"@typescript-eslint/no-unnecessary-condition": "off"
119120
}
120121
},
121122
{
@@ -124,15 +125,21 @@
124125
"src/jira/**",
125126
"src/models/**",
126127
"src/sync/**",
127-
"src/transforms/**"
128+
"src/transforms/**",
129+
"src/util/**",
130+
"src/sqs/**",
131+
"src/middleware/**"
128132
],
129133
"rules": {
130134
// To be removed later
131135
"@typescript-eslint/no-unsafe-assignment": "off",
132136
"@typescript-eslint/no-unsafe-argument": "off",
133137
"@typescript-eslint/no-unsafe-member-access": "off",
134138
"@typescript-eslint/no-unsafe-return": "off",
135-
"@typescript-eslint/no-unsafe-call": "off"
139+
"@typescript-eslint/no-unsafe-call": "off",
140+
"@typescript-eslint/no-explicit-any": "off",
141+
"@typescript-eslint/no-unnecessary-condition": "off"
136142
}
137-
}]
143+
}
144+
]
138145
}
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "Dummy deployment"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
env:
6+
description: 'The env the dummy deploy points to'
7+
type: choice
8+
options:
9+
- development
10+
- staging
11+
- production
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
environment:
16+
name: ${{ inputs.env }}
17+
steps:
18+
- name: 'Deploy'
19+
id: deploy-dummy
20+
run: |
21+
echo "Deploy to $TARGET_ENV success"
22+
env:
23+
TARGET_ENV: ${{ inputs.env }}
24+

.localstack/dynamodb.sh

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
2+
# DEPLOYMENT_HISTORY_CACHE_TABLE
33
echo "===== creating dynamo table ${DYNAMO_DEPLOYMENT_HISTORY_CACHE_TABLE_NAME} ====="
44

55
awslocal dynamodb create-table \
@@ -15,8 +15,27 @@ awslocal dynamodb create-table \
1515
ReadCapacityUnits=10,WriteCapacityUnits=5
1616

1717
echo "===== table ${DYNAMO_DEPLOYMENT_HISTORY_CACHE_TABLE_NAME} created ====="
18+
19+
# AUDIT_LOG_TABLE
20+
echo "===== creating dynamo table ${DYNAMO_AUDIT_LOG_TABLE_NAME} ====="
21+
22+
awslocal dynamodb create-table \
23+
--table-name $DYNAMO_AUDIT_LOG_TABLE_NAME \
24+
--key-schema \
25+
AttributeName=Id,KeyType=HASH \
26+
AttributeName=CreatedAt,KeyType=RANGE \
27+
--attribute-definitions \
28+
AttributeName=Id,AttributeType=S \
29+
AttributeName=CreatedAt,AttributeType=N \
30+
--region $DYNAMO_AUDIT_LOG_TABLE_REGION \
31+
--provisioned-throughput \
32+
ReadCapacityUnits=10,WriteCapacityUnits=5
33+
34+
echo "===== table ${DYNAMO_AUDIT_LOG_TABLE_NAME} created ====="
35+
1836
echo "===== checking now ====="
1937

38+
awslocal dynamodb list-tables --region $DYNAMO_AUDIT_LOG_TABLE_REGION
2039
awslocal dynamodb list-tables --region $DYNAMO_DEPLOYMENT_HISTORY_CACHE_TABLE_REGION
2140

2241
echo "===== check finished ====="

docker-compose.yml

+2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ services:
3131
environment:
3232
- DEFAULT_REGION=us-west-1
3333
- DYNAMO_DEPLOYMENT_HISTORY_CACHE_TABLE_NAME=deployment-history-cache
34+
- DYNAMO_AUDIT_LOG_TABLE_NAME=audit-log
3435
- DYNAMO_DEPLOYMENT_HISTORY_CACHE_TABLE_REGION=us-west-1
36+
- DYNAMO_AUDIT_LOG_TABLE_REGION=us-west-1
3537
- LAMBDA_REMOTE_DOCKER=false
3638
- LAMBDA_EXECUTOR=local # runs lambda inside temp directory instead of new docker container
3739
- SQS_ENDPOINT_STRATEGY=off # sets the SQS queue domain/path to the legacy version

etc/poco/bundle/extras-prod-test.json

+101-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,55 @@
11
{
22
"tests": [
3+
{
4+
"name": "Allow Prod Backfill Cloud Critical Pollinator Test to call Get Audit Log endpoints",
5+
"path": "/api/audit-log/subscription/12345",
6+
"method": "GET",
7+
"mechanism": "asap",
8+
"principals": [
9+
"pollinator-check/f24ec1a9-d03d-45c7-bbd8-f2094543eaba"
10+
],
11+
"allowed": true
12+
},
13+
{
14+
"name": "Allow Prod Backfill GHE Critical Pollinator Test to call Get Audit Log endpoints",
15+
"path": "/api/audit-log/subscription/12345",
16+
"method": "GET",
17+
"mechanism": "asap",
18+
"principals": [
19+
"pollinator-check/8692803e-287a-48e3-bad1-49a60a7a4f9d"
20+
],
21+
"allowed": true
22+
},
23+
{
24+
"name": "Allow Prod Backfill Cloud Critical Pollinator Test to call Delete Installation endpoints",
25+
"path": "/api/deleteInstallation/21266506/https%3A%2F%2Ffusion-arc-pollinator-staging-app.atlassian.net",
26+
"method": "DELETE",
27+
"mechanism": "asap",
28+
"principals": [
29+
"pollinator-check/f24ec1a9-d03d-45c7-bbd8-f2094543eaba"
30+
],
31+
"allowed": true
32+
},
33+
{
34+
"name": "Allow Prod Backfill GHE Critical Pollinator Test to call Delete Installation endpoints",
35+
"path": "/api/deleteInstallation/21266506/https%3A%2F%2Ffusion-arc-pollinator-staging-app.atlassian.net",
36+
"method": "DELETE",
37+
"mechanism": "asap",
38+
"principals": [
39+
"pollinator-check/8692803e-287a-48e3-bad1-49a60a7a4f9d"
40+
],
41+
"allowed": true
42+
},
43+
{
44+
"name": "Allow Prod Basic Check Critical Pollinator Test to call Get Audit Log endpoints",
45+
"path": "/api/audit-log/subscription/255625",
46+
"method": "GET",
47+
"mechanism": "asap",
48+
"principals": [
49+
"pollinator-check/d4f03d07-12fe-4a69-9d68-c1841066772e"
50+
],
51+
"allowed": true
52+
},
353
{
454
"name": "Allow pollinator test to call Delete Installation endpoints",
555
"path": "/api/deleteInstallation/21266506/https%3A%2F%2Ffusion-arc-pollinator-staging-app.atlassian.net",
@@ -10,6 +60,16 @@
1060
],
1161
"allowed": true
1262
},
63+
{
64+
"name": "Allow Prod Basic Check Critical Pollinator Test to call Delete Installation endpoints",
65+
"path": "/api/deleteInstallation/44625349/https%3A%2F%2Ffusion-arc-pollinator-staging-app.atlassian.net",
66+
"method": "DELETE",
67+
"mechanism": "asap",
68+
"principals": [
69+
"pollinator-check/d4f03d07-12fe-4a69-9d68-c1841066772e"
70+
],
71+
"allowed": true
72+
},
1373
{
1474
"name": "Allow pollinator test to call Delete Installation endpoints",
1575
"path": "/api/deleteInstallation/21266506/https%3A%2F%2Ffusion-arc-pollinator-staging-app.atlassian.net",
@@ -50,6 +110,16 @@
50110
],
51111
"allowed": false
52112
},
113+
{
114+
"name": "Allow Prod Basic Check Critical Pollinator Test to call other admin endpoints",
115+
"path": "/api/jira/13453453/verify",
116+
"method": "DELETE",
117+
"mechanism": "asap",
118+
"principals": [
119+
"pollinator-check/d4f03d07-12fe-4a69-9d68-c1841066772e"
120+
],
121+
"allowed": false
122+
},
53123
{
54124
"name": "Not allow Pollinator tests to call other Admin endpoints",
55125
"path": "/api/jira/13453453/verify",
@@ -79,6 +149,36 @@
79149
"pollinator-check/b33f33a7-c308-468e-a2a2-06c1f2443bfb"
80150
],
81151
"allowed": false
152+
},
153+
{
154+
"name": "Allow Pollinator Pollinator test to call API configuration POST endpoint",
155+
"path": "/api/configuration",
156+
"method": "POST",
157+
"mechanism": "asap",
158+
"principals": [
159+
"pollinator-check/98a88b09-1541-4c0d-aded-4f1cc467d1fd"
160+
],
161+
"allowed": true
162+
},
163+
{
164+
"name": "Not allow Pollinator Pollinator test to call API configuration POST endpoint for any other principals",
165+
"path": "/api/configuration",
166+
"method": "POST",
167+
"mechanism": "asap",
168+
"principals": [
169+
"pollinator-check/random-one"
170+
],
171+
"allowed": false
172+
},
173+
{
174+
"name": "Not allow Pollinator Pollinator test to call any API configuration endpoint except POST",
175+
"path": "/api/configuration",
176+
"method": "GET",
177+
"mechanism": "asap",
178+
"principals": [
179+
"pollinator-check/random-one"
180+
],
181+
"allowed": false
82182
}
83-
]
183+
]
84184
}

etc/poco/bundle/extras-prod.json

+40-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"allow": [
33
{
4-
"description": "Allow prod pollinator checks to call endpoints for testing",
4+
"description": "Allow prod pollinator checks to call delete installation endpoints for testing",
55
"paths": [
66
"/api/deleteInstallation/**"
77
],
@@ -14,10 +14,47 @@
1414
"pollinator-check/9d09aa37-c3e7-4b85-b86d-4d299ad54954",
1515
"pollinator-check/d99d882f-74a9-4093-822a-9ddf38b5e523",
1616
"pollinator-check/713bec45-18fb-48c7-b6c2-46e6e824caec",
17-
"pollinator-check/b33f33a7-c308-468e-a2a2-06c1f2443bfb"
17+
"pollinator-check/b33f33a7-c308-468e-a2a2-06c1f2443bfb",
18+
"pollinator-check/f24ec1a9-d03d-45c7-bbd8-f2094543eaba",
19+
"pollinator-check/8692803e-287a-48e3-bad1-49a60a7a4f9d",
20+
"pollinator-check/d4f03d07-12fe-4a69-9d68-c1841066772e"
1821
]
1922
}
2023
}
21-
}
24+
},
25+
{
26+
"description": "Allow prod pollinator checks to call view audit log endpoints for testing",
27+
"paths": [
28+
"/api/audit-log/**"
29+
],
30+
"methods": [
31+
"GET"
32+
],
33+
"principals": {
34+
"asap": {
35+
"issuers": [
36+
"pollinator-check/f24ec1a9-d03d-45c7-bbd8-f2094543eaba",
37+
"pollinator-check/8692803e-287a-48e3-bad1-49a60a7a4f9d",
38+
"pollinator-check/d4f03d07-12fe-4a69-9d68-c1841066772e"
39+
]
40+
}
41+
}
42+
},
43+
{
44+
"description": "Allow prod pollinator checks to call post configuration endpoints for testing",
45+
"paths": [
46+
"/api/configuration"
47+
],
48+
"methods": [
49+
"POST"
50+
],
51+
"principals": {
52+
"asap": {
53+
"issuers": [
54+
"pollinator-check/98a88b09-1541-4c0d-aded-4f1cc467d1fd"
55+
]
56+
}
57+
}
58+
}
2259
]
2360
}

0 commit comments

Comments
 (0)