semitexa / api
Semitexa API - external API product layer with machine credentials, versioned routes, and M2M contracts
Requires
- php: ^8.4
- semitexa/auth: *
- semitexa/core: *
This package is auto-updated.
Last update: 2026-04-05 09:00:29 UTC
README
External API product layer for Semitexa with machine-to-machine authentication, versioned routes, and structured error envelopes.
Purpose
Provides the opt-in external API surface for Semitexa applications. Routes marked with #[ExternalApi] receive machine-facing JSON error envelopes, Bearer token M2M authentication via MachineAuthHandler, and API versioning with #[ApiVersion] including deprecation and sunset headers.
Role in Semitexa
Depends on semitexa/core and semitexa/auth. Enriches Core's route metadata with external_api and api_version extension keys via ApiRouteMetadataResolver. Internal routes remain completely unaffected by this package.
Key Features
#[ExternalApi]attribute for opt-in API route designation#[ApiVersion]with deprecation and sunset metadata headersMachineAuthHandlersupporting Bearer{id}:{secret}token formatExternalApiExceptionMapperproducing machine-readable JSON error envelopesMachinePrincipalimplementingAuthenticatableInterfaceMachineCredentialentity with scopes, revocation, and audit support
Notes
Only routes explicitly marked with #[ExternalApi] receive API behavior. All other routes continue to use Core's default exception mapping and response handling.