Skip to content

Commit

Permalink
Update security definition for gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
jpahm committed Oct 27, 2024
1 parent e39c697 commit b5d2a92
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
7 changes: 6 additions & 1 deletion api/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,12 +877,17 @@ const docTemplate = `{
}
},
"securityDefinitions": {
"apiKey": {
"api_key": {
"type": "apiKey",
"name": "x-api-key",
"in": "header"
}
},
"security": [
{
"api_key": []
}
],
"x-google-backend": {
"address": "REDACTED"
},
Expand Down
7 changes: 6 additions & 1 deletion api/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -873,12 +873,17 @@
}
},
"securityDefinitions": {
"apiKey": {
"api_key": {
"type": "apiKey",
"name": "x-api-key",
"in": "header"
}
},
"security": [
{
"api_key": []
}
],
"x-google-backend": {
"address": "REDACTED"
},
Expand Down
4 changes: 3 additions & 1 deletion api/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,10 @@ paths:
$ref: '#/definitions/schema.Section'
schemes:
- http
security:
- api_key: []
securityDefinitions:
apiKey:
api_key:
in: header
name: x-api-key
type: apiKey
Expand Down
3 changes: 2 additions & 1 deletion api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import (
// @x-google-backend {"address": "REDACTED"}
// @x-google-endpoints [{"name": "nebula-api-2lntm5dxoflqn.apigateway.nebula-api-368223.cloud.goog", "allowCors": true}]
// @x-google-management {"metrics": [{"name": "read-requests", "displayName": "Read Requests CUSTOM", "valueType": "INT64", "metricKind": "DELTA"}], "quota": {"limits": [{"name": "read-limit", "metric": "read-requests", "unit": "1/min/{project}", "values": {"STANDARD": 1000}}]}}
// @securitydefinitions.apikey apiKey
// @security api_key
// @securitydefinitions.apikey api_key
// @name x-api-key
// @in header
func main() {
Expand Down

0 comments on commit b5d2a92

Please sign in to comment.