#  -*- text -*-
#
#
#  $Id: 27dfb9c655ece7577f205e53ee0bc1a04be26bb4 $

#######################################################################
#
#  = Python Module
#
#  The `python` module processes attributes through a Python interpreter.
#
#  * Please see the `src/modules/rlm_python/example.py` sample.
#  * Please see https://www.python.org/doc/ for more information about the
#  Python language.
#
#  NOTE: Uncomment any `func_*` configuration items below which are
#  included in your module. If the module is called for a section which
#  does not have a function defined, it will return `noop`.
#
#  NOTE: As of FreeRADIUS v4, the Python function names called when the `python`
#  module is called are automatically derived from the section in which
#  they are called.
#
#  e.g. if `python` is called in `recv Access-Request`, firstly a function
#  `recv_access_request` will be looked for.  If that does not exist, then
#  a function `recv` will be looked for.
#
#  This can be overridden by setting `func_recv_access_request` or `func_recv`
#  to point to a different function name.
#
#  Similarly, `mod_recv_access_request` or `mod_recv` can be used to
#  load the function from a module other than the one specified in the
#  `module` option.

#
#  Please see the file global.d/python for server-global configuration
#  items which control the Python path.
#

#
#  [NOTE]
#  ====
#  See `global.d/python` for configuration items that affect the
#  python interpreter globally, such as the Python path.
#  ====
#

#
#  == Configuration Settings
#
#  The Python API `threading.local()` may be used store thread
#  specific data such as connection handles.
#
python {
	#
	#  module::
	#
	#  Module to load functions from.
	#
	module = example

	#
	#  [NOTE]
	#  ====
	#  * You may set `mod_<section>` for any of the section to module
	#  mappings below, if you want to reference a function in a  different
	#  module.
	#
	#  * Uncomment `func_<section>` lines your module provides methods for.
	#  ====
	#

	#
	#  func_instantiate:: Called on module instantiation.
	#
#	func_instantiate = instantiate

	#
	#  func_detach:: Called on module unload.
	#
#	func_detach = detach

	#
	#  config { ... }::
	#
	#  You can define configuration items (and nested sub-sections) in python `config { ... }`
	#  section. These items will be accessible in the Python script through `freeradius.config`
	#  dict for instance:
	#
	#  e.g:
	#
	#  [source,python]
	#  ----
	#  freeradius.config['name']
	#  freeradius.config['sub-config']['name']
	#  ----
	#
#	config {
#		name = "value"
#		sub-config {
#			name = "value of name from config.sub-config"
#		}
#	}
}
