Skip to content

Add a DAFSA-format Public Suffix List reader #210

@AlfioEmanueleFresta

Description

@AlfioEmanueleFresta

DatFilePublicSuffixList (added in #190) reads only the text .dat format via the publicsuffix crate. On a default Fedora install the .dat file is not present, but the binary .dafsa file at /usr/share/publicsuffix/public_suffix_list.dafsa is. With libwebauthn planned to ship by default on Fedora, the system loader will fail out of the box.

What ships where

Distro .dat shipped .dafsa shipped On default install
Debian/Ubuntu yes (file listing) yes (same package) yes, libpsl Recommends publicsuffix
Fedora only via publicsuffix-list only via publicsuffix-list-dafsa only -dafsa (libpsl Requires it)
Arch yes (file listing) not packaged no

On Fedora, libpsl (transitively pulled in by curl, wget, git) requires publicsuffix-list-dafsa but not publicsuffix-list, so nearly every Fedora system has the binary .dafsa and almost none have the text .dat.

Proposal

Add a DAFSA reader behind the existing PublicSuffixList trait. Open question for implementation time: ship a combined reader that probes .dafsa then falls back to .dat, or DAFSA-only and drop the .dat path. Either way the new code is the DAFSA parser itself.

The libpsl DAFSA format is documented in upstream libpsl (src/psl-make-dafsa.py, src/psl-load-dafsa.c). A safe-Rust reader is a self-contained ~150-300 LoC task plus tests. The publicsuffix crate v1.5 we currently use does not support DAFSA.

Why not bundle a snapshot

PSL freshness needs to track the system package manager, not crate releases. The point of DatFilePublicSuffixList is to delegate that update cadence to the OS. See discussion in #173.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions