nsmcp::BearerAuthenticator method issue (public)
<instance of nsmcp::BearerAuthenticator> issue principal \ permissions targets expires
Defined in /usr/local/ns/tcl/nsmcp/security.tcl
Create and grant a new bearer credential. Generate a high-entropy token, store only its digest and grants, and return the secret to the administrator once.
- Parameters:
- principal (required)
- Authenticated principal identifier.
- permissions (required)
- Explicit permission names granted to the credential.
- targets (required)
- Server names which the credential may target.
- expires (required)
- Expiry timestamp in epoch seconds, or zero for no expiry.
- Returns:
- A dictionary containing token, digest and expires.
- Testcases:
- No testcase defined.
Source code: # Explicit administrative operation; never called automatically at init. # Return the secret once, without logging it or storing it in nsv. set token [ns_crypto::randombytes -encoding hex 32] set digest [:grant $token $principal $permissions $targets $expires] return [dict create token $token digest $digest expires $expires]XQL Not present: Generic, PostgreSQL, Oracle
![[i]](/resources/acs-subsite/ZoomIn16.gif)