Skip to content

Commit 53b1372

Browse files
authored
Merge pull request #39 from fwenjing12/arnCorrection
Removed "*" as default segments of Arn
2 parents 0f7f3d9 + c065464 commit 53b1372

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

blueprints/dotnet/src/APIGatewayAuthorizerHandler/AuthPolicyBuilder.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,14 @@ public AuthPolicyBuilder(string principalId, string awsAccountId, ApiOptions api
5959
PrincipalId = principalId;
6060
AwsAccountId = awsAccountId;
6161

62-
_restApiId = string.IsNullOrWhiteSpace(apiOptions?.RestApiId) ? "*" : apiOptions.RestApiId;
63-
_region = string.IsNullOrWhiteSpace(apiOptions?.Region) ? "*" : apiOptions.Region;
64-
_stage = string.IsNullOrWhiteSpace(apiOptions?.Stage) ? "*" : apiOptions.Stage;
62+
// Replace the placeholder value with a default API Gateway API id, or '*' for all APIs.
63+
_restApiId = string.IsNullOrWhiteSpace(apiOptions?.RestApiId) ? "<<restApiId>>" : apiOptions.RestApiId;
64+
65+
// Replace the placeholder value with a default region where the API is deployed, or '*' for all regions.
66+
_region = string.IsNullOrWhiteSpace(apiOptions?.Region) ? "<<region>>" : apiOptions.Region;
67+
68+
// Replace the placeholder value with a default stage name used in the policy, or '*' for all stages.
69+
_stage = string.IsNullOrWhiteSpace(apiOptions?.Stage) ? "<<stage>>" : apiOptions.Stage;
6570
}
6671

6772
public void DenyAllMethods(ICollection<Condition> conditions = null)

blueprints/go/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ func NewAuthorizerResponse(principalID string, AccountID string) *AuthorizerResp
155155
Version: "2012-10-17",
156156
},
157157
},
158-
Region: "*",
158+
Region: "<<region>>", // Replace the placeholder value with the region where the API is deployed, or '*' for all regions.
159159
AccountID: AccountID,
160-
APIID: "*",
161-
Stage: "*",
160+
APIID: "<<restApiId>>", // Replace the placeholder value with an API Gateway API id, or '*' for all APIs.
161+
Stage: "<<stage>>", // Replace the placeholder value with the name of the stage used in the policy, or '*' for all stages.
162162
}
163163
}
164164

blueprints/nodejs/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,17 @@ function AuthPolicy(principal, awsAccountId, apiOptions) {
140140
this.denyMethods = [];
141141

142142
if (!apiOptions || !apiOptions.restApiId) {
143-
this.restApiId = "*";
143+
this.restApiId = "<<restApiId>>"; // Replace the placeholder value with a default API Gateway API id, or '*' for all APIs.
144144
} else {
145145
this.restApiId = apiOptions.restApiId;
146146
}
147147
if (!apiOptions || !apiOptions.region) {
148-
this.region = "*";
148+
this.region = "<<region>>"; // Replace the placeholder value with a default region where the API is deployed, or '*' for all regions.
149149
} else {
150150
this.region = apiOptions.region;
151151
}
152152
if (!apiOptions || !apiOptions.stage) {
153-
this.stage = "*";
153+
this.stage = "<<stage>>"; // Replace the placeholder value with a default stage name used in the policy, or '*' for all stages.
154154
} else {
155155
this.stage = apiOptions.stage;
156156
}

blueprints/python/api-gateway-authorizer-python.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,13 @@ class AuthPolicy(object):
9898
allowMethods = []
9999
denyMethods = []
100100

101-
restApiId = "*"
102-
"""The API Gateway API id. By default this is set to '*'"""
103-
region = "*"
104-
"""The region where the API is deployed. By default this is set to '*'"""
105-
stage = "*"
106-
"""The name of the stage used in the policy. By default this is set to '*'"""
101+
102+
restApiId = "<<restApiId>>"
103+
"""Replace the placeholder value with an API Gateway API id, or '*' for all APIs."""
104+
region = "<<region>>"
105+
"""Replace the placeholder value with the region where the API is deployed, or '*' for all regions."""
106+
stage = "<<stage>>"
107+
"""Replace the placeholder value with the name of the stage used in the policy, or '*' for all stages."""
107108

108109
def __init__(self, principal, awsAccountId):
109110
self.awsAccountId = awsAccountId

0 commit comments

Comments
 (0)