Skip to content

Commit b903c80

Browse files
authored
add option for list with auth (#1774)
1 parent 5e3c151 commit b903c80

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

zboxcore/sdk/allocation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3298,7 +3298,7 @@ func (a *Allocation) DownloadDirectory(ctx context.Context, remotePath, localPat
32983298
}
32993299
defer sys.Files.RemoveAllDirectories()
33003300

3301-
oRefChan := a.ListObjects(ctx, remotePath, "", "", "", fileref.FILE, fileref.REGULAR, 0, getRefPageLimit)
3301+
oRefChan := a.ListObjects(ctx, remotePath, "", "", "", fileref.FILE, fileref.REGULAR, 0, getRefPageLimit, WithAuthToken(authTicket))
33023302
refSlice := make([]ORef, BatchSize)
33033303
refIndex := 0
33043304
wg := &sync.WaitGroup{}

zboxcore/sdk/filerefsworker.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ func WithSingleBlobber(singleBlobber bool) ObjectTreeRequestOption {
8888
}
8989
}
9090

91+
func WithAuthToken(token string) ObjectTreeRequestOption {
92+
return func(o *ObjectTreeRequest) {
93+
o.authToken = token
94+
}
95+
}
96+
9197
// Paginated tree should not be collected as this will stall the client
9298
// It should rather be handled by application that uses gosdk
9399
func (o *ObjectTreeRequest) GetRefs() (*ObjectTreeResult, error) {

0 commit comments

Comments
 (0)