Policy-aware interface contracts for testing access-control and selected privacy obligations in service APIs
Authors
Abstract
An API response can match its schema while exposing another user's data or failing to record a required audit event. This paper defines a compact policy-contract profile for testing access-control and selected privacy obligations in service APIs. The profile embeds required fields and optional dependent clauses in OpenAPI, relates them to authorization and privacy standards, and organizes coverage into four cumulative profiles. A compiler turns each declared obligation into a test case and a check of the relevant response, state change, audit event, or endpoint lifecycle behavior. In a controlled synthetic benchmark based on 12 policy templates, the generated checks detect the same injected faults as separately implemented handwritten assertions. The generated suite produces no false alerts on 5520 compliant evidence variations. Executions on VAmPI and OWASP crAPI detect seven documented defects without alerts on five controls. These results support the feasibility of generating traceable policy tests from interface contracts. The assurance remains limited to the obligations recorded in the contract and the evidence available to check them. © 2026 Elsevier Ltd
Keywords
API contract testing
Domain-specific languages
Language-based security
Software specification
Software verification
BibTeX
@article{ICTU2026_2265,
author = {Nguyen The-Vinh},
title = {{Policy-aware interface contracts for testing access-control and selected privacy obligations in service APIs}},
journal = {Journal of Computer Languages},
year = {2026},
month = {9},
volume = {89},
eid = {101424},
doi = {10.1016/j.cola.2026.101424},
url = {https://doi.org/10.1016/j.cola.2026.101424}
}