Install any skill in seconds. Free to start, no credit card required.
Get Started Free →doccker/storage-url-safety
当使用 MinIO/OSS/S3 等对象存储、设计文件上传下载功能时触发。提供存储 URL 策略选择规范,防止 URL 过期、访问失败等问题。
Passed 22 of 22 test cases with the skill, and 16 of 22 without it.
and 5 more in the full report
6 fixed17 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 5 test cases the skill fixed. Same model, same prompt, with and without the skill.
我们系统目前在使用 Spring Boot 接 MinIO,现在需要实现两个功能:一是给用户生成导出的 Excel 报表下载链接,二是生成前端直接上传用户头像的获取凭证接口。请帮我编写这两个 API 的后端 Java 代码实现,并对在对象存储应用中可能存在的链接失效或安全隐患进行评估和纠错。
| Checked | Without skill | With skill |
|---|---|---|
| The Excel report download link presigned URL expiry duration is set between 1 hour and 7 days. | Passed | Passed |
| The upload token generation logic validates the incoming file size parameter. | Missed | Passed |
The instructions your model reads when the skill loads.
当使用 MinIO/OSS/S3 等对象存储时,正确选择 URL 生成策略。
场景: 头像、Logo、商品图等需要长期访问的资源
预签名 URL 有时效限制(MinIO/S3 最大 7 天),头像等长期资源会过期导致无法访问。
// ❌ 错误: 预签名 URL 最大 7 天,头像会过期
String avatarUrl = minioService.getPresignedUrl(filePath, 60 * 24 * 365);
// IllegalArgumentException: expiry must be minimum 1 second to maximum 7 days
// ❌ 错误: 即使设置 7 天,头像也会在 7 天后失效
String avatarUrl = minioService.getPresignedUrl(filePath, 60 * 24 * 7);
// 7 天后用户头像显示"图片加载失败"
// ✅ 方案1: 公开 URL(需配置 bucket 公开读)
public String getPublicUrl(String filePath) {
String endpoint = minioConfig.getEndpoint();
if (endpoint.endsWith("/")) {
endpoint = endpoint.substring(0, endpoint.length() - 1);
}
return endpoint + "/" + minioConfig.getBucketName() + "/" + filePath;
}
String avatarUrl = minioService.getPublicUrl(filePath);
// 返回: http://minio:9000/bucket/avatars/xxx.jpeg
test cases passed, vs 16 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.