From daf6f645e1c9d980595f04c7cc0b9daa3577c2ba Mon Sep 17 00:00:00 2001 From: jpahm <20374744+jpahm@users.noreply.github.com> Date: Mon, 28 Oct 2024 16:32:51 -0500 Subject: [PATCH] Make swagger endpoint unauthenticated; fix host --- api/docs/docs.go | 3 ++- api/docs/swagger.json | 2 +- api/docs/swagger.yaml | 2 +- api/server.go | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/api/docs/docs.go b/api/docs/docs.go index 772e9a3..2ef0bd2 100644 --- a/api/docs/docs.go +++ b/api/docs/docs.go @@ -595,6 +595,7 @@ const docTemplate = `{ }, "/swagger/index.html": { "get": { + "security": [], "description": "Returns the OpenAPI/swagger spec for the API", "produces": [ "text/html" @@ -938,7 +939,7 @@ const docTemplate = `{ // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "0.1.0", - Host: "nebula-api-2lntm5dxoflqn.apigateway.nebula-api-368223.cloud.goog", + Host: "", BasePath: "", Schemes: []string{"http", "https"}, Title: "nebula-api", diff --git a/api/docs/swagger.json b/api/docs/swagger.json index 2377606..5bdbb6c 100644 --- a/api/docs/swagger.json +++ b/api/docs/swagger.json @@ -10,7 +10,6 @@ "contact": {}, "version": "0.1.0" }, - "host": "nebula-api-2lntm5dxoflqn.apigateway.nebula-api-368223.cloud.goog", "paths": { "/course": { "get": { @@ -592,6 +591,7 @@ }, "/swagger/index.html": { "get": { + "security": [], "description": "Returns the OpenAPI/swagger spec for the API", "produces": [ "text/html" diff --git a/api/docs/swagger.yaml b/api/docs/swagger.yaml index 4232376..2eceb18 100644 --- a/api/docs/swagger.yaml +++ b/api/docs/swagger.yaml @@ -184,7 +184,6 @@ definitions: $ref: '#/definitions/schema.Assistant' type: array type: object -host: nebula-api-2lntm5dxoflqn.apigateway.nebula-api-368223.cloud.goog info: contact: {} description: The public Nebula Labs API for access to pertinent UT Dallas data @@ -589,6 +588,7 @@ paths: responses: "200": description: OK + security: [] schemes: - http - https diff --git a/api/server.go b/api/server.go index 9acb6f2..e1ee45d 100644 --- a/api/server.go +++ b/api/server.go @@ -11,17 +11,18 @@ import ( ginSwagger "github.com/swaggo/gin-swagger" ) +// Unauthenticated placeholder endpoint for the built-in ginSwagger swagger documentation endpoint // @Id swagger // @Router /swagger/index.html [get] // @Description Returns the OpenAPI/swagger spec for the API // @Produce text/html +// @Security // @Success 200 func swagger_controller_placeholder() {} // @title nebula-api // @description The public Nebula Labs API for access to pertinent UT Dallas data // @version 0.1.0 -// @host nebula-api-2lntm5dxoflqn.apigateway.nebula-api-368223.cloud.goog // @schemes http https // @x-google-backend {"address": "REDACTED"} // @x-google-endpoints [{"name": "nebula-api-2lntm5dxoflqn.apigateway.nebula-api-368223.cloud.goog", "allowCors": true}]