sec_populate_secret_tokens_cache (private)

 sec_populate_secret_tokens_cache

Defined in packages/acs-tcl/tcl/security-procs.tcl

Randomly populates the secret_tokens cache.

Partial Call Graph (max 5 caller/called nodes):
%3 packages/acs-tcl/tcl/security-init.tcl packages/acs-tcl/ tcl/security-init.tcl sec_populate_secret_tokens_cache sec_populate_secret_tokens_cache packages/acs-tcl/tcl/security-init.tcl->sec_populate_secret_tokens_cache sec_populate_secret_tokens_thread_cache sec_populate_secret_tokens_thread_cache (private) sec_populate_secret_tokens_thread_cache->sec_populate_secret_tokens_cache db_foreach db_foreach (public) sec_populate_secret_tokens_cache->db_foreach db_release_unused_handles db_release_unused_handles (public) sec_populate_secret_tokens_cache->db_release_unused_handles db_table_exists db_table_exists (public) sec_populate_secret_tokens_cache->db_table_exists parameter::get parameter::get (public) sec_populate_secret_tokens_cache->parameter::get

Testcases:
No testcase defined.
Source code:
    set num_tokens [parameter::get  -package_id $::acs::kernel_id  -parameter NumberOfCachedSecretTokens  -default 100]

    # this is called directly from security-init.tcl,
    # so it runs during the install before the data model has been loaded
    if { [db_table_exists secret_tokens] } {
        db_foreach get_secret_tokens {} {
            nsv_set secret_tokens $token_id $token
        }
    }
    db_release_unused_handles
Generic XQL file:
packages/acs-tcl/tcl/security-procs.xql

PostgreSQL XQL file:
<fullquery name="sec_populate_secret_tokens_cache.get_secret_tokens">
    <querytext>

    select token_id, token
    from secret_tokens,
         (select cast(random() * count(*) - :num_tokens as integer) as first
            from secret_tokens) r
    where token_id >= r.first and r.first + :num_tokens > token_id

      </querytext>
</fullquery>
packages/acs-tcl/tcl/security-procs-postgresql.xql

Oracle XQL file:
<fullquery name="sec_populate_secret_tokens_cache.get_secret_tokens">
    <querytext>

	    select * from (
	    select token_id, token
	    from secret_tokens
	    sample(15)
	    ) where rownum < :num_tokens

      </querytext>
</fullquery>
packages/acs-tcl/tcl/security-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: