Skip to content

sframe key api removal#85

Merged
bifurcation merged 3 commits intocisco:mainfrom
k-wasniowski:sframe-key-api-removal
Mar 26, 2026
Merged

sframe key api removal#85
bifurcation merged 3 commits intocisco:mainfrom
k-wasniowski:sframe-key-api-removal

Conversation

@k-wasniowski
Copy link
Copy Markdown
Contributor

Add key and epoch removal API

Summary

Adds remove_key and remove_epoch methods to Context and MLSContext respectively, allowing callers to remove individual keys or epochs without purging all prior state.

Changes

  • Context::remove_key(KeyID) — Removes a single key from the SFrame context. Operations using a removed key return invalid_parameter_error. Removing a nonexistent key is a no-op.
  • MLSContext::remove_epoch(EpochID) — Removes a single epoch and its derived keys, without affecting other epochs. Complements the existing purge_before() which removes all epochs below a threshold.
  • Context::require_key(KeyID) — Protected helper that validates a key exists before use, returning an error Result instead of throwing via map::at. Used by protect, protect_inner, and unprotect_inner.
  • map::erase(const K&) — Adds single-key erasure to the fixed-size map container.

Tests

  • SFrame Context Remove Key — Verifies protect/unprotect fail after removal, and succeed again after re-adding the key.
  • SFrame Context Remove Key - Nonexistent Key — Confirms removing a never-added key does not throw.
  • MLS Remove Epoch — Verifies epoch-specific removal without affecting other epochs, and re-addition of a removed epoch.

Copy link
Copy Markdown
Contributor

@bifurcation bifurcation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small comment, otherwise lgtm.

k-wasniowski and others added 2 commits March 26, 2026 09:09
Co-authored-by: Richard Barnes <rlb@ipv.sx>
@bifurcation bifurcation merged commit be07f2b into cisco:main Mar 26, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants