webauthn::json_contract (public)

 webauthn::json_contract docstring query_specs

Defined in packages/webauthn/tcl/webauthn-procs.tcl

Helper for JSON endpoints with page-contract-like parameter validation. This procedure validates and normalizes request parameters according to 'query_specs#, using OpenACS page-contract filters via 'ad_page_contract_filter_invoke'. Parsed values are exported into the caller’s scope (via 'uplevel') so the endpoint can use them as normal Tcl variables. On validation failure, this procedure does not generate HTML complaint output. Instead, it returns a JSON error (HTTP 400) using [$auth_obj return_err], taking the first complaint message from 'ad_complaints_get_list', and aborts the script via 'ad_script_abort'.

Parameters:
docstring (required)
Human-readable endpoint documentation (currently unused by this helper; included to mirror 'ad_page_contract' call style and for future diagnostics/logging).
query_specs (required)
List of parameter specifications, like in 'ad_page_contract'
Returns:
The configured WebAuthn auth object (currently '::webauthn::passkey')

Partial Call Graph (max 5 caller/called nodes):
_ _ (public) ad_complain ad_complain (public) ad_complaints_get_list ad_complaints_get_list (public) ad_page_contract_filter_invoke ad_page_contract_filter_invoke (public) ad_script_abort ad_script_abort (public) webauthn::json_contract webauthn::json_contract webauthn::json_contract->_ webauthn::json_contract->ad_complain webauthn::json_contract->ad_complaints_get_list webauthn::json_contract->ad_page_contract_filter_invoke webauthn::json_contract->ad_script_abort

Testcases:
No testcase defined.
[ show source ]
Show another procedure: