Skip to content

Commit 19b0f8d

Browse files
committed
WIP
1 parent cac6ce2 commit 19b0f8d

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/Federation.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ public function entityCollectionResponseFactory(): EntityCollectionResponseFacto
431431
$this->entityCollectionFilter(),
432432
$this->entityCollectionSorter(),
433433
$this->entityCollectionPaginator(),
434+
$this->entityCollectionStore(),
434435
);
435436
}
436437

src/Federation/EntityCollection/EntityCollectionResponseFactory.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public function __construct(
1515
protected readonly EntityCollectionFilter $filter,
1616
protected readonly EntityCollectionSorter $sorter,
1717
protected readonly EntityCollectionPaginator $paginator,
18+
protected readonly EntityCollectionStoreInterface $entityCollectionStore,
1819
) {
1920
}
2021

@@ -115,9 +116,9 @@ public function build(string $trustAnchorId, array $requestParams = []): EntityC
115116
$paginated = $this->paginator->paginate($entries, $limit, $from);
116117

117118
return new EntityCollectionResponse(
118-
array_values($paginated['entities']),
119-
$paginated['next'],
120-
time(), // last_updated
119+
entities: array_values($paginated['entities']),
120+
next: $paginated['next'],
121+
lastUpdated: $this->entityCollectionStore->getLastUpdated($trustAnchorId) ?? time(),
121122
);
122123
}
123124
}

src/Federation/FederationDiscovery.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public function discover(
6868
);
6969

7070
$this->entityCollectionStore->store($trustAnchorId, $discoveredEntities, $ttl);
71+
$this->entityCollectionStore->storeLastUpdated($trustAnchorId, time(), $ttl);
72+
7173
$this->logger?->info('Federation discovery completed.', [
7274
'trustAnchorId' => $trustAnchorId,
7375
'discoveredCount' => count($discoveredEntities),

0 commit comments

Comments
 (0)