Skip to content

Commit 9516ec1

Browse files
Added support for mobile app restrictions in Amazon Location API keys.
1 parent 2f9fc95 commit 9516ec1

File tree

61 files changed

+8005
-763
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+8005
-763
lines changed

generator/ServiceModels/location/location-2020-11-19.api.json

Lines changed: 204 additions & 100 deletions
Large diffs are not rendered by default.

generator/ServiceModels/location/location-2020-11-19.docs.json

Lines changed: 229 additions & 304 deletions
Large diffs are not rendered by default.

generator/ServiceModels/location/location-2020-11-19.endpoint-rule-set.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@
55
"builtIn": "AWS::Region",
66
"required": false,
77
"documentation": "The AWS region used to dispatch the request.",
8-
"type": "String"
8+
"type": "string"
99
},
1010
"UseDualStack": {
1111
"builtIn": "AWS::UseDualStack",
1212
"required": true,
1313
"default": false,
1414
"documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.",
15-
"type": "Boolean"
15+
"type": "boolean"
1616
},
1717
"UseFIPS": {
1818
"builtIn": "AWS::UseFIPS",
1919
"required": true,
2020
"default": false,
2121
"documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.",
22-
"type": "Boolean"
22+
"type": "boolean"
2323
},
2424
"Endpoint": {
2525
"builtIn": "SDK::Endpoint",
2626
"required": false,
2727
"documentation": "Override the endpoint used to send this request",
28-
"type": "String"
28+
"type": "string"
2929
}
3030
},
3131
"rules": [
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"version": "1.0",
3-
"examples": {
4-
}
3+
"examples": {}
54
}

generator/ServiceModels/location/location-2020-11-19.normal.json

Lines changed: 249 additions & 128 deletions
Large diffs are not rendered by default.

sdk/code-analysis/ServiceAnalysis/LocationService/Generated/PropertyValueRules.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,24 @@
10071007
<max>100</max>
10081008
<pattern>[-._\p{L}\p{N}]+</pattern>
10091009
</property-value-rule>
1010+
<property-value-rule>
1011+
<property>Amazon.LocationService.Model.AndroidApp.CertificateFingerprint</property>
1012+
<min>59</min>
1013+
<max>59</max>
1014+
<pattern>([A-Fa-f0-9]{2}:){19}[A-Fa-f0-9]{2}</pattern>
1015+
</property-value-rule>
1016+
<property-value-rule>
1017+
<property>Amazon.LocationService.Model.AndroidApp.Package</property>
1018+
<min>1</min>
1019+
<max>255</max>
1020+
<pattern>([A-Za-z][A-Za-z\d_]*\.)+[A-Za-z][A-Za-z\d_]*</pattern>
1021+
</property-value-rule>
1022+
<property-value-rule>
1023+
<property>Amazon.LocationService.Model.AppleApp.BundleId</property>
1024+
<min>1</min>
1025+
<max>155</max>
1026+
<pattern>[A-Za-z0-9\-]+(\.[A-Za-z0-9\-]+)+</pattern>
1027+
</property-value-rule>
10101028
<property-value-rule>
10111029
<property>Amazon.LocationService.Model.BatchDeleteDevicePositionHistoryError.DeviceId</property>
10121030
<min>1</min>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the location-2020-11-19.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
#pragma warning disable CS0612,CS0618,CS1570
30+
namespace Amazon.LocationService.Model
31+
{
32+
/// <summary>
33+
/// Unique identifying information for an Android app. Consists of a package name and
34+
/// a 20 byte SHA-1 certificate fingerprint.
35+
/// </summary>
36+
public partial class AndroidApp
37+
{
38+
private string _certificateFingerprint;
39+
private string _package;
40+
41+
/// <summary>
42+
/// Gets and sets the property CertificateFingerprint.
43+
/// <para>
44+
/// 20 byte SHA-1 certificate fingerprint associated with the Android app signing certificate.
45+
/// </para>
46+
/// </summary>
47+
[AWSProperty(Required=true, Min=59, Max=59)]
48+
public string CertificateFingerprint
49+
{
50+
get { return this._certificateFingerprint; }
51+
set { this._certificateFingerprint = value; }
52+
}
53+
54+
// Check to see if CertificateFingerprint property is set
55+
internal bool IsSetCertificateFingerprint()
56+
{
57+
return this._certificateFingerprint != null;
58+
}
59+
60+
/// <summary>
61+
/// Gets and sets the property Package.
62+
/// <para>
63+
/// Unique package name for an Android app.
64+
/// </para>
65+
/// </summary>
66+
[AWSProperty(Required=true, Min=1, Max=255)]
67+
public string Package
68+
{
69+
get { return this._package; }
70+
set { this._package = value; }
71+
}
72+
73+
// Check to see if Package property is set
74+
internal bool IsSetPackage()
75+
{
76+
return this._package != null;
77+
}
78+
79+
}
80+
}

sdk/src/Services/LocationService/Generated/Model/ApiKeyRestrictions.cs

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ namespace Amazon.LocationService.Model
3535
public partial class ApiKeyRestrictions
3636
{
3737
private List<string> _allowActions = AWSConfigs.InitializeCollections ? new List<string>() : null;
38+
private List<AndroidApp> _allowAndroidApps = AWSConfigs.InitializeCollections ? new List<AndroidApp>() : null;
39+
private List<AppleApp> _allowAppleApps = AWSConfigs.InitializeCollections ? new List<AppleApp>() : null;
3840
private List<string> _allowReferers = AWSConfigs.InitializeCollections ? new List<string>() : null;
3941
private List<string> _allowResources = AWSConfigs.InitializeCollections ? new List<string>() : null;
4042

@@ -188,6 +190,56 @@ internal bool IsSetAllowActions()
188190
return this._allowActions != null && (this._allowActions.Count > 0 || !AWSConfigs.InitializeCollections);
189191
}
190192

193+
/// <summary>
194+
/// Gets and sets the property AllowAndroidApps.
195+
/// <para>
196+
/// An optional list of allowed Android applications for which requests must originate
197+
/// from. Requests using this API key from other sources will not be allowed.
198+
/// </para>
199+
/// <para />
200+
/// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned
201+
/// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller
202+
/// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous
203+
/// SDK behavior set the AWSConfigs.InitializeCollections static property to true.
204+
/// </summary>
205+
[AWSProperty(Min=0, Max=5)]
206+
public List<AndroidApp> AllowAndroidApps
207+
{
208+
get { return this._allowAndroidApps; }
209+
set { this._allowAndroidApps = value; }
210+
}
211+
212+
// Check to see if AllowAndroidApps property is set
213+
internal bool IsSetAllowAndroidApps()
214+
{
215+
return this._allowAndroidApps != null && (this._allowAndroidApps.Count > 0 || !AWSConfigs.InitializeCollections);
216+
}
217+
218+
/// <summary>
219+
/// Gets and sets the property AllowAppleApps.
220+
/// <para>
221+
/// An optional list of allowed Apple applications for which requests must originate from.
222+
/// Requests using this API key from other sources will not be allowed.
223+
/// </para>
224+
/// <para />
225+
/// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned
226+
/// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller
227+
/// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous
228+
/// SDK behavior set the AWSConfigs.InitializeCollections static property to true.
229+
/// </summary>
230+
[AWSProperty(Min=0, Max=5)]
231+
public List<AppleApp> AllowAppleApps
232+
{
233+
get { return this._allowAppleApps; }
234+
set { this._allowAppleApps = value; }
235+
}
236+
237+
// Check to see if AllowAppleApps property is set
238+
internal bool IsSetAllowAppleApps()
239+
{
240+
return this._allowAppleApps != null && (this._allowAppleApps.Count > 0 || !AWSConfigs.InitializeCollections);
241+
}
242+
191243
/// <summary>
192244
/// Gets and sets the property AllowReferers.
193245
/// <para>
@@ -232,7 +284,7 @@ internal bool IsSetAllowActions()
232284
/// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous
233285
/// SDK behavior set the AWSConfigs.InitializeCollections static property to true.
234286
/// </summary>
235-
[AWSProperty(Min=1, Max=5)]
287+
[AWSProperty(Min=0, Max=5)]
236288
public List<string> AllowReferers
237289
{
238290
get { return this._allowReferers; }
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the location-2020-11-19.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
#pragma warning disable CS0612,CS0618,CS1570
30+
namespace Amazon.LocationService.Model
31+
{
32+
/// <summary>
33+
/// Unique identifying information for an Apple app (iOS, macOS, tvOS and watchOS). Consists
34+
/// of an Apple Bundle ID.
35+
/// </summary>
36+
public partial class AppleApp
37+
{
38+
private string _bundleId;
39+
40+
/// <summary>
41+
/// Gets and sets the property BundleId.
42+
/// <para>
43+
/// The unique identifier of the app across all Apple platforms (iOS, macOS, tvOS, watchOS,
44+
/// etc.)
45+
/// </para>
46+
/// </summary>
47+
[AWSProperty(Required=true, Min=1, Max=155)]
48+
public string BundleId
49+
{
50+
get { return this._bundleId; }
51+
set { this._bundleId = value; }
52+
}
53+
54+
// Check to see if BundleId property is set
55+
internal bool IsSetBundleId()
56+
{
57+
return this._bundleId != null;
58+
}
59+
60+
}
61+
}

sdk/src/Services/LocationService/Generated/Model/CalculateRouteCarModeOptions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public partial class CalculateRouteCarModeOptions
5252
/// Valid Values: <c>false</c> | <c>true</c>
5353
/// </para>
5454
/// </summary>
55+
[AWSProperty(Sensitive=true)]
5556
public bool? AvoidFerries
5657
{
5758
get { return this._avoidFerries; }
@@ -78,6 +79,7 @@ internal bool IsSetAvoidFerries()
7879
/// Valid Values: <c>false</c> | <c>true</c>
7980
/// </para>
8081
/// </summary>
82+
[AWSProperty(Sensitive=true)]
8183
public bool? AvoidTolls
8284
{
8385
get { return this._avoidTolls; }

0 commit comments

Comments
 (0)