Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ionic framework 允许Ionic应用程序使用bucket策略访问s3 bucket_Ionic Framework_Amazon S3 - Fatal编程技术网

Ionic framework 允许Ionic应用程序使用bucket策略访问s3 bucket

Ionic framework 允许Ionic应用程序使用bucket策略访问s3 bucket,ionic-framework,amazon-s3,Ionic Framework,Amazon S3,我有一个从s3存储桶中获取视频的web应用程序。该bucket有一个策略,只允许从某些域进行访问。我现在需要一个ionic应用程序来访问同一个bucket,有没有办法将此选项添加到策略中 这是我现在的政策 { "Version": "2012-10-17", "Id": "http referer policy example", "Statement": [ { "Sid": "Allow get requests origina

我有一个从s3存储桶中获取视频的web应用程序。该bucket有一个策略,只允许从某些域进行访问。我现在需要一个ionic应用程序来访问同一个bucket,有没有办法将此选项添加到策略中

这是我现在的政策

{
    "Version": "2012-10-17",
    "Id": "http referer policy example",
    "Statement": [
        {
            "Sid": "Allow get requests originating from www.example.com.",
            "Effect": "Deny",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::bucket-name/*.mp4",
            "Condition": {
                "StringNotLike": {
                    "aws:Referer": [
                        "https://www.example.com/*"
                    ]
                }
            }
        }
    ]
}

我已尝试将
文件://*
添加到URL数组,但无效。

您可以使用用户代理识别来自应用程序的请求

下面是Bucket策略的代码:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::bucket-name/*.mp4",
            "Condition": {
                "StringLike": {
                    "aws:UserAgent": "*Any name"
                }
            }
        }
    ]
}
此外,还必须添加config.xml

<preference name="AppendUserAgent" value="Any name" />