mirror of
https://github.com/pgsty/minio.git
synced 2026-07-20 04:30:26 +03:00
handler/PUT: Handle signature verification through a custom reader. (#2066)
Change brings in a new signVerifyReader which provides a io.Reader compatible reader, additionally implements Verify() function. Verify() function validates the signature present in the incoming request. This approach is choosen to avoid complexities involved in using io.Pipe(). Thanks to Krishna for his inputs on this. Fixes #2058 Fixes #2054 Fixes #2087
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
0540863663
commit
8a028a9efb
+12
-10
@@ -62,18 +62,20 @@ func erasureCreateFile(disks []StorageAPI, volume string, path string, partName
|
||||
if rErr != nil && rErr != io.ErrUnexpectedEOF {
|
||||
return nil, 0, rErr
|
||||
}
|
||||
// Returns encoded blocks.
|
||||
var enErr error
|
||||
blocks, enErr = encodeData(buf[0:n], eInfo.DataBlocks, eInfo.ParityBlocks)
|
||||
if enErr != nil {
|
||||
return nil, 0, enErr
|
||||
}
|
||||
if n > 0 {
|
||||
// Returns encoded blocks.
|
||||
var enErr error
|
||||
blocks, enErr = encodeData(buf[0:n], eInfo.DataBlocks, eInfo.ParityBlocks)
|
||||
if enErr != nil {
|
||||
return nil, 0, enErr
|
||||
}
|
||||
|
||||
// Write to all disks.
|
||||
if err = appendFile(disks, volume, path, blocks, eInfo.Distribution, hashWriters, writeQuorum); err != nil {
|
||||
return nil, 0, err
|
||||
// Write to all disks.
|
||||
if err = appendFile(disks, volume, path, blocks, eInfo.Distribution, hashWriters, writeQuorum); err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
size += int64(n)
|
||||
}
|
||||
size += int64(n)
|
||||
}
|
||||
|
||||
// Save the checksums.
|
||||
|
||||
Reference in New Issue
Block a user