@@ -51,7 +51,7 @@ local MAX_CONTENT_BYTES = tonumber(os.getenv("SITE_MAX_CONTENT_BYTES") or "") or
5151function handlers .ResolveRoute (msg )
5252 local ok , missing = validation .require_fields (msg , { " Site-Id" , " Path" })
5353 if not ok then return codec .error (" INVALID_INPUT" , " Missing field" , { missing = missing }) end
54- local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Path" , " Actor-Role" , " Schema-Version" })
54+ local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Path" , " Actor-Role" , " Schema-Version" , " Signature " })
5555 if not ok_extra then return codec .error (" UNSUPPORTED_FIELD" , " Unexpected fields" , { unexpected = extras }) end
5656 local ok_len_site , err_site = validation .check_length (msg [" Site-Id" ], 128 , " Site-Id" )
5757 if not ok_len_site then return codec .error (" INVALID_INPUT" , err_site , { field = " Site-Id" }) end
7474function handlers .GetPage (msg )
7575 local ok , missing = validation .require_fields (msg , { " Site-Id" , " Page-Id" })
7676 if not ok then return codec .error (" INVALID_INPUT" , " Missing field" , { missing = missing }) end
77- local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Page-Id" , " Version" , " Actor-Role" , " Schema-Version" })
77+ local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Page-Id" , " Version" , " Actor-Role" , " Schema-Version" , " Signature " })
7878 if not ok_extra then return codec .error (" UNSUPPORTED_FIELD" , " Unexpected fields" , { unexpected = extras }) end
7979 local ok_len_site , err_site = validation .check_length (msg [" Site-Id" ], 128 , " Site-Id" )
8080 if not ok_len_site then return codec .error (" INVALID_INPUT" , err_site , { field = " Site-Id" }) end
101101function handlers .GetLayout (msg )
102102 local ok , missing = validation .require_fields (msg , { " Layout-Id" })
103103 if not ok then return codec .error (" INVALID_INPUT" , " Missing field" , { missing = missing }) end
104- local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Layout-Id" , " Version" , " Actor-Role" , " Schema-Version" })
104+ local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Layout-Id" , " Version" , " Actor-Role" , " Schema-Version" , " Signature " })
105105 if not ok_extra then return codec .error (" UNSUPPORTED_FIELD" , " Unexpected fields" , { unexpected = extras }) end
106106 local ok_len_layout , err_layout = validation .check_length (msg [" Layout-Id" ], 128 , " Layout-Id" )
107107 if not ok_len_layout then return codec .error (" INVALID_INPUT" , err_layout , { field = " Layout-Id" }) end
125125function handlers .GetNavigation (msg )
126126 local ok , missing = validation .require_fields (msg , { " Site-Id" , " Menu-Id" })
127127 if not ok then return codec .error (" INVALID_INPUT" , " Missing field" , { missing = missing }) end
128- local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Menu-Id" , " Version" , " Actor-Role" , " Schema-Version" })
128+ local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Menu-Id" , " Version" , " Actor-Role" , " Schema-Version" , " Signature " })
129129 if not ok_extra then return codec .error (" UNSUPPORTED_FIELD" , " Unexpected fields" , { unexpected = extras }) end
130130 local ok_len_site , err_site = validation .check_length (msg [" Site-Id" ], 128 , " Site-Id" )
131131 if not ok_len_site then return codec .error (" INVALID_INPUT" , err_site , { field = " Site-Id" }) end
152152function handlers .PutDraft (msg )
153153 local ok , missing = validation .require_fields (msg , { " Site-Id" , " Page-Id" , " Content" })
154154 if not ok then return codec .error (" INVALID_INPUT" , " Missing field" , { missing = missing }) end
155- local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Page-Id" , " Content" , " Actor-Role" , " Schema-Version" , " ExpectedVersion" })
155+ local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Page-Id" , " Content" , " Actor-Role" , " Schema-Version" , " ExpectedVersion" , " Signature " })
156156 if not ok_extra then return codec .error (" UNSUPPORTED_FIELD" , " Unexpected fields" , { unexpected = extras }) end
157157 local ok_len_site , err_site = validation .check_length (msg [" Site-Id" ], 128 , " Site-Id" )
158158 if not ok_len_site then return codec .error (" INVALID_INPUT" , err_site , { field = " Site-Id" }) end
176176function handlers .UpsertRoute (msg )
177177 local ok , missing = validation .require_fields (msg , { " Site-Id" , " Path" , " Page-Id" })
178178 if not ok then return codec .error (" INVALID_INPUT" , " Missing field" , { missing = missing }) end
179- local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Path" , " Page-Id" , " Layout-Id" , " Type" , " Actor-Role" , " Schema-Version" })
179+ local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Path" , " Page-Id" , " Layout-Id" , " Type" , " Actor-Role" , " Schema-Version" , " Signature " })
180180 if not ok_extra then return codec .error (" UNSUPPORTED_FIELD" , " Unexpected fields" , { unexpected = extras }) end
181181 local ok_len_site , err_site = validation .check_length (msg [" Site-Id" ], 128 , " Site-Id" )
182182 if not ok_len_site then return codec .error (" INVALID_INPUT" , err_site , { field = " Site-Id" }) end
204204function handlers .PublishVersion (msg )
205205 local ok , missing = validation .require_fields (msg , { " Site-Id" , " Version" })
206206 if not ok then return codec .error (" INVALID_INPUT" , " Missing field" , { missing = missing }) end
207- local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Version" , " ExpectedVersion" , " Actor-Role" , " Schema-Version" })
207+ local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Version" , " ExpectedVersion" , " Actor-Role" , " Schema-Version" , " Signature " })
208208 if not ok_extra then return codec .error (" UNSUPPORTED_FIELD" , " Unexpected fields" , { unexpected = extras }) end
209209 local ok_len_site , err_site = validation .check_length (msg [" Site-Id" ], 128 , " Site-Id" )
210210 if not ok_len_site then return codec .error (" INVALID_INPUT" , err_site , { field = " Site-Id" }) end
251251function handlers .ArchivePage (msg )
252252 local ok , missing = validation .require_fields (msg , { " Site-Id" , " Page-Id" })
253253 if not ok then return codec .error (" INVALID_INPUT" , " Missing field" , { missing = missing }) end
254- local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Page-Id" , " Version" , " Actor-Role" , " Schema-Version" })
254+ local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Page-Id" , " Version" , " Actor-Role" , " Schema-Version" , " Signature " })
255255 if not ok_extra then return codec .error (" UNSUPPORTED_FIELD" , " Unexpected fields" , { unexpected = extras }) end
256256 local ok_len_site , err_site = validation .check_length (msg [" Site-Id" ], 128 , " Site-Id" )
257257 if not ok_len_site then return codec .error (" INVALID_INPUT" , err_site , { field = " Site-Id" }) end
@@ -273,7 +273,7 @@ function handlers.RecordOrder(msg)
273273 local ok , missing = validation .require_fields (msg , { " Site-Id" , " Order-Id" , " Status" })
274274 if not ok then return codec .error (" INVALID_INPUT" , " Missing field" , { missing = missing }) end
275275 local ok_extra , extras = validation .require_no_extras (msg , {
276- " Action" , " Request-Id" , " Site-Id" , " Order-Id" , " Status" , " TotalAmount" , " Currency" , " VatRate" , " Actor-Role" , " Schema-Version"
276+ " Action" , " Request-Id" , " Site-Id" , " Order-Id" , " Status" , " TotalAmount" , " Currency" , " VatRate" , " Actor-Role" , " Schema-Version" , " Signature "
277277 })
278278 if not ok_extra then return codec .error (" UNSUPPORTED_FIELD" , " Unexpected fields" , { unexpected = extras }) end
279279 state .orders [msg [" Site-Id" ]] = state .orders [msg [" Site-Id" ]] or {}
297297function handlers .GetOrder (msg )
298298 local ok , missing = validation .require_fields (msg , { " Site-Id" , " Order-Id" })
299299 if not ok then return codec .error (" INVALID_INPUT" , " Missing field" , { missing = missing }) end
300- local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Order-Id" , " Actor-Role" , " Schema-Version" })
300+ local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Order-Id" , " Actor-Role" , " Schema-Version" , " Signature " })
301301 if not ok_extra then return codec .error (" UNSUPPORTED_FIELD" , " Unexpected fields" , { unexpected = extras }) end
302302 local site_orders = state .orders [msg [" Site-Id" ]] or {}
303303 local order = site_orders [msg [" Order-Id" ]]
319319function handlers .ListOrders (msg )
320320 local ok , missing = validation .require_fields (msg , { " Site-Id" })
321321 if not ok then return codec .error (" INVALID_INPUT" , " Missing field" , { missing = missing }) end
322- local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Status" , " Page" , " PageSize" , " Actor-Role" , " Schema-Version" })
322+ local ok_extra , extras = validation .require_no_extras (msg , { " Action" , " Request-Id" , " Site-Id" , " Status" , " Page" , " PageSize" , " Actor-Role" , " Schema-Version" , " Signature " })
323323 if not ok_extra then return codec .error (" UNSUPPORTED_FIELD" , " Unexpected fields" , { unexpected = extras }) end
324324 local page = tonumber (msg .Page or 1 ) or 1
325325 local page_size = tonumber (msg .PageSize or 20 ) or 20
0 commit comments