-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds security to individual operations
We previously weren't adding security to individual operations if the operation differend from the security of the operation differed from the service because of an applied authorizer trait.
- Loading branch information
Showing
3 changed files
with
71 additions
and
0 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
20 changes: 20 additions & 0 deletions
20
...test/resources/software/amazon/smithy/aws/apigateway/openapi/effective-authorizers.smithy
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,20 @@ | ||
namespace smithy.example | ||
|
||
@protocols([{name: "aws.rest-json-1.1", auth: ["aws.v4"]}]) | ||
@aws.apigateway#authorizer("foo") | ||
@aws.apigateway#authorizers( | ||
foo: {scheme: "aws.v4", type: "aws", uri: "arn:foo"}, | ||
baz: {scheme: "aws.v4", type: "aws", uri: "arn:baz"}) | ||
service ServiceA { | ||
version: "2019-06-17", | ||
operations: [OperationA, OperationB] | ||
} | ||
|
||
// Inherits the authorizer of ServiceA | ||
@http(method: "GET", uri: "/operationA") | ||
operation OperationA {} | ||
|
||
// Overrides the authorizer of ServiceA | ||
@aws.apigateway#authorizer("baz") | ||
@http(method: "GET", uri: "/operationB") | ||
operation OperationB {} |