Add v4 sig to http cache (#741)

* FS-9676 [mod_http_cache] Support for AWS Signature version 4 and drop support for version 2

Co-authored-by: baonq-me <quocbao747@gmail.com>
This commit is contained in:
Chris Rienzoandbaonq-me authored and GitHub committed 2020-07-20 15:34:55 -04:00
1 parent 90fb233ac6
commit 17ebce7e3b
8 files changed
+931 -300

No files matched your search

@@ -1,47 +1,74 @@
<?xml version="1.0"?>
<configuration name="http_cache.conf" description="HTTP GET cache">
<settings>
<!-- set to true if you want to enable http:// and https:// formats. Do not use if mod_httapi is also loaded -->
<param name="enable-file-formats" value="false"/>
<param name="max-urls" value="10000"/>
<param name="location" value="$${base_dir}/http_cache"/>
<param name="default-max-age" value="86400"/>
<param name="ssl-cacert" value="$${base_dir}/conf/cacert.pem"/>
<param name="ssl-verifyhost" value="true"/>
<param name="ssl-verifypeer" value="true"/>
<!-- default is 300 seconds, override here -->
<!--param name="connect-timeout" value="300"/-->
<!-- default is 300 seconds, override here -->
<!--param name="download-timeout" value="300"/-->
</settings>
<settings>
<!-- set to true if you want to enable http:// and https:// formats. Do not use if mod_httapi is also loaded -->
<param name="enable-file-formats" value="false"/>
<param name="max-urls" value="10000"/>
<param name="location" value="$${base_dir}/http_cache"/>
<param name="default-max-age" value="86400"/>
<param name="ssl-cacert" value="$${base_dir}/conf/cacert.pem"/>
<param name="ssl-verifyhost" value="true"/>
<param name="ssl-verifypeer" value="true"/>
<!-- default is 300 seconds, override here -->
<!--param name="connect-timeout" value="300"/-->
<!-- default is 300 seconds, override here -->
<!--param name="download-timeout" value="300"/-->
</settings>
<profiles>
<profile name="s3">
<!-- Credentials for AWS account. -->
<aws-s3>
<!-- Required: Key identifier -->
<access-key-id><![CDATA[AKIAIOSFODNN7EXAMPLE]]></access-key-id>
<!-- Required: Key secret -->
<secret-access-key><![CDATA[wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY]]></secret-access-key>
<!-- Optional: Backup folder to save uploaded file in case of failure (for example recording a .wav file to a webserver). Must ended without a slash !-->
<!-- If you want to use your own s3-compatible service, base domain MUST be set -->
<!--<base-domain><![CDATA[stg.vinadata.vn]]></base-domain>-->
<!-- Required: AWS region -->
<region><![CDATA[ap-southeast-1]]></region> <!-- base domain is s3-ap-southeast-1.amazonaws.com -->
<!-- Optional: Expiration time in seconds for URL signature. Default is 604800s -->
<expires>604800</expires>
</aws-s3>
<profiles>
<profile name="s3">
<!-- Credentials for AWS account. -->
<aws-s3>
<!-- 20 character key identifier, can override with AWS_ACCESS_KEY_ID environment variable -->
<access-key-id><![CDATA[AKIAIOSFODNN7EXAMPLE]]></access-key-id>
<!-- 40 character secret, can override with AWS_SECRET_ACCESS_KEY environment variable -->
<secret-access-key><![CDATA[wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY]]></secret-access-key>
<!--base-url><![CDATA[s3.example.com]]></base-url-->
</aws-s3>
<!-- Domains that this profile applies to -->
<domains>
<domain name="bucket.s3.amazonaws.com"/>
<domain name="bucket2.s3.amazonaws.com"/>
</domains>
</profile>
<profile name="blob">
<azure-blob>
<!-- key identifier, can override with AZURE_STORAGE_ACCESS_KEY environment variable -->
<secret-access-key>kOOY4Y/sqZU9bsLjmN+9McVwTry+UIn1Owt4Zs/2S2FQT0eAWLKsk
Z0V6/gGFqCAKVvwXoGjqUn7PNbVjhZiNA==</secret-access-key>
</azure-blob>
<domains>
<domain name="account.blob.core.windows.net"/>
</domains>
</profile>
</profiles>
<!-- Required: Domains that this profile will automatically be applied. Domains must have the same base domain (s3-ap-southeast-1.amazonaws.com) -->
<domains>
<domain name="bucket1.s3-ap-southeast-1.amazonaws.com"/>
<domain name="bucket2.s3-ap-southeast-1.amazonaws.com"/>
</domains>
</profile>
<profile name="s3-compatible">
<!-- Credentials for AWS account or any account on s3-like storage service -->
<aws-s3>
<!-- Required: Key identifier -->
<access-key-id><![CDATA[506665ebbbaffc1701aaf5a61ad88421]]></access-key-id>
<!-- Required: Key secret -->
<secret-access-key><![CDATA[2dd63d700744e2c1c277be7dc81bfb1b]]></secret-access-key>
<!-- Optional: Base domain for the service -->
<!-- If you want to use your own s3-compatible service, base domain MUST be set -->
<base-domain><![CDATA[stg.vinadata.vn]]></base-domain>
<!-- Required: Storage region -->
<region><![CDATA[HCM]]></region>
<!-- Optional: Expiration time in seconds for URL signature. Default is 604800s (a week) -->
<expires>604800</expires>
</aws-s3>
<!-- Optional: List of domains that this profile will automatically be applied to -->
<!-- Domains in this list must have the same base domain with base-domain (if base-domain is set) -->
<!-- If you wish to apply the s3 credentials to a domain not listed here, then use {profile=s3}http://foo.s3... -->
<domains>
<domain name="bucket1.stg.vinadata.vn"/>
<domain name="bucket2.stg.vinadata.vn"/>
</domains>
</profile>
<profile name="blob">
<azure-blob>
<!-- key identifier, can override with AZURE_STORAGE_ACCESS_KEY environment variable -->
<secret-access-key>kOOY4Y/sqZU9bsLjmN+9McVwTry+UIn1Owt4Zs/2S2FQT0eAWLKskZ0V6/gGFqCAKVvwXoGjqUn7PNbVjhZiNA==</secret-access-key>
</azure-blob>
<domains>
<domain name="account.blob.core.windows.net"/>
</domains>
</profile>
</profiles>
</configuration>