Skip to content

[Hackathon] hiten: add DidKeyIdentity helper accessors#49

Open
Hiten0305l wants to merge 1 commit into
projnanda:mainfrom
Hiten0305l:hackathon/hiten-didkey-helpers
Open

[Hackathon] hiten: add DidKeyIdentity helper accessors#49
Hiten0305l wants to merge 1 commit into
projnanda:mainfrom
Hiten0305l:hackathon/hiten-didkey-helpers

Conversation

@Hiten0305l

@Hiten0305l Hiten0305l commented Jul 1, 2026

Copy link
Copy Markdown

Summary

This is a focused follow-up to my previous hackathon PR (#39). Following the merge of the DataFacts implementation in #31, this PR contributes an independent identity-layer API improvement by adding two small helper accessors to DidKeyIdentity.
The change exposes the identity's agent ID through a public property and provides a helper for checking whether a peer's public key has been registered, without changing existing identity semantics.

What

  • Add the agent_id property.
  • Add the has_peer_key(agent) helper.
  • Add focused unit tests covering both helper APIs.

Why

DidKeyIdentity already stores the identity's agent ID and maintains a registry of known peer public keys internally. Exposing these operations through dedicated helper APIs improves usability while preserving existing identity behavior.
The agent_id property provides a stable public accessor instead of requiring downstream code to depend on private implementation details.
The has_peer_key(agent) helper provides a clear, self-documenting way to determine whether a peer's public key has been registered, avoiding direct inspection of internal state and making downstream code more readable.

These additions are intentionally lightweight, reusable, and do not modify signing, verification, key generation, or identity semantics.

Scope

This PR is intentionally limited to the DidKeyIdentity helper APIs and their associated unit tests.

Verification

  • make ci-local
uv sync
uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pytest -v

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.

1 participant