3.0.ipv8.attestation.identity.database
Classes
Functions
Module Contents
- class 3.0.ipv8.attestation.identity.database.Credential(metadata: 3.0.ipv8.attestation.identity.metadata.Metadata, attestations: set[3.0.ipv8.attestation.identity.attestation.Attestation])
Cache for Metadata <- [Attestation] mappings.
- metadata
- attestations
- 3.0.ipv8.attestation.identity.database.to_list(obj: Any | None) list
If no results are found in the database, the cursor will return None. This function always returns a list.
- class 3.0.ipv8.attestation.identity.database.IdentityDatabase(file_path: str)
Bases:
3.0.ipv8.database.DatabaseDatabase to store identity layer data.
This database stores: meta information of different pseudonyms, both ours and those of others. This database does not store: commitments and schemes for proving knowledge of data.
- LATEST_DB_VERSION = 1
- insert_token(public_key: 3.0.ipv8.types.PublicKey, token: 3.0.ipv8.attestation.tokentree.token.Token) None
Inject a Token belonging to a certain public key into this database.
- insert_metadata(public_key: 3.0.ipv8.types.PublicKey, metadata: 3.0.ipv8.attestation.identity.metadata.Metadata) None
Inject Metadata belonging to a certain public key into this database.
- insert_attestation(public_key: 3.0.ipv8.types.PublicKey, authority_key: 3.0.ipv8.types.PublicKey, attestation: 3.0.ipv8.attestation.identity.attestation.Attestation) None
Inject an Attestation made by some authority for a certain public key into this database.
- get_tokens_for(public_key: 3.0.ipv8.types.PublicKey) set[3.0.ipv8.attestation.tokentree.token.Token]
Get all tokens in the tree of a certain public key.
- get_metadata_for(public_key: 3.0.ipv8.types.PublicKey) set[3.0.ipv8.attestation.identity.metadata.Metadata]
Get all known metadata for a certain public key.
- get_attestations_for(public_key: 3.0.ipv8.types.PublicKey) set[3.0.ipv8.attestation.identity.attestation.Attestation]
Get all known attestations (made by others) for a certain public key.
- get_attestations_by(public_key: 3.0.ipv8.types.PublicKey) set[3.0.ipv8.attestation.identity.attestation.Attestation]
Get all attestations made by a certain public key (for others).
This is the signing authority.
- get_attestations_over(metadata: 3.0.ipv8.attestation.identity.metadata.Metadata) set[3.0.ipv8.attestation.identity.attestation.Attestation]
Get all known attestations for given metadata.
- get_authority(attestation: 3.0.ipv8.attestation.identity.attestation.Attestation) bytes
Retrieve the authority that created a certain attestation.
- get_credential_over(metadata: 3.0.ipv8.attestation.identity.metadata.Metadata) Credential
Collect all attestations for the given metadata, forming a credential.
- get_credentials_for(public_key: 3.0.ipv8.types.PublicKey) list[Credential]
Get all credentials for a given public key.