Skip to content

Commit 9a0cf56

Browse files
committed
fix : fix swagger ui https via header-forwarding
1 parent 47d5f05 commit 9a0cf56

File tree

3 files changed

+76
-41
lines changed

3 files changed

+76
-41
lines changed

.github/workflows/ethicalcheck.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# EthicalCheck addresses the critical need to continuously security test APIs in development and in production.
7+
8+
# EthicalCheck provides the industry’s only free & automated API security testing service that uncovers security vulnerabilities using OWASP API list.
9+
# Developers relies on EthicalCheck to evaluate every update and release, ensuring that no APIs go to production with exploitable vulnerabilities.
10+
11+
# You develop the application and API, we bring complete and continuous security testing to you, accelerating development.
12+
13+
# Know your API and Applications are secure with EthicalCheck – our free & automated API security testing service.
14+
15+
# How EthicalCheck works?
16+
# EthicalCheck functions in the following simple steps.
17+
# 1. Security Testing.
18+
# Provide your OpenAPI specification or start with a public Postman collection URL.
19+
# EthicalCheck instantly instrospects your API and creates a map of API endpoints for security testing.
20+
# It then automatically creates hundreds of security tests that are non-intrusive to comprehensively and completely test for authentication, authorizations, and OWASP bugs your API. The tests addresses the OWASP API Security categories including OAuth 2.0, JWT, Rate Limit etc.
21+
22+
# 2. Reporting.
23+
# EthicalCheck generates security test report that includes all the tested endpoints, coverage graph, exceptions, and vulnerabilities.
24+
# Vulnerabilities are fully triaged, it contains CVSS score, severity, endpoint information, and OWASP tagging.
25+
26+
27+
# This is a starter workflow to help you get started with EthicalCheck Actions
28+
29+
name: EthicalCheck-Workflow
30+
31+
# Controls when the workflow will run
32+
on:
33+
# Triggers the workflow on push or pull request events but only for the "main" branch
34+
# Customize trigger events based on your DevSecOps processes.
35+
push:
36+
branches: [ "main" ]
37+
pull_request:
38+
branches: [ "main" ]
39+
schedule:
40+
- cron: '18 14 * * 0'
41+
42+
# Allows you to run this workflow manually from the Actions tab
43+
workflow_dispatch:
44+
45+
permissions:
46+
contents: read
47+
48+
jobs:
49+
Trigger_EthicalCheck:
50+
permissions:
51+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
52+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
53+
runs-on: ubuntu-latest
54+
55+
steps:
56+
- name: EthicalCheck Free & Automated API Security Testing Service
57+
uses: apisec-inc/ethicalcheck-action@005fac321dd843682b1af6b72f30caaf9952c641
58+
with:
59+
# The OpenAPI Specification URL or Swagger Path or Public Postman collection URL.
60+
oas-url: "https://4.213.1.116.nip.io/v3/api-docs"
61+
# The email address to which the penetration test report will be sent.
62+
email: "${{ secrets.ETHICALCHECK_EMAIL }}"
63+
sarif-result-file: "ethicalcheck-results.sarif"
64+
65+
- name: Upload sarif file to repository
66+
uses: github/codeql-action/upload-sarif@v3
67+
with:
68+
sarif_file: ./ethicalcheck-results.sarif
69+

.github/workflows/qodana_code_quality.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/main/resources/application.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,20 @@ springdoc:
9595
path: /v3/api-docs
9696
swagger-ui:
9797
path: /swagger-ui/index.html
98+
# This tells Springdoc to use the forwarded headers to generate the correct HTTPS URL
99+
use-forward-headers: true
98100
info:
99101
title: leetstats-api
100102
description: "The API for retrieving your LeetCode profile & Problems statistics"
101103
version: "0.0.1-SNAPSHOT"
102104
servers:
103-
- url: https://4.213.1.116.nip.io/api/v1
105+
- url: https://4.213.1.116.nip.io
104106
description: Production server
105-
- url: http://localhost:8080/api/v1
107+
- url: http://localhost:8080
106108
description: Local development server
107109

108110
scheduler:
109111
enabled: true #change this to true when deploying via pipeline for testing we can keep it false after once the data is loaded in db
112+
113+
server:
114+
forward-headers-strategy: NATIVE

0 commit comments

Comments
 (0)