nsmcp::AccessAnalytics method validateWindow (public)

 <instance of nsmcp::AccessAnalytics[i]> validateWindow options

Defined in /usr/local/ns/tcl/nsmcp/access-analytics.tcl

Validate summary windows and access-record filters. Keep supported filter options separate while the superclass validates time and bucket bounds.

Parameters:
options (required)
Tcl dictionary containing the operation options.
Returns:
The normalized options dictionary, including retained filters.

Testcases:
No testcase defined.
Source code:
set extra {}
foreach key {path status pool peer authenticationState windowSeconds includePeerAddresses} {
    if {![dict exists $options $key]} {
        continue
    }
    set value [dict get $options $key]
    if {$key eq "windowSeconds"} {
        if {![string is entier -strict $value] || $value<0 || $value>3600} {
            error "windowSeconds must be between 0 and 3600"
        }
    } elseif {$key eq "includePeerAddresses"} {
        if {![string is boolean -strict $value]} {
            error "includePeerAddresses must be boolean"
        }
    } elseif {$key eq "peer"} {
        if {![ns_ip valid $value]} {
            error "peer must be a valid IP address"
        }
    } elseif {$key eq "authenticationState"} {
        if {$value ni {anonymous authenticated unknown}} {
            error "Invalid authenticationState"
        }
    } elseif {$key eq "status"} {
        if {![string is entier -strict $value] || $value<100 || $value>599} {
            error "status must be between 100 and 599"
        }
    } elseif {$value eq "" || [string length $value]>512 || [string first \x00 $value]>=0} {
        error "invalid exact path or pool filter"
    }
    dict set extra $key $value
    dict unset options $key
}
return [dict merge [next [list $options]] $extra]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: