0

我有一个弹弓配置,这适用于 s3,但我需要迁移一个谷歌存储。我有这个

Slingshot.GoogleCloud.directiveDefault.GoogleSecretKey = Assets.getText('google-cloud-service-key.pem');

Slingshot.fileRestrictions( "myDefinedDirective", {
    allowedFileTypes: [ "image/png", "image/jpeg", "image/gif" ],
    maxSize: 1 * 1024 * 1024
});

Slingshot.createDirective( "myDefinedDirective", Slingshot.GoogleCloud, {
    GoogleAccessId: "00b4903a97ce39dcfd2fdcd89772b588fdf77d22f74b0a5e57ea9553ce88d4d7",
    bucket: "img_appengine",
    acl: "public-read",
    authorize: function () {
        return true;
    },
    key: function ( file ) {
        var user = Meteor.users.findOne( this.userId );
        return user.emails[0].address + "/" + file.name;
    }
});

我认为,问题出在 GoogleAccessId 上,但我找不到这个值!。

错误是

edgee_slingshot.js:390 发布https://img_appengine.storage.googleapis.com/403 ()transfer@edgee_slingshot.js:390(匿名函数)@edgee_slingshot.js:294(匿名函数)@edgee_slingshot.js:325(匿名函数)@dynamics_browser.js:51_maybeInvokeCallback@livedata_connection.js:446receiveResult@livedata_connection.js :466_livedata_result@livedata_connection.js:1631onMessage@livedata_connection.js:274(匿名函数)@stream_client_sockjs.js:172_.each._.forEach@underscore.js:105self.socket.onmessage@stream_client_sockjs.js:171REventTarget.dispatchEvent@sockjs -0.3.4.js:87SockJS._dispatchMessage @ sockjs-0.3.4.js:1072SockJS._didMessage @ sockjs-0.3.4.js:1130that.ws.onmessage @ sockjs-0.3.4.js:1277 autoform-slingshot。咖啡:143 errorClass {错误:“ - 403”,原因:“无法将文件上传到云存储”,详细信息:未定义,消息:“无法将文件上传到云存储 [ - 403]”,错误类型:“Meteor.Error”}详细信息:未定义错误:“ - 403”errorType:“Meteor.Error”消息:“无法将文件上传到云存储 [ - 403] “原因:“无法将文件上传到云存储”堆栈:(...)获取堆栈:堆栈()参数:nullcaller:nulllength:0name:“获取堆栈”原型:()设置堆栈:堆栈()原型:错误(匿名函数)@ autoform-slingshot.coffee:143(匿名函数)@edgee_slingshot.js:369

4

1 回答 1

0

我相信您的 accessId 错误。它应该看起来像一个电子邮件地址,位于服务帐户密钥的“管理服务帐户”部分

于 2016-08-23T05:50:02.580 回答