Skip to content

Commit 513e3f9

Browse files
authored
Merge branch 'main' into feature/reset-connector-offsets
2 parents fbb6ddd + 4cf17a0 commit 513e3f9

File tree

21 files changed

+227
-32
lines changed

21 files changed

+227
-32
lines changed

.github/workflows/backend_main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ concurrency:
1919
cancel-in-progress: true
2020

2121
jobs:
22-
build:
22+
build-and-test:
2323
uses: ./.github/workflows/backend_tests.yml
2424
with:
2525
event_name: ${{ github.event_name }}

.github/workflows/backend_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ concurrency:
2020
cancel-in-progress: true
2121

2222
jobs:
23-
build:
23+
build-and-test:
2424
uses: ./.github/workflows/backend_tests.yml
2525
with:
2626
event_name: ${{ github.event_name }}

.github/workflows/cve_checks.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ permissions:
99
contents: read
1010

1111
jobs:
12-
build-and-test:
12+
13+
check-cves:
1314
runs-on: ubuntu-latest
1415

1516
steps:
@@ -67,3 +68,12 @@ jobs:
6768
image-ref: "ghcr.io/kafbat/kafka-ui:${{ steps.build.outputs.version }}"
6869
format: "table"
6970
exit-code: "1"
71+
72+
notify:
73+
needs: check-cves
74+
if: ${{ always() && needs.build-and-test.result == 'failure' }}
75+
uses: ./.github/workflows/infra_discord_hook.yml
76+
with:
77+
message: "Attention! CVE checks run failed! Please fix them CVEs :("
78+
secrets:
79+
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL_CVE }}

.github/workflows/frontend_main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18-
build:
18+
build-and-test:
1919
uses: ./.github/workflows/frontend_tests.yml

.github/workflows/frontend_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ concurrency:
1616
cancel-in-progress: true
1717

1818
jobs:
19-
build:
19+
build-and-test:
2020
uses: ./.github/workflows/frontend_tests.yml
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Discord hook'
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
message:
7+
description: 'Message text'
8+
required: true
9+
type: string
10+
secrets:
11+
DISCORD_WEBHOOK_URL:
12+
required: true
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
19+
hook:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Notify Discord on Failure
23+
uses: Ilshidur/[email protected]
24+
with:
25+
args: ${{ inputs.message }}
26+
env:
27+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }}

.github/workflows/md-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313
contents: read
1414

1515
jobs:
16-
build-and-test:
16+
lint-md:
1717
runs-on: ubuntu-latest
1818

1919
steps:

.github/workflows/pr_linter.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ on:
55
permissions:
66
checks: write
77
jobs:
8-
task-check:
8+
check-tasks:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: kentaro-m/[email protected]
1212
with:
1313
repo-token: "${{ secrets.GITHUB_TOKEN }}"
1414
- uses: dekinderfiets/[email protected]
15-
if: false # TODO remove when public
1615
with:
1716
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/workflow_linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permissions:
99
contents: read
1010

1111
jobs:
12-
build-and-test:
12+
lint-workflows:
1313
runs-on: ubuntu-latest
1414

1515
steps:

api/src/main/java/io/kafbat/ui/config/CorsGlobalConfiguration.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ public WebFilter corsFilter() {
2222

2323
final ServerHttpResponse response = ctx.getResponse();
2424
final HttpHeaders headers = response.getHeaders();
25-
headers.add("Access-Control-Allow-Origin", "*");
26-
headers.add("Access-Control-Allow-Methods", "GET, PUT, POST, DELETE, OPTIONS");
27-
headers.add("Access-Control-Max-Age", "3600");
28-
headers.add("Access-Control-Allow-Headers", "Content-Type");
25+
fillCorsHeader(headers, request);
2926

3027
if (request.getMethod() == HttpMethod.OPTIONS) {
3128
response.setStatusCode(HttpStatus.OK);
@@ -36,4 +33,11 @@ public WebFilter corsFilter() {
3633
};
3734
}
3835

36+
public static void fillCorsHeader(HttpHeaders responseHeaders, ServerHttpRequest request) {
37+
responseHeaders.add("Access-Control-Allow-Origin", request.getHeaders().getOrigin());
38+
responseHeaders.add("Access-Control-Allow-Credentials", "true");
39+
responseHeaders.add("Access-Control-Allow-Methods", "GET, PUT, POST, DELETE, OPTIONS");
40+
responseHeaders.add("Access-Control-Max-Age", "3600");
41+
responseHeaders.add("Access-Control-Allow-Headers", "Content-Type");
42+
}
3943
}

0 commit comments

Comments
 (0)