nsmcp::HttpTransport method dedicatedQuestionCredential (protected)

 <instance of nsmcp::HttpTransport[i]> dedicatedQuestionCredential \
    authorization server

Defined in /usr/local/ns/tcl/nsmcp/transport.tcl

A question request can reach another server process without its process-local observer. The configured question token still identifies the caller, so keep its read-only tool and compact-result policy.

Parameters:
authorization (required)
server (required)

Testcases:
No testcase defined.
Source code:
if {![regexp {^Bearer ([A-Za-z0-9._~+/-]+=*)$} $authorization -> token]} {
    return false
}
set path [ns_config ns/server/$server/module/nsmcp questionMcpTokenFile {}]
if {$path eq "" || ![file isfile $path] || ![file readable $path]} {
    return false
}
set channel [open $path rb]
try {
    set configured [string trim [read $channel 4097] "\r\n"]
} finally {
    close $channel
}
return [expr {[ns_crypto::md string -digest sha256 -- $token] eq
    [ns_crypto::md string -digest sha256 -- $configured]}]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: