mergedhumanPR #158Registry
[hackathon phase 1] fix: return defensive copy from CidFacts.fetch()
Fixes a bug where CidFacts.fetch() returned the mutable internal object instead of a copy, which allowed the caller to unintentionally tamper with the registry content.
Description
The pitch.
Fixes a bug where CidFacts.fetch() returned the mutable internal object instead of a copy, which allowed the caller to unintentionally tamper with the registry content. Updates CidFacts.fetch() to return meta.model_copy(deep=True). Adds a new protocol conformance test test_fetch_returns_defensive_copy explicitly testing the immutability of the fetched registry data.
Try it
Open PR on GitHubView diffCheckout locally
git fetch origin pull/158/head:pr-158
git checkout pr-158