Skip to content
Merged
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
2 changes: 1 addition & 1 deletion acceptance/acceptance_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const (

var (
baseUrl string
commonHeaders = map[string]string{"X-API-Key": "test-key"}
commonHeaders = map[string]string{"X-API-Key": "demo-api-key"}
client = &http.Client{Timeout: 10 * time.Second}
serverPort = os.Getenv("PORT")
sourceInput1 = api.SourceInput{
Expand Down
2 changes: 1 addition & 1 deletion acceptance/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
- APP_USER_PASSWORD=sourcescore
- PG_HOST=database
- SUPER_USER_PASSWORD=sourcescore
- API_KEY=test-key
- API_KEY=demo-api-key
- RATE_LIMIT_DISABLED=true
ports:
- "8080:8080"
Expand Down
31 changes: 9 additions & 22 deletions api/source-score.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,10 @@ servers:
- url: /
description: Current host

paths:
# /ping:
# get:
# summary: Health check endpoint
# description: Returns a simple pong response to verify the service is running
# responses:
# 200:
# description: Service is healthy
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/Pong'
security:
- ApiKeyAuth: []

paths:
/api/v1/sources:
get:
summary: Get all sources
Expand Down Expand Up @@ -403,17 +394,13 @@ paths:
description: Proof not found

components:
schemas:
# Pong:
# type: object
# required:
# - pong
# properties:
# pong:
# type: string
# example: pong
# description: Simple response string to confirm service health
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-API-Key

schemas:
SourceInput:
type: object
description: Input schema for creating a new source
Expand Down
40 changes: 40 additions & 0 deletions pkg/api/server.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion pkg/handlers/swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ func (h *SwaggerHandler) ServeUI(c *gin.Context) {
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
layout: "StandaloneLayout",
onComplete: function () {
ui.preauthorizeApiKey("ApiKeyAuth", "demo-api-key");
}
});
};
</script>
Expand Down
Loading