Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oss下载签名地址过期时间无效(偶现) #355

Open
ghost opened this issue Nov 3, 2022 · 0 comments
Open

oss下载签名地址过期时间无效(偶现) #355

ghost opened this issue Nov 3, 2022 · 0 comments

Comments

@ghost
Copy link

ghost commented Nov 3, 2022

func (bucket Bucket) SignURL(objectKey string, method HTTPMethod, expiredInSec int64, options ...Option) (string, error) {

client, err := oss.New(endpoint, creds.AccessKeyId, creds.AccessKeySecret, oss.SecurityToken(creds.SecurityToken))
if v.Err = err; err != nil {
	return
}
bucket, err := client.Bucket(v.Bucket)
if v.Err = err; err != nil {
	return
}
v.Url, v.Err = bucket.SignURL(v.Obj, oss.HTTPGet, 60*2)

上面生成client用的creds是sts.Credentials,生成的下载连接即使过了很久(远大于2min)还是可以用,不是必现的,偶尔出现,频率还挺高的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants