datapartyjs/gpgfs

CODE | Validate path scheme in getBucketIds

Opened this issue · 0 comments

🤖 Code Proposal

Improve gpgfs.getBucketIds() to be more robust and fully filter for valid bucket directories.

Verify:

  1. Path contains a valid bucket id
  2. Path is a directory

gpgfs/src/gpgfs.js

Lines 212 to 220 in fe51f8b

async getBucketIds(){
const bucketPaths = (await this.readDir('/buckets'))
.map(item=>{
return item.replace('bucket-','')
})
debug('found ids', bucketPaths)
return bucketPaths
}

Motivation