api

module
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: AGPL-3.0

README

Arnakoff API

CI OpenSSF Scorecard

API publique anti-arnaque : pour un site, un e-mail, un numéro de téléphone, un IBAN ou un SIREN, elle renvoie des signaux sourcés expliqués en français.

Statut

En construction : aucune version n'est publiée et l'API n'est pas encore en service. Les commandes de cmd/ ne font encore rien. Suis l'avancement dans la feuille de route.

Ce que fait l'API

Tu lui donnes une entrée ; elle la confronte à des sources publiques (listes noires de l'AMF et de l'ACPR, répertoire SIRENE, BODACC, âge du domaine, numérotation de l'ARCEP…) et renvoie une liste de signaux. Chaque signal porte :

  • code : identifiant stable du signal ;
  • level : niveau du signal ;
  • message : une phrase factuelle en français, par exemple « Figure sur la liste noire de l'AMF depuis le 08/10/2026 » ;
  • source et source_url : l'éditeur de la donnée et où la vérifier ;
  • observed_at : la date à laquelle la donnée a été relevée.

Les signaux prévus sont dans docs/signals.md, les sources et leurs licences dans docs/sources.md. L'API sera aussi exposée comme serveur MCP.

Principes

  • Jamais « sûr ». Sans signal, la réponse est « Aucun signal connu dans nos sources » : l'absence d'une liste noire ne prouve rien.
  • Des faits, pas des accusations. Chaque signal cite sa source ; aucun message ne qualifie une entité nommée d'arnaque.
  • Des licences d'abord. Une source n'est utilisée que si sa licence autorise la réutilisation commerciale.
  • Les données personnelles protégées. Les e-mails, numéros et IBAN ne sont jamais journalisés en clair ni transmis à un tiers.
  • Aucune URL fournie par l'utilisateur n'est appelée. Les registres sont interrogés par identifiant, à travers une liste d'hôtes autorisés.
  • Une synchronisation prudente. Un instantané de source invalide, ou qui perd plus de 20 % de ses entrées, est rejeté ; le précédent reste en service.

Démarrer

Il te faut Go 1.27 : la version exacte (toolchain go1.27.3) est dans go.mod et se télécharge d'elle-même. Installe aussi golangci-lint à la version indiquée dans docs/standards.md.

go build ./...
go vet ./...
golangci-lint run
go test -race -shuffle=on ./...
go tool govulncheck ./... tool

La CI lance les mêmes commandes sur chaque pull request. Les tests n'utilisent jamais le réseau.

Organisation

Architecture propre (ADR 0002) : les dépendances vont vers l'intérieur uniquement.

Dossier Rôle
internal/domain/ Objets métier, normalisation des entrées et règles des signaux, sans entrée-sortie.
internal/app/ Cas d'usage (vérification, synchronisation) et interfaces dont ils ont besoin.
internal/adapter/ Sources, registres, stockage, API HTTP et serveur MCP.
internal/platform/ Client HTTP sortant, journaux, configuration.
cmd/ Points d'entrée : api, sync, mcp et eval.

Documentation

Contribuer

Lis CONTRIBUTING.md. Pour une faille de sécurité, suis la politique de sécurité, jamais une issue publique. Pour de l'aide, vois SUPPORT.md.

Licence

Le code est sous GNU AGPL-3.0-only (ADR 0003). Les données gardent la licence de leur source, indiquée dans docs/sources.md.

Directories

Path Synopsis
cmd
api command
Command api serves the public Arnakoff HTTP API.
Command api serves the public Arnakoff HTTP API.
eval command
Command eval measures signal quality against the labelled corpus.
Command eval measures signal quality against the labelled corpus.
mcp command
Command mcp serves Arnakoff signals over the Model Context Protocol.
Command mcp serves Arnakoff signals over the Model Context Protocol.
sync command
Command sync downloads the upstream sources and stores validated snapshots.
Command sync downloads the upstream sources and stores validated snapshots.
internal
adapter
Package adapter groups the implementations of the app ports: upstream sources, on-demand registries, storage, and the inbound HTTP and MCP servers (ADR 0002).
Package adapter groups the implementations of the app ports: upstream sources, on-demand registries, storage, and the inbound HTTP and MCP servers (ADR 0002).
adapter/source/amf
Package amf is the connector of the AMF blacklist: the CSV file the Autorité des marchés financiers publishes daily on data.gouv.fr under the Licence Ouverte 2.0 (docs/sources.md).
Package amf is the connector of the AMF blacklist: the CSV file the Autorité des marchés financiers publishes daily on data.gouv.fr under the Licence Ouverte 2.0 (docs/sources.md).
adapter/store
Package store keeps the last valid snapshot of each source on disk, shared by the sync and API processes and kept across restarts.
Package store keeps the last valid snapshot of each source on disk, shared by the sync and API processes and kept across restarts.
app
Package app holds the use cases of Arnakoff and the ports they consume.
Package app holds the use cases of Arnakoff and the ports they consume.
domain
Package domain holds the entities, value objects and signal rules of Arnakoff.
Package domain holds the entities, value objects and signal rules of Arnakoff.
platform
Package platform holds cross-cutting technical helpers: the outbound HTTP client, the redacting logger, the configuration and the in-memory cache (ADR 0002).
Package platform holds cross-cutting technical helpers: the outbound HTTP client, the redacting logger, the configuration and the in-memory cache (ADR 0002).
platform/cache
Package cache keeps registry answers in memory for a while, so a burst of checks on the same identifier calls an upstream once (ADR 0002).
Package cache keeps registry answers in memory for a while, so a burst of checks on the same identifier calls an upstream once (ADR 0002).
platform/config
Package config reads the configuration of every command from environment variables into one typed Config, validated as a whole at startup so a command stops before doing anything with a value it cannot use (ADR 0002).
Package config reads the configuration of every command from environment variables into one typed Config, validated as a whole at startup so a command stops before doing anything with a value it cannot use (ADR 0002).
platform/defaults
Package defaults fills the zero fields of a configuration struct with their default value, so every Config in platform follows the same rule: zero means default, negative is invalid.
Package defaults fills the zero fields of a configuration struct with their default value, so every Config in platform follows the same rule: zero means default, negative is invalid.
platform/httpclient
Package httpclient is the only way out to the network: every source and registry fetches through a Client (ADR 0002).
Package httpclient is the only way out to the network: every source and registry fetches through a Client (ADR 0002).
platform/logging
Package logging builds the structured logger every command writes with: log/slog lines in JSON, personal data masked, the request identifier of the context added (ADR 0002).
Package logging builds the structured logger every command writes with: log/slog lines in JSON, personal data masked, the request identifier of the context added (ADR 0002).
platform/startup
Package startup is what every command does before its own work: load the typed configuration, build the redacting logger from it and make that logger the log/slog default, so no line written by the command or a library bypasses the masking of personal data (ADR 0002).
Package startup is what every command does before its own work: load the typed configuration, build the redacting logger from it and make that logger the log/slog default, so no line written by the command or a library bypasses the masking of personal data (ADR 0002).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL