Adapt qos-profiles API spec and tests to Commonalities r4.3 (0.8.0)#575
Adapt qos-profiles API spec and tests to Commonalities r4.3 (0.8.0)#575RandyLevensalor wants to merge 5 commits into
Conversation
- Bump x-camara-commonalities 0.6 -> 0.8.0 - Reference synced common schemas/responses via $ref into code/common/CAMARA_common.yaml; remove duplicated XCorrelator, Device and identifier schemas, ErrorInfo, and Generic400/401/429/Device404 - Add mandatory info.description section markers (authorization-and-authentication, additional-error-responses, request-body-strictness) - Add S-309/S-312 constraints (maxItems/maxLength) to remaining local schemas - Restructure both test definition files to the r4.3 sample-service-template (section banners, double-digit error tags, x-correlator/Content-Type assertions, 429 and invalid x-correlator scenarios) Fixes #573
CAMARA Validation — PASS (with warnings)0 errors, 71 warnings, 21 hints | Profile: standard |
- Duration.value: add maximum (int32) to satisfy S-311 (integer must declare minimum and maximum) - Availability items: add description to satisfy S-031 (array items must have a description)
Availability networks items: add pattern '^[0-9]{5,6}$' for the PLMN
identifier (MCC + MNC), addressing the owasp:api4:2023-string-restricted
hint that strings should declare a format/pattern/enum/const.
|
@hdamker @eric-murray @jlurien can you please review. IMHO, the largest potential issue is that these limits are broader than they need to be. My concern is that we will have more issues if they are overly constrained. But I'm happy to make these more reasonable. |
|
@RandyLevensalor I found only one "should" fix:
The limits I would keep broad as you have chosen. All the new A minor point:
|
Add pattern to the free-form description string addressing the owasp:api4:2023-string-restricted hint that strings should declare a format/pattern/enum/const. The pattern excludes C0 controls (except TAB/LF/CR, so multiline descriptions remain valid), DEL, and the C1 range (U+0080-U+009F).
QosProfileDeviceRequest has no required properties, so an empty object is a valid request returning all profiles (as asserted by scenario 05_not_return_restricted_profiles); the template's 400 empty-body case does not apply to this operation (Commonalities #247). Renumber the invalid-x-correlator scenario from 400.04 to 400.03.
2b31bf2 to
02af476
Compare
Would it be worth adding a canonical CAMARA "printable text" pattern to in Commonalities? I've updated this to allow tab, LF and CF plus added more exclusions. |
What type of PR is this?
What this PR does / why we need it:
Adapts the
qos-profilesAPI specification and its test definitions to CAMARA Commonalities r4.3 (Commonalities 0.8.0), using the analysis done by the Commonalities Working Group (Analysis of Commonalities 0.8.0) and the ConsentManagement #29 alignment as references.API specification (
qos-profiles.yaml):x-camara-commonalitiesfrom0.6to0.8.0.$refintocode/common/CAMARA_common.yaml:openIdsecurity scheme,x-correlatorparameter/header,Device,ErrorInfo, and responsesGeneric400,Generic401,Generic429;GenericDevice404now references the commonGeneric404(identical code set).XCorrelator,PhoneNumber,NetworkAccessIdentifier,DeviceIpv4Addr,SingleIpv4Addr,Port,DeviceIpv6Address(rule S-211).Generic403(PERMISSION_DENIEDonly),Generic404(NOT_FOUNDonly, forgetQosProfile),Generic422(SERVICE_NOT_APPLICABLE,UNSUPPORTED_IDENTIFIER,UNNECESSARY_IDENTIFIER).info.descriptionsection markers (text copied as-is fromcode/common/info-description-templates.yaml):authorization-and-authentication,additional-error-responses, and the newrequest-body-strictness.maxLength/maxItemsconstraints (rules S-312 / S-309) to the remaining local schemas:QosProfile.description,Availabilityand itsnetworksarray,countryName, and theretrieveQoSProfiles200 response array.Test definitions (both
.featurefiles):Happy Path Scenarios/Error Scenariosbanners andSyntax Error/Service Errorsubsections.400.01,401.01,403.01,404.01,429.01, …).429.01_too_many_requestsandinvalid_x-correlatorscenarios (and400.03_empty_request_bodyforretrieveQoSProfiles); addedx-correlator/Content-Typeresponse-header assertions to the device error scenarios.XCorrelator,PhoneNumber,DeviceIpv4Address,DeviceIpv6Address,NetworkAccessIdentifier) to point at../common/CAMARA_common.yaml.Which issue(s) this PR fixes:
Fixes #573
Special notes for reviewers:
Two deliberate deviations from the generic Commonalities template, for your attention:
identifying-device-from-access-tokenmandatory block not embedded verbatim. The standard opt-in block states thedeviceobject "MUST be provided" with a two-legged token and defines a422 MISSING_IDENTIFIERcase. Inqos-profiles, however,deviceis an optional filter —retrieveQoSProfileslegitimately returns all profiles when no device is supplied, soMISSING_IDENTIFIERdoes not apply. The existing, accurate "Identifying the device from the access token" section (documenting the optional filter and the422 UNNECESSARY_IDENTIFIERbehaviour) has been kept instead. This is compliant because the Appendix A block is opt-in.No
403.02_api_client_token_mismatchscenario. That template scenario targets resources created/managed by a specific API client. QoS Profiles are provider-defined, read-only resources with no per-client ownership, so the scenario does not apply to either operation.Also: the
403/404/422responses are intentionally kept as local code-subsets (rather than$ref-ing the common responses) because the common versions include additional codes (INVALID_TOKEN_CONTEXT,IDENTIFIER_NOT_FOUND,MISSING_IDENTIFIER) that are not applicable to these operations — the same selective approach taken in ConsentManagement #29.The CHANGELOG and API Readiness Checklist are intentionally not modified in this PR (the changelog is generated from the changelog-input below at release time), matching the ConsentManagement #29 precedent.
Changelog input
Additional documentation
This section can be blank.