serokell / coffer

Multi-backend password store with multiple frontends
4 stars 2 forks source link

[#106] Backend-agnostic `listDirectoryContents` #107

Closed DK318 closed 2 years ago

DK318 commented 2 years ago

Description

Problem

At this moment the listDirectoryContents function returns [Text] and in getEntryOrDir we rely on the fact that vault adds a '/' to the directory. But other backends might not behave like this.

Solution

Created new data DirectoryContents which stores 2 lists:

  1. list with directories
  2. list with entries and changed return type from Maybe [Text] to Maybe DirectoryContents in listDirectoryContents function.

Related issue(s)

Fixed #

:white_check_mark: Checklist for your Pull Request

Related changes (conditional)

Stylistic guide (mandatory)