Skip to content

Commit c1a91f9

Browse files
authored
Beheer: fix consistent gebruik van RFC2119 notatie (#305)
1 parent 65174a2 commit c1a91f9

1 file changed

Lines changed: 20 additions & 21 deletions

File tree

sections/designRules.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The REST architectural style is centered around the concept of a [=resource=]. A
1414
<dl>
1515
<dt>Statement</dt>
1616
<dd>
17-
Resources are referred to using nouns (instead of verbs) that represent entities meaningful to the API consumer.
17+
Resources MUST be referred to using nouns (instead of verbs) that represent entities meaningful to the API consumer.
1818
<aside class="example">
1919
A few correct examples of nouns as part of a URI:
2020
<ul>
@@ -43,7 +43,7 @@ A resource that corresponds to a single conceptual entity is referred to as a [=
4343
<dl>
4444
<dt>Statement</dt>
4545
<dd>
46-
Collection resources are referred to using plural nouns.
46+
Collection resources MUST be referred to using plural nouns.
4747
</dd>
4848
<dt>Rationale</dt>
4949
<dd>
@@ -87,7 +87,7 @@ https://api.example.org/v1/vergunningen/d285e05c-6b01-45c3-92d8-5e19a946b66f</pr
8787
<dl>
8888
<dt>Statement</dt>
8989
<dd>
90-
A [=URI=] MUST never contain a trailing slash. When requesting a resource including a trailing slash, this MUST result in a `404` (not found) error response and not a redirect. This forces API consumers to use the correct [=URI=].
90+
A [=URI=] MUST NOT contain a trailing slash. When requesting a resource including a trailing slash, this MUST result in a `404` (not found) error response and not a redirect. This forces API consumers to use the correct [=URI=].
9191
<div class="note">
9292
This rule does not apply to the root resource (append <code>/</code> to the service root URL).
9393
</div>
@@ -386,7 +386,7 @@ Although the REST architectural style does not impose a specific protocol, REST
386386
<dl>
387387
<dt>Statement</dt>
388388
<dd>
389-
Always use the semantically appropriate HTTP <a href="https://www.rfc-editor.org/rfc/rfc9110#name-status-codes">status code</a> ([[rfc9110]]) for the response.
389+
An API MUST use the semantically appropriate HTTP <a href="https://www.rfc-editor.org/rfc/rfc9110#name-status-codes">status code</a> ([[rfc9110]]) for the response.
390390
</dd>
391391
<dt>Rationale</dt>
392392
<dd>
@@ -470,7 +470,7 @@ https://api.example.org/v1/comments/456</pre>
470470
<dl>
471471
<dt>Statement</dt>
472472
<dd>
473-
Model resource operations as a sub-resource or dedicated resource</a>.
473+
Resource operations MUST be modelled as a sub-resource or dedicated resource</a>.
474474
</dd>
475475
<dt>Rationale</dt>
476476
<dd>
@@ -591,7 +591,7 @@ Changes in APIs are inevitable. APIs should therefore always be versioned, facil
591591
<dl>
592592
<dt>Statement</dt>
593593
<dd>
594-
Implement well-documented deprecation schedules that are communicated in a timely fashion.
594+
The API owner SHOULD implement well-documented deprecation schedules that are communicated in a timely fashion.
595595
</dd>
596596
<dt>Rationale</dt>
597597
<dd>
@@ -651,7 +651,7 @@ Changes in APIs are inevitable. APIs should therefore always be versioned, facil
651651
<dl>
652652
<dt>Statement</dt>
653653
<dd>
654-
Publish a changelog.
654+
A changelog MUST be publised for every API version.
655655
</dd>
656656
<dt>Rationale</dt>
657657
<dd>
@@ -666,7 +666,7 @@ Changes in APIs are inevitable. APIs should therefore always be versioned, facil
666666
<dl>
667667
<dt>Statement</dt>
668668
<dd>
669-
Implement Semantic Versioning.
669+
Semantic Versioning MUST be used for API versioning.
670670
</dd>
671671
<dt>Rationale</dt>
672672
<dd>
@@ -685,7 +685,7 @@ Changes in APIs are inevitable. APIs should therefore always be versioned, facil
685685
<dl>
686686
<dt>Statement</dt>
687687
<dd>
688-
Return the API-Version header.
688+
The API-Version header MUST be returned in a response header in every response.
689689
</dd>
690690
<dt>Rationale</dt>
691691
<dd>
@@ -722,7 +722,7 @@ Note: security controls for signing and encrypting of application level messages
722722
<dl>
723723
<dt>Statement</dt>
724724
<dd>
725-
<p>One should secure all APIs assuming they can be accessed from any location on the internet. Information MUST be exchanged over TLS-based secured connections. No exceptions, so everywhere and always. This is <a href="https://wetten.overheid.nl/BWBR0048156/2023-07-01">required by law</a>.
725+
<p>Information exchanged by APIs MUST be secured using TLS-based connections. No exceptions, so everywhere and always. This is <a href="https://wetten.overheid.nl/BWBR0048156/2023-07-01">required by law</a>.
726726
<p>One MUST follow the latest NCSC guidelines [[NCSC 2025]].
727727
</dd>
728728
<dt>Rationale</dt>
@@ -791,7 +791,7 @@ For outbound filtering, the main concern is leaking of information.
791791
<dl>
792792
<dt>Statement</dt>
793793
<dd>
794-
Return API security headers in all server responses to instruct the client to act in a secure manner
794+
API security headers MUST be returned in all server responses to instruct the client to act in a secure manner
795795
</dd>
796796
<dt>Rationale</dt>
797797
<dd>
@@ -872,7 +872,7 @@ For outbound filtering, the main concern is leaking of information.
872872
<dl>
873873
<dt>Statement</dt>
874874
<dd>
875-
Use CORS to restrict access from other domains for applicable resources
875+
CORS MUST be used to restrict access from other domains for applicable resources
876876
</dd>
877877
<dt>Rationale</dt>
878878
<dd>
@@ -904,23 +904,22 @@ All browser-based applications SHOULD follow the best practices specified in [OA
904904
These applications can be split into three architectural patterns:
905905

906906
* JavaScript applications with a backend; with this class of applications, the backend is the confidential client and should intermediate any interaction, with tokens never ending up in the browser.
907-
Effectively, these are not different from regular web-application for this security facet, even though they leverage JavaScript for implementation.
907+
Effectively, these are not different from regular web-application for this security facet, even though they leverage JavaScript for implementation.
908908
* JavaScript applications that share a domain with the API (resource server); these can leverage cookies marked as HTTP-Only, Secure and SameSite.
909909
* JavaScript applications without a backend; these clients are considered public clients, and are potentially more vulnerable to several types of attacks, including Cross-Site Scripting (XSS), Cross Site Request Forgery (CSRF) and OAuth token theft.
910-
In order to support these clients, the Cross-Origin Resource Sharing (CORS) policy mentioned above is critical and MUST be supported.
910+
In order to support these clients, the Cross-Origin Resource Sharing (CORS) policy mentioned above is critical and MUST be supported.
911911

912912
### Validate content types
913913

914-
A REST request or response body SHOULD match the intended content type in the header.
915-
Otherwise this could cause misinterpretation at the consumer/producer side and lead to code injection/execution.
914+
A REST request or response body SHOULD match the intended content type in the header. Otherwise this could cause misinterpretation at the consumer/producer side and lead to code injection/execution.
916915

917-
* Reject requests containing unexpected or missing content type headers with HTTP response status `406 Not Acceptable` or `415 Unsupported Media Type`.
918-
* Avoid accidentally exposing unintended content types by explicitly defining content types e.g. Jersey (Java) `@consumes("application/json"); @produces("application/json")`.
919-
This avoids XXE-attack vectors for example.
916+
* Requests containing unexpected or missing content type headers MUST be rejected with HTTP response status `406 Not Acceptable` or `415 Unsupported Media Type`.
917+
* Accidentally exposing unintended content types MUST be avoided by explicitly defining content types e.g. Jersey (Java) `@consumes("application/json"); @produces("application/json")`.
918+
This avoids XXE-attack vectors for example.
920919

921-
It is common for REST services to allow multiple response types (e.g. `application/xml` or `application/json`, and the client specifies the preferred order of response types by the Accept header in the request.
920+
It is common for REST services to allow multiple response types (e.g. `application/xml` or `application/json`) in which case then the client specifies the preferred order of response types by the Accept header in the request.
922921

923-
* Do NOT simply copy the `Accept` header to the `Content-type` header of the response.
922+
* Do not simply copy the `Accept` header to the `Content-type` header of the response.
924923
* Reject the request (ideally with a `406 Not Acceptable` response) if the Accept header does not specifically contain one of the allowable types.
925924

926925
Services (potentially) including script code (e.g. JavaScript) in their responses MUST be especially careful to defend against header injection attacks.

0 commit comments

Comments
 (0)