配置访问控制以限制谁可以访问您的内容。使用IP限制、地理区域屏蔽和身份验证来保护敏感资源。
| 方法 | 描述 |
|---|---|
| IP限制 | 允许/阻止特定IP |
| 地理区域屏蔽 | 按国家/地区屏蔽 |
| 令牌验证 | URL令牌验证 |
{
"ip_access": {
"mode": "allowlist",
"ips": ["10.0.0.0/8", "192.168.1.0/24"]
}
}
{
"ip_access": {
"mode": "blocklist",
"ips": ["1.2.3.4", "5.6.7.8"]
}
}
{
"geo_blocking": {
"action": "block",
"countries": ["XX", "YY"]
}
}
function generateSignedUrl(url, secret, expiry) {
const expires = Math.floor(Date.now() / 1000) + expiry;
const signature = crypto
.createHmac("sha256", secret)
.update(url + expires)
.digest("hex");
return url + "?expires=" + expires + "&signature=" + signature;
}
curl -X GET https://api.Sudun.com/v1/domains/{domain}/access \
-H "Authorization: Bearer YOUR_API_KEY"
需要帮助?请联系 support@Sudun.com