-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support API Gateway API key usage plans
This commit adds support for enabling API Gateway's API key usage plans. A non-custom httpApiKeyAuth based authorizer on an operation will now be directly set on every operation in the OpenAPI document, even if it's the same as the service level authorizer.
- Loading branch information
Showing
5 changed files
with
158 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...ources/software/amazon/smithy/aws/apigateway/openapi/operation-http-api-key-security.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"smithy": "1.0", | ||
"shapes": { | ||
"smithy.example#Service": { | ||
"type": "service", | ||
"version": "2006-03-01", | ||
"operations": [ | ||
{ | ||
"target": "smithy.example#Operation1" | ||
} | ||
], | ||
"traits": { | ||
"aws.protocols#restJson1": {}, | ||
"smithy.api#httpApiKeyAuth": { | ||
"name": "x-api-key", | ||
"in": "header" | ||
}, | ||
"aws.apigateway#authorizer": "api_key", | ||
"aws.apigateway#authorizers": { | ||
"api_key": { | ||
"scheme": "smithy.api#httpApiKeyAuth", | ||
"customAuthType": "" | ||
} | ||
} | ||
} | ||
}, | ||
"smithy.example#Operation1": { | ||
"type": "operation", | ||
"traits": { | ||
"smithy.api#http": { | ||
"uri": "/", | ||
"method": "GET" | ||
} | ||
} | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...oftware/amazon/smithy/aws/apigateway/openapi/operation-http-api-key-security.openapi.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"openapi": "3.0.2", | ||
"info": { | ||
"title": "Service", | ||
"version": "2006-03-01" | ||
}, | ||
"paths": { | ||
"/": { | ||
"get": { | ||
"operationId": "Operation1", | ||
"responses": { | ||
"200": { | ||
"description": "Operation1 response" | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"api_key": [ ] | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"components": { | ||
"securitySchemes": { | ||
"api_key": { | ||
"type": "apiKey", | ||
"description": "X-Api-Key authentication", | ||
"name": "x-api-key", | ||
"in": "header" | ||
} | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"api_key": [ ] | ||
} | ||
] | ||
} |