Skip to content

[Python] Identity system (~/.fd5/identity.toml) #163

@gerchowl

Description

@gerchowl

Parent: #161

Goal

Create fd5.identity module for loading and managing user identity from ~/.fd5/identity.toml.

Spec

  • Identity dataclass: type (orcid/github/email/anonymous), id (string), name (string)
  • load_identity() -> Identity — read from ~/.fd5/identity.toml, return anonymous if missing
  • save_identity(identity: Identity) — write to ~/.fd5/identity.toml
  • identity_to_dict(identity: Identity) -> dict — for embedding in audit entries
  • Support for type values: orcid, github, email, anonymous

TOML format

[identity]
type = "orcid"
id = "0000-0002-1825-0097"
name = "Lars Gerchow"

TDD

  • Test load from valid TOML file
  • Test load returns anonymous when file missing
  • Test save + load round-trip
  • Test validation of identity types
  • Test ORCID format validation (XXXX-XXXX-XXXX-XXXX)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corefd5 core libraryaudit-trailAudit trail / provenance chain featureeffort:medium1-4 hoursfeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions