我試圖寫一個基本的測試,以確保我的minio安裝正常工作。我寫了一個測試,使用presigned POST policy的例子,它工作得很好,但我似乎無法創建一個presigned PUT的工作示例。我得到了403 Forbidden
,原因是:minio presigned放在超強結果在403
cause="Signature does not match"
source="[objecthandlers.go:468:objectAPIHandlers.PutObjectHandler()]"
這裏是測試代碼。我已經promisified minio JavaScript API,並使用磁帶作爲測試工具。 POST策略的類似代碼工作得很好。
編輯:這是這是問題的根源的重要組成部分:
var minio = new Minio.Client({
endPoint: 'minioTest', // <- the problem
port: 9000,
secure: false,
accessKey: 'DONALDJTRUMP',
secretKey: 'DONALDJTRUMP'
});
test('should be able to PUT to a presigned URL', function(assert) {
const filename = 'signedtest2.txt';
return minio.presignedPutObjectAsync(bucket, filename, 60)
.then(url => {
assert.ok(url.length > 200, 'URL is non empty');
console.log(url);
return agent
.put(url)
.set('Content-Type', 'text/plain')
.attach('file', 'test/data/test.txt');
}).then(r => {
assert.ok(r.ok);
console.log(JSON.stringify(r, null, 2));
}).catch(err => {
assert.fail('got error', err);
console.log(err);
});
});
我在做什麼錯那得到了我403紫禁城?