Skip to content

Enforce global Henallux email uniqueness with staff alert on duplicate usage #130

@HunteRoi

Description

@HunteRoi

Summary

Enforce global uniqueness of Henallux email addresses across DataDrop identities and deny verification when an already-used email is attempted on another Discord account, with staff notification and audit logging.

Problem

The specification defines the Henallux email as a real-world identity signal bound to a single person.

This means:

  • the email must not be usable by multiple Discord accounts
  • identity conflicts must be detected early
  • staff must be notified when a duplicate-email verification attempt occurs

Without this, the global verification model can be bypassed or corrupted by duplicate identity binding.

Why This Matters

This rule protects:

  • the integrity of global verification identity
  • anti-account-sharing enforcement
  • auditability of identity conflicts
  • security of web and bot access gating

It is a foundational identity rule for multi-tenant DataDrop behavior.

Required Behavior

  1. A Henallux email already bound to one verified Discord user cannot be bound to another Discord user.
  2. If a duplicate email verification attempt occurs, verification must be denied.
  3. Staff must be notified with enough context to investigate.
  4. The conflict must be recorded in an audit trail.
  5. The special case where a student becomes a teacher and receives a new email remains valid, because that is a new email identity, not a duplicate binding.

Acceptance Criteria

  1. Duplicate email verification attempt from another Discord account is rejected.
  2. Existing verified binding remains unchanged.
  3. Staff notification is emitted with guild/user/email context.
  4. Conflict is written to audit trail with reason code.
  5. Regression tests prove same Discord user can continue normally with its own bound email while different Discord users cannot claim it.

Suggested Implementation Targets

  • src/events/interactionCreate.ts
  • src/services/PostgresDatabaseService.ts
  • prisma/schema.prisma

Suggested Technical Direction

Introduce a global uniqueness constraint or equivalent conflict-check path around canonical verified email identity.

Conflict handling should distinguish:

  • same Discord user reusing its own bound email
  • different Discord user attempting to claim an already-bound email

Only the second case is denied and escalated.

Validation

  • unit test: same email + same user is allowed according to expected flow
  • unit test: same email + different user is rejected
  • integration test: duplicate attempt emits staff notification
  • integration test: duplicate attempt creates audit record

Traceability

  • Spec: docs/specs/issue-93-specification.md
  • Matrix rule: TRC-007
  • Related docs:
    • docs/specs/traceability-matrix.md
    • docs/specs/issue-drafts.md
    • docs/specs/state-machine.md

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions