From 1715ba5f9bee509a231cf34d7ad7196bd8e1eaf1 Mon Sep 17 00:00:00 2001 From: To-om Date: Wed, 22 Jul 2020 12:05:53 +0200 Subject: [PATCH] #1410 Add mfa, hasKey and hasPassword properties in users --- thehive/app/org/thp/thehive/controllers/v1/Properties.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/thehive/app/org/thp/thehive/controllers/v1/Properties.scala b/thehive/app/org/thp/thehive/controllers/v1/Properties.scala index d631fc19d8..45ba17bef6 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/Properties.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/Properties.scala @@ -236,6 +236,9 @@ class Properties @Inject() ( .property("name", UniMapping.string)(_.field.readonly) .property("locked", UniMapping.boolean)(_.field.readonly) .property("avatar", UniMapping.string.optional)(_.select(_.avatar.attachmentId.map(id => s"/api/datastore/$id")).readonly) + .property("mfa", UniMapping.boolean)(_.select(_.totpSecret.fold.map(!_.isEmpty)).readonly) + .property("hasKey", UniMapping.boolean)(_.select(_.apikey.fold.map(!_.isEmpty)).readonly) + .property("hasPassword", UniMapping.boolean)(_.select(_.password.fold.map(!_.isEmpty)).readonly) .build lazy val observable: List[PublicProperty[_, _]] =