Add route to get settings for a share

Returns the client settings of the creator.
This commit is contained in:
eikek
2022-01-29 10:11:54 +01:00
parent c29ce73dd0
commit 1ca64f09d1
4 changed files with 78 additions and 9 deletions

View File

@ -48,6 +48,8 @@ trait OShare[F[_]] {
// ---
def findActiveById(id: Ident): OptionT[F, ShareData]
/** Verifies the given id and password and returns a authorization token on success. */
def verify(key: ByteVector)(id: Ident, password: Option[Password]): F[VerifyResult]
@ -277,6 +279,9 @@ object OShare {
VerifyResult.invalidToken.pure[F]
}
def findActiveById(id: Ident): OptionT[F, ShareData] =
RShare.findCurrentActive(id).mapK(store.transform).map(ShareData.tupled)
def findShareQuery(id: Ident): OptionT[F, ShareQuery] =
RShare
.findCurrentActive(id)