Content Acceleration,Dynamic Web Acceleration
Modify timestamp anti-theft chain custom configuration item content
Single user trigger frequency: 300/5min
| Name | Description |
|---|---|
*domainString | Domain ID or domain name. |
| Name | Description |
|---|---|
*timestamp-visit-control-ruleObject | |
path-patternString | The url matching mode supports fuzzy regularization. If all matches, the input parameters can be configured as:.
Verify the time stamp of the matched URL for anti-leeching; reject URLs that are not matched. |
except-path-patternString | Exceptional url matching mode, except for some URLs: such as abc.jpg, do not do anti-theft chain function |
protocol-of-path-patternString | Optional values are: http, https, http;https, noprefix, empty. If it is empty, it defaults to "http;https"; if it is noprefix, it means that the protocol prefix of url is not specified, and it only matches according to the regularity of path-pattern. This configuration item only matches with path-pattern. example: 1. Specify protocol-of-path-pattern=https and path-pattern=.* to match all https requests, but not http requests. 2. Specify protocol-of-path-pattern=http;https, path-pattern=.* to match all http and https requests. 3. Specify protocol-of-path-pattern=noprefix and path-pattern=^http://[^/]+/.* to match all http requests but not https requests. |
directoryString | Directory, multiple separated by English semicolons. Perform timestamp anti-leech verification for the matched directory; reject the unmatched directory. mutually exclusive with path-pattern. |
allowed-ipsString | Exceptional IP, supports input of IP or IP range, separate IP ranges with semicolons (;), such as 1.1.1.0/24;2.2.2.2, some IP exceptions, no anti-leeching. |
ignore-uri-slashString | Whether to remove / from $uri in anti-leech, the optional values are true or false, and the default is false, that is, it contains /. For example: http://www.test.com/1.flv, then $uri is /1.flv by default, if ignore-uri-slash is true, then $uri is 1.flv |
ignore-key-and-time-positionString | Whether key and time are allowed to be interchanged, the optional values are true and false, true is allowed, false is not allowed. By default, the order of key parameters and time parameters must strictly follow the order required by the authentication mode, that is, the default key and time cannot be interchanged. If true is selected, the key and time positions can be interchanged and the authentication succeeds. |
encrypt-methodString | Encryption Algorithm. Support value: md5sum |
cipher-combinationString | The anti-leech chain generation method, the parameters involved in the MD5 calculation and the combination sequence only support the following parameters: $uri: A string between domain and question mark, special values are configured in the input parameter |
secret-keyString | The key of the anti-leech encryption string, only one key is allowed to be passed in Example: |
cipher-paramString | Parameter name of the anti-leech string Example: |
time-paramString | Parameter name for time string Example: |
lower-limit-expiry-timeInteger | The lower limit of the expiration time of the anti-leech chain Example: |
upper-limit-expiry-timeInteger | The upper limit of the expiration time of the anti-leech chain Example: |
multiple-secret-keysString | Anti-leech encrypted string, multiple encrypted strings are supported, and multiple encrypted strings are separated by semicolons (;) Example: |
time-formatString | The time format of the anti-leech encryption string,
Year|Month|Day|Hour|Minute|Second:1Y;2m;3d;4H;5M;6S
UNIX timestamp:7s
Millisecond-level UNIX timestamp:7s;9ms
Hexadecimal timestamp:8x
Notice: The format is fixed; numbers and letters must not be changed, and each value can only appear once. |
request-url-styleString | The anti-leech request url format supports two anti-leech methods, that is, the encrypted string and timestamp are placed after "?" or the encrypted string and timestamp are placed after "host". The parameters supported by the url format are as follows: $domain: domain name $uri: the url part that does not contain the domain name $key: MD5 value of anti-leech encrypted string $time: Anti-leech time string $args: the QUERY_STRING parameter after the question mark Example: The following request url format is supported, which can be replaced with https://. The url request protocol is based on actual use. If you don't know how to configure it correctly, please ask customer technical support for assistance; the parameter name carrying two values of encrypted string and time string" keyname" and "tname", which can be replaced by the actual parameter names used |
dst-styleInteger | Anti-leech back-to-source method, optional values: 1 (use unencrypted url to go back to the source), 2 (use the customer request to return to the source with encrypted string url) Example: |
log-formatString | Logging original url, optional values: true (logging original url), false (do not enable logging original url) |
url-keyString | Used to configure the name of the key in the url Example: |
special-encryptionString | Special encryption, values: 1 to enable, or leave blank |
effective-timeString | Effective time, unit:s |
except-file-typeString | Exceptional file type, multiple values separated by English semicolons (;), optional values: f4m ico m3u8 wmv jpeg shtml wma ts png zip bmp css html txt gif swf js bootstarp rar xml flv exe jpg htm mp4 mp3
Example: |
except-custom-file-typeString | Exceptional custom file type, multiple values separated by English semicolons (;)
Example: |
| Name | Description |
|---|---|
x-cnc-request-idString | Uniquely identified id for querying tasks per request (for all API) |
| Name | Description |
|---|---|
codeString | Error code. It pops up when the HTTPStatus is not 202, and shows the revoking error type of the current request. |
messageString | Response message, and shows as success when it succeeds. |
| Error code(code) | Description(message) | HTTP status | Semantic |
|---|---|---|---|
| InternalError | We encountered an internal error. Please try again. | 500 | We encountered an internal error. Please try again. |
| InvalidParameter | No domain was specified. | 400 | No domain was specified. |
| NoSuchDomain | The specified domain does not exist. | 404 | The specified domain does not exist. |
| ConfigError | The config {} does not access. | 400 | The config {} does not access. |
| DomainNotRestored | The domain you are trying to cancel has not been restored. | 409 | The domain you are trying to cancel has not been restored. |
| Forbidden | The domain is being deleted | 403 | The domain is being deleted |
| WrongDataId | Wrong data-d. | 400 | Wrong data-d. |
| InternalError | We encountered an internal error. Please try again. | 500 | We encountered an internal error. Please try again. |
| NoSuchDomain | The specified domain does not exist. | 404 | The specified domain does not exist. |
| CustomerNoOwnDomain | customer not own domain name[*] | 400 | customer not own domain name[*] |
| InvalidParameter | No domain was specified. | 400 | No domain was specified. |
| InvalidParameter | The specified allowed-ips was invalid. | 400 | The specified allowed-ips was invalid. |
| InvalidParameter | The specified cipher-combination was invalid. | 400 | The specified cipher-combination was invalid. |
| InvalidParameter | The specified lower-limit-expiry-time must be digits. | 400 | The specified lower-limit-expiry-time must be digits. |
| InvalidParameter | The specified upper-limit-expiry-time must be digits. | 400 | The specified upper-limit-expiry-time must be digits. |
| InvalidParameter | The specified time-format was invalid. | 400 | The specified time-format was invalid. |
| InvalidParameter | The time-format's value separated by semicolon can appear only once. | 400 | The time-format's value separated by semicolon can appear only once. |
| InvalidParameter | The specified request-url-style was invalid. | 400 | The specified request-url-style was invalid. |
| InvalidParameter | The specified dst-style is either 1 or 2. | 400 | The specified dst-style is either 1 or 2. |
| InvalidParameter | The specified encrypt-method was invalid. | 400 | The specified encrypt-method was invalid. |
| InvalidParameter | The specified log-format was invalid. | 400 | The specified log-format was invalid. |
| InvalidParameter | The specified m3u8 was invalid. | 400 | The specified m3u8 was invalid. |
| InvalidParameter | The path-pattern is required when path-pattern-protocol has value. | 400 | The path-pattern is required when path-pattern-protocol has value. |
| InvalidParameter | The specified (timestamp-control-rule/path-pattern-protocol) was invalid. | 400 | The specified (timestamp-control-rule/path-pattern-protocol) was invalid. |
| InvalidParameter | The except-path-pattern is required when except-path-pattern-protocol has value. | 400 | The except-path-pattern is required when except-path-pattern-protocol has value. |
| InvalidParameter | The specified (timestamp-control-rule/except-path-pattern-protocol) was invalid. | 400 | The specified (timestamp-control-rule/except-path-pattern-protocol) was invalid. |
| InvalidParameter | The specified (timestamp-control-rule/cipher-combination) was invalid. | 400 | The specified (timestamp-control-rule/cipher-combination) was invalid. |
| InvalidParameter | The specified (timestamp-control-rule/lower-limit-expiry-time) must be digits. | 400 | The specified (timestamp-control-rule/lower-limit-expiry-time) must be digits. |
| InvalidParameter | The specified (timestamp-control-rule/upper-limit-expiry-time) must be digits. | 400 | The specified (timestamp-control-rule/upper-limit-expiry-time) must be digits. |
| InvalidParameter | The specified (timestamp-control-rule/request-url-style) was invalid. | 400 | The specified (timestamp-control-rule/request-url-style) was invalid. |
| InvalidParameter | The (timestamp-control-rule/uri-select) was invalid. | 400 | The (timestamp-control-rule/uri-select) was invalid. |
| InvalidParameter | Conflicting request parameters,The parameters "cipher-combination|secret-key|cipher-param|time-param|lower-limit-expiry-time|upper-limit-expiry-time" must only exist in "timestamp-visit-control-rule" or "timestamp-control-rules". | 400 | Conflicting request parameters,The parameters "cipher-combination|secret-key|cipher-param|time-param|lower-limit-expiry-time|upper-limit-expiry-time" must only exist in "timestamp-visit-control-rule" or "timestamp-control-rules". |
| InvalidParameter | Conflicting request parameters, The parameters "request-url-style" must only exist in "timestamp-visit-control-rule" or "timestamp-control-rules". | 400 | Conflicting request parameters, The parameters "request-url-style" must only exist in "timestamp-visit-control-rule" or "timestamp-control-rules". |
| MalformedXML | 400 | <![CDATA[cvc-pattern-valid: element request-url-style is invalid. the $key's parameter key is inconsistent with the value of element cipher-param.]]> | |
| ConfigError | [The format of request URL] just one value can be configured. | 400 | [The format of request URL] just one value can be configured. |
| ConfigError | [Access Control generation method] just one value can be configured. | 400 | [Access Control generation method] just one value can be configured. |
| InvalidParameter | The path-pattern and directory cannot have values at the same time. | 400 | The path-pattern and directory cannot have values at the same time. |
#!/bin/bash
username="example_username"
apiKey="example_apiKey"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://{@apiDomain}/api/config/timecontrol/www.aaa.com" \
-X "PUT" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"timestamp-visit-control-rule":{
"path-pattern":"/*",
"except-path-pattern":"/*",
"allowed-ips":"1.1.1.1",
"cipher-combination":"$uri$ourkey$time$args{param1}",
"secret-key":"ad",
"cipher-param":"keyname",
"time-param":"tname",
"lower-limit-expiry-time":"60",
"upper-limit-expiry-time":"60",
"multiple-secret-keys":"60",
"time-format":"1Y;2m;3d;4H;5M;6S",
"request-url-style":"http://$domain/$uri?$args&keyname=$key&tname=$time",
"dst-style":"1",
"encrypt-method":"md5sum",
"special-encryption": "1",
"effective-time": "10"
}
}'HTTP/1.1 202 Accepted
Server: openresty/1.11.2.2
Date: Wed, 15 May 2019 07:31:43 GMT
Content-Type: application/json;charset=utf-8
Content-Length: 60
Connection: keep-alive
App-Name: service_confApi
x-cnc-request-id: 5c429816-5fda-4d6d
{
"message":"success",
"code":""
}