From 5fbf837ec29b0ba1c61e1d9f2913f2139feeb507 Mon Sep 17 00:00:00 2001 From: Simao Mata Date: Thu, 29 Aug 2024 16:39:13 +0100 Subject: [PATCH 1/2] Allow empty name in PubKeyMeta --- .../com/advancedtelematic/libtuf/data/ClientDataType.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtuf/src/main/scala/com/advancedtelematic/libtuf/data/ClientDataType.scala b/libtuf/src/main/scala/com/advancedtelematic/libtuf/data/ClientDataType.scala index ac2f3191..15fd04e7 100644 --- a/libtuf/src/main/scala/com/advancedtelematic/libtuf/data/ClientDataType.scala +++ b/libtuf/src/main/scala/com/advancedtelematic/libtuf/data/ClientDataType.scala @@ -277,7 +277,7 @@ object ClientDataType { case class PubKeyInfo(pubkey: String, meta: Option[PubKeyMeta]) - case class PubKeyMeta(name: String) + case class PubKeyMeta(name: Option[String]) trait EnumeratumUnmarshaller[T <: EnumEntry] { this: Enum[T] => From 30992c5dc6aaf6523ce7acfe339879aa61682d4e Mon Sep 17 00:00:00 2001 From: Ben Clouser Date: Wed, 4 Sep 2024 14:36:22 -0400 Subject: [PATCH 2/2] [OTA-2377] Add hardwareIdsWithPackages method to reposerverClient Signed-off-by: Ben Clouser --- .../libtuf_server/repo/client/ReposerverClient.scala | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libtuf-server/src/main/scala/com/advancedtelematic/libtuf_server/repo/client/ReposerverClient.scala b/libtuf-server/src/main/scala/com/advancedtelematic/libtuf_server/repo/client/ReposerverClient.scala index 128685c1..ae5452af 100644 --- a/libtuf-server/src/main/scala/com/advancedtelematic/libtuf_server/repo/client/ReposerverClient.scala +++ b/libtuf-server/src/main/scala/com/advancedtelematic/libtuf_server/repo/client/ReposerverClient.scala @@ -269,6 +269,8 @@ trait ReposerverClient { def fetchDelegationsInfo(namespace: Namespace): Future[Map[DelegatedRoleName, DelegationInfo]] def refreshDelegatedRole(namespace: Namespace, fileName: DelegatedRoleName): Future[Unit] + + def hardwareIdsWithPackages(namespace: Namespace): Future[PaginationResult[HardwareIdentifier]] } object ReposerverHttpClient extends ServiceHttpClientSupport { @@ -815,4 +817,10 @@ class ReposerverHttpClient(reposerverUri: Uri, } } + override def hardwareIdsWithPackages( + namespace: Namespace): Future[PaginationResult[HardwareIdentifier]] = { + val req = HttpRequest(HttpMethods.GET, uri = apiV2Uri(Path(s"user_repo/hardwareids-packages"))) + execHttpUnmarshalledWithNamespace[PaginationResult[HardwareIdentifier]](namespace, req).ok + } + }