mirror of
https://github.com/garethgeorge/backrest.git
synced 2025-12-16 02:25:37 +00:00
feat: direct download files through backrest webui
This commit is contained in:
@@ -743,10 +743,14 @@ func (s *BackrestHandler) GetDownloadURL(ctx context.Context, req *connect.Reque
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get operation %v: %w", req.Msg.Value, err)
|
||||
}
|
||||
_, ok := op.Op.(*v1.Operation_OperationRestore)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("operation %v is not a restore operation", req.Msg.Value)
|
||||
|
||||
switch op.Op.(type) {
|
||||
case *v1.Operation_OperationIndexSnapshot:
|
||||
case *v1.Operation_OperationRestore:
|
||||
default:
|
||||
return nil, fmt.Errorf("operation %v is not a restore or snapshot operation", req.Msg.Value)
|
||||
}
|
||||
|
||||
signature, err := signInt64(op.Id) // the signature authenticates the download URL. Note that the shared URL will be valid for any downloader.
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to generate signature: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user