Skip to content

Commit 1c8584f

Browse files
committed
feat!: General Triggers
Based on discussions in #1 and #3, the Triggers section has been completely re-written: + Normative requirements only specify notifications being triggered whenever the state of a LDP Resource is modified. + HTTP specific triggers are moved to implementation guidance: + PUT/PATCH requests being used to create a resource inside a container resulting in a 201 response are notification triggers. + PUT/PATCH requests successfully modifying a resource with 205 response are notification triggers. + Unless POST is being used to create a child resource, it should also trigger the resource's parent container to send notifications. + HTTP specific triggers have been combined into a single table for easier comprehension. Signed-off-by: Rahul Gupta <CxRes@users.noreply.github.com>
1 parent 8e715f6 commit 1c8584f

2 files changed

Lines changed: 83 additions & 46 deletions

File tree

src/index.bs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ Status Text:
5757
}
5858

5959
table.auto {
60-
width: 100%;
6160
table-layout: auto;
6261
}
6362

@@ -81,6 +80,17 @@ Status Text:
8180
vertical-align: top;
8281
}
8382

83+
th.center {
84+
text-align: center;
85+
width: fit-content;
86+
}
87+
88+
td.tick {
89+
text-align: center;
90+
vertical-align: middle;
91+
font-weight: 800;
92+
}
93+
8494
@media (prefers-color-scheme: dark) {
8595
table {
8696
border-color: white;

src/sections/triggers.md

Lines changed: 72 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,74 @@
11
# Triggers # {#triggers}
22

3-
The Solid Protocol [[!SOLID]] requires an LDP container's state is modified when certain HTTP events occur on a contained resource. Thus, an HTTP event on a resource can trigger a [=Solid server=] to transmit [PREP] notification not only on that resource but also on its container.
4-
5-
A [=Solid server=] implementing the [SUPER] on an LDP Resource SHOULD send a [PREP] notification to a [=Solid client=] upon the following triggers:
6-
7-
## Resources and their Containers ## {#triggers-resource-and-their-containers}
8-
9-
When a request sent to the resource or a contained resource within it, with one of the following [[RFC9110#section-9|HTTP methods]] generates a response with any of the following [[RFC9110#section-15|HTTP status codes]]:
10-
11-
<table class="numbered">
12-
<caption> Notification Triggers (Resources and their Containers)
13-
<tr>
14-
<th> Request Method
15-
<th> Response Status
16-
<tr>
17-
<td>
18-
<code> [[RFC9110#section-9.3.4|PUT]] <br>
19-
<code> [[RFC5789#section-2|PATCH]] <br>
20-
<code> [[RFC9110#section-9.3.5|DELETE]]
21-
<td>
22-
<code> [[RFC9110#section-15.3.1|200 (OK)]] <br>
23-
<code> [[RFC9110#section-15.3.5|204 (No Content)]] <br>
24-
</table>
25-
26-
## Resources only ## {#triggers-resources-only}
27-
28-
When a request sent to the resource with one of the following [[RFC9110#section-9|HTTP methods]] generates a response with any of the following [[RFC9110#section-15|HTTP status codes]]:
29-
30-
<table class="numbered">
31-
<caption> Notification Triggers (Resource only)
32-
<tr>
33-
<th> Request Method
34-
<th> Response Status
35-
<tr>
36-
<td>
37-
<code> [[RFC9110#section-9.3.3|POST]] <br>
38-
<td>
39-
<code> [[RFC9110#section-15.3.1|200 (OK)]] <br>
40-
<code> [[RFC9110#section-15.3.5|204 (No Content)]] <br>
41-
<code> [[RFC9110#section-15.3.2|201 (Created)]] <br>
42-
<code> [[RFC9110#section-15.3.6|205 (Reset Content)]]
43-
</table>
44-
45-
## Don't Jump the Gun ## {#trigger-timing}
46-
47-
A [=Solid server=] MUST NOT transmit a [PREP] notification to a [=Solid client=] before a response has been sent to the user agent that initiated the request that triggered the said notification.
3+
A [=Solid server=] implementing the [SUPER] on an LDP Resource SHOULD send a [PREP] notification when the state of the said resource is modified.
4+
5+
A [=Solid server=] MUST NOT transmit a [PREP] notification before the resource has been modified and a confirmation (if necessary) has been sent to (but might not have been received by) the agent that initiated the resource modification.
6+
7+
<div class="advisement">
8+
<div class="marker">Implementation Guidance</div>
9+
10+
<p>The Solid Protocol [[SOLID]] requires an LDP container's state is modified when certain HTTP events occur on a contained resource. Thus, an HTTP event on a resource can trigger a [=Solid server=] to transmit a [PREP] notification on that resource or its container or both.
11+
12+
<p>It follows that a [=Solid server=] ought to send [PREP] notification(s) on an resource and/or its container, when a request with one of the following [[RFC9110#section-9|HTTP methods]] generates a response with any of the following [[RFC9110#section-15|HTTP status codes]]:
13+
14+
<table class="numbered auto">
15+
<caption> HTTP Notification Triggers
16+
<tr>
17+
<th rowspan=2> Request Method
18+
<th rowspan=2> Response Status
19+
<th colspan=2 class="center"> Notify
20+
<tr>
21+
<th class="center"> Resource
22+
<th class="center"> Container
23+
<tr>
24+
<td rowspan=2>
25+
<code> [[RFC9110#section-9.3.4|PUT]] <br>
26+
<code> [[RFC5789#section-2|PATCH]] <br>
27+
<td>
28+
<code> [[RFC9110#section-15.3.1|200 (OK)]] <br>
29+
<code> [[RFC9110#section-15.3.5|204 (No Content)]] <br>
30+
<code> [[RFC9110#section-15.3.6|205 (Reset Content)]]
31+
<td class="tick">
32+
&check;
33+
<td class="tick">
34+
&check;
35+
<tr>
36+
<td>
37+
<code> [[RFC9110#section-15.3.2|201 (Created)]] <br>
38+
<td>
39+
<td class="tick">
40+
&check;
41+
<tr>
42+
<td rowspan=2>
43+
<code> [[RFC9110#section-9.3.3|POST]]
44+
<td>
45+
<code> [[RFC9110#section-15.3.1|200 (OK)]] <br>
46+
<code> [[RFC9110#section-15.3.5|204 (No Content)]] <br>
47+
<code> [[RFC9110#section-15.3.6|205 (Reset Content)]]
48+
<td class="tick">
49+
&check;
50+
<td class="tick">
51+
&check;
52+
<tr>
53+
<td>
54+
<code> [[RFC9110#section-15.3.2|201 (Created)]]
55+
<td class="tick">
56+
&check;
57+
<tr>
58+
<td>
59+
<code> [[RFC9110#section-9.3.5|DELETE]]
60+
<td>
61+
<code> [[RFC9110#section-15.3.1|200 (OK)]] <br>
62+
<code> [[RFC9110#section-15.3.5|204 (No Content)]] <br>
63+
<td class="tick">
64+
&check;
65+
<td class="tick">
66+
&check;
67+
</table>
68+
<br/>
69+
70+
<p>Additionally, a [=Solid server=] ought to send [PREP] notification(s) on an resource and/or its container when modified at a later time as result of HTTP request that generates a <code>[[RFC9110#section-15.3.3|202 (Accepted)]]</code> status code.
71+
72+
<p>A [=Solid server=] needs to ensure that a [PREP] notification is not transmitted before a response has been sent to the user agent that initiated the HTTP request that triggered the said notification.
73+
74+
</div>

0 commit comments

Comments
 (0)