|
15 | 15 | # specific language governing permissions and limitations under the |
16 | 16 | # License. |
17 | 17 | # |
| 18 | +import os |
18 | 19 |
|
19 | 20 | #: Header key to be used, to retrieve request header that contains the |
20 | 21 | #: URL for the certificate chain needed to verify the request signature. |
21 | | -#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#checking-the-signature-of-the-request>`__. |
| 22 | +#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#check-request-signature>`__. |
22 | 23 | SIGNATURE_CERT_CHAIN_URL_HEADER = "SignatureCertChainUrl" |
23 | 24 |
|
24 | 25 | #: Header key to be used, to retrieve request header that contains the |
25 | 26 | #: request signature. |
26 | | -#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#checking-the-signature-of-the-request>`__. |
| 27 | +#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#check-request-signature>`__. |
27 | 28 | SIGNATURE_HEADER = "Signature" |
28 | 29 |
|
29 | 30 | #: Case insensitive protocol to be checked on signature certificate url. |
30 | | -#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#cert-verify-signature-certificate-url>`__. |
| 31 | +#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#check-request-signature>`__. |
31 | 32 | CERT_CHAIN_URL_PROTOCOL = "https" |
32 | 33 |
|
33 | 34 | #: Case insensitive hostname to be checked on signature certificate url. |
34 | | -#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#cert-verify-signature-certificate-url>`__. |
| 35 | +#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#check-request-signature>`__. |
35 | 36 | CERT_CHAIN_URL_HOSTNAME = "s3.amazonaws.com" |
36 | 37 |
|
37 | 38 | #: Path presence to be checked on signature certificate url. |
38 | | -#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#cert-verify-signature-certificate-url>`__. |
39 | | -CERT_CHAIN_URL_STARTPATH = "/echo.api/" |
| 39 | +#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#check-request-signature>`__. |
| 40 | +CERT_CHAIN_URL_STARTPATH = "{0}echo.api{0}".format(os.path.sep) |
40 | 41 |
|
41 | 42 | #: Port to be checked on signature certificate url. |
42 | | -#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#cert-verify-signature-certificate-url>`__. |
| 43 | +#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#check-request-signature>`__. |
43 | 44 | CERT_CHAIN_URL_PORT = 443 |
44 | 45 |
|
45 | 46 | #: Domain presence check in Subject Alternative Names (SANs) of |
46 | 47 | #: signing certificate. |
47 | | -#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#checking-the-signature-of-the-request>`__. |
| 48 | +#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#check-request-signature>`__. |
48 | 49 | CERT_CHAIN_DOMAIN = "echo-api.amazon.com" |
49 | 50 |
|
50 | 51 | #: Character encoding used in the request. |
51 | 52 | CHARACTER_ENCODING = "utf-8" |
52 | 53 |
|
53 | 54 | #: Default allowable tolerance in request timestamp. |
54 | | -#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#timestamp>`__. |
55 | | -DEFAULT_TIMESTAMP_TOLERANCE_IN_MILLIS = 30000 |
| 55 | +#: For more info, check `link <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#check-request-timestamp>`__. |
| 56 | +DEFAULT_TIMESTAMP_TOLERANCE_IN_MILLIS = 150000 |
56 | 57 |
|
57 | 58 | #: Maximum allowable tolerance in request timestamp. |
58 | 59 | #: For more info, check `link <https://developer.amazon.com/docs/smapi/skill-events-in-alexa-skills.html#delivery-of-events-to-the-skill>`__. |
|
0 commit comments