mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-20 06:35:56 +08:00
listing
This commit is contained in:
parent
93720aab28
commit
65795f9bbb
@ -211,15 +211,13 @@ func newListEntry(entry *filer_pb.Entry, key string, dir string, name string, bu
|
||||
ownerID = s3_constants.AccountAnonymousId
|
||||
displayName = "anonymous"
|
||||
} else {
|
||||
// Try to resolve display name from IAM system
|
||||
displayName = "unknown"
|
||||
// Note: IAM resolution would require access to the S3ApiServer instance
|
||||
// For now, use a simple fallback or could be enhanced later
|
||||
}
|
||||
// Use the ownerID as displayName if no better option is available
|
||||
displayName = ownerID
|
||||
|
||||
// Additional fallback to file system username if available and no display name resolved
|
||||
if displayName == "unknown" && entry.Attributes.UserName != "" {
|
||||
displayName = entry.Attributes.UserName
|
||||
// Additional fallback to file system username if available and different from ownerID
|
||||
if entry.Attributes.UserName != "" && entry.Attributes.UserName != ownerID {
|
||||
displayName = entry.Attributes.UserName
|
||||
}
|
||||
}
|
||||
|
||||
listEntry.Owner = CanonicalUser{
|
||||
|
@ -148,6 +148,25 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m
|
||||
prefixEndsOnDelimiter: strings.HasSuffix(originalPrefix, "/") && len(originalMarker) == 0,
|
||||
}
|
||||
|
||||
// Special case: when maxKeys = 0, return empty results immediately
|
||||
if maxKeys == 0 {
|
||||
response = ListBucketResult{
|
||||
Name: bucket,
|
||||
Prefix: originalPrefix,
|
||||
Marker: originalMarker,
|
||||
NextMarker: "",
|
||||
MaxKeys: int(maxKeys),
|
||||
Delimiter: delimiter,
|
||||
IsTruncated: false,
|
||||
Contents: contents,
|
||||
CommonPrefixes: commonPrefixes,
|
||||
}
|
||||
if encodingTypeUrl {
|
||||
response.EncodingType = s3.EncodingTypeUrl
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// check filer
|
||||
err = s3a.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
|
||||
for {
|
||||
|
Loading…
Reference in New Issue
Block a user