Skip to content

source_id validation is stricter than the wire contract (rejects dots, caps at 63 chars) #13

Description

@annschulte

The client validates source_id with ^[a-z0-9][a-z0-9_-]{1,62}$ (plexus/client.py, _SOURCE_ID_RE), but the gateway's wire contract (gateway/validate.go) accepts ^[a-z0-9][a-z0-9._-]*$ up to 256 chars — dots allowed, and 1-char slugs are valid.

Practical impact: slugs like web.frontend (valid on the wire, used by other SDKs and documented in docs.plexus.company's hardware overview) raise ValueError from the Python client, and 1-character slugs are rejected.

Suggested fix: align _SOURCE_ID_RE with the wire rule — ^[a-z0-9][a-z0-9._-]*$, max length 256. Optionally also reject uuid-shaped slugs, which the app now rejects at source creation (they're unreachable through the app's ref resolvers).

For reference, plexus-typescript ships the wire rule + uuid-shape rejection (src/wire.ts).

Related note found in the same review (separate issue-worthy): the client gzips bodies >1KB with Content-Encoding: gzip, which the gateway historically never decompressed; the gateway is gaining transparent gzip support, after which the Python path works as intended.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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