Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 2.71 KB

overview.md

File metadata and controls

40 lines (28 loc) · 2.71 KB

Social Network Account Module

Purpose

The socNetAccount module stores per-user credential and identity rows for social-network client modules, currently Telegram, Twitter/X, and Bluesky/ATProto.

Owns

  • Social account rows with network name, remote account ID, username/phone/full name, app credentials, access tokens, and session keys.
  • Owner-scoped create/update and account lookup by local id or provider identity.
  • Bounded account listing by network.
  • Server statistics reads via getStatistics(userId, input): owner/identity lookup, app-pass credential decryption and fixed-provider adapters in statistics.ts. Returns only metrics or unsupported, never secrets.
  • Test/support database flush helpers.

Security Boundaries

  • All lookups are user-scoped.
  • Create/update must not fall back to {userId} alone; provider identity such as (socNet, accountId), (socNet, username), or (socNet, phoneNumber) is required unless a local id is supplied.
  • Encrypted credential/session values are passed through from client modules; this module stores them but does not know every provider's encryption semantics.
  • Module API responses must sanitize secret credential/session fields such as API keys, access tokens, and session keys, exposing only safe has* flags when needed.
  • Feature modules must avoid returning secret material to unauthorized callers.
  • Credentialed cross-post/import flows must prove account ownership before use.

Boundaries

  • Protocol-specific login/fetch logic belongs to client modules such as telegramClient and twitterClient.
  • Bluesky import/login and ownership verification belong to bluesky. The dedicated server-statistics read adapter also lives here; historical storage and API orchestration belong to socNetStatistics.
  • Source/import post identity belongs to socNetImport, not account rows.
  • Do not use this module for generic external identity proofs; use foreignAccounts for that.

Related Docs

Server Discord statistics now include approximate guild members/presence through the existing owned bot account, with typed access-denied/rate-limit outcomes. Channel membership and guild audience are not interchangeable. Shared audience history is owned by socNetStatistics.

Telegram user readers expose only safe id/label/ready metadata. getStatistics delegates historical Telegram message reads to telegramClient using the selected owned usable user account; bot publication credentials remain separate.