使用 boto3 创建的预签名 s3 URL 的默认到期时间是多少

What is the default expiration of presigned s3 URL created with boto3

这里我在生成 URL 时没有给出任何过期时间。那么我的URL有效期是多久?

        client = boto3.client('s3',
              region_name=settings.BUCKET_NAME,
              aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
              aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
              config=BotocoreClientConfig(signature_version='s3v4'))

        # generate signed post dictionary - also set the post url to be publicly readable
        post = client.generate_presigned_post(
                Bucket=settings.BUCKET_NAME,
                Key=key_name, Fields={'acl':'public-read'},
                Conditions=[{'acl': 'public-read'}])

使用 boto3.client.generate_presigned_post(),默认到期时间为 1 小时,因为这是 boto3 默认设置的:

generate_presigned_post(Bucket, Key, Fields=None, Conditions=None, ExpiresIn=3600)