lucee.Componentmodels.util.RulesLoader
Copyright since 2016 by Ortus Solutions, Corp www.ortussolutions.com --- Rule loader service. This object is in charge of loading rules from many different types of sources: - xml - json - array - database - model
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
controller
|
true
|
false
|
|
any
|
wirebox
|
true
|
false
|
Constructor Summary | |
---|---|
init()
Constructor. |
Method Summary | |
---|---|
string
|
getController()
|
struct
|
getRuleTemplate()
Creates a default rule template with all our required fields and defaults. |
string
|
getWirebox()
|
array
|
loadDBRules(any provider, [any defaults='[runtime expression]'])
Load rules from a database. |
array
|
loadJsonRules(any provider, [any defaults='[runtime expression]'])
Load rules from json file. |
any
|
loadModelRules(any provider, [any defaults='[runtime expression]'])
Load rules from an IOC bean. |
array
|
loadRules(any provider, [any defaults='[runtime expression]'])
Load the appropriate rules from the source and return them in consumable focus. |
any
|
loadXmlRules(any provider, [any defaults='[runtime expression]'])
Load rules from an XML file. |
array
|
normalizeRules(array rules, [any module=''], [any defaults='[runtime expression]'])
Utility function to normalize an array of rules to our standards. |
private struct
|
parseXmlRule(any xmlNode)
Parse an XML node into a cbSecurity rule. |
private any
|
queryToArray(any query)
Convert the query to an array of rules. |
RulesLoader
|
rulesSourceChecks(any provider)
Validate from where we are getting rules from. |
any
|
setController(any controller)
|
any
|
setWirebox(any wirebox)
|
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
Property Detail |
---|
access
- publicrequired
- falsereturntype
- anyinject
- coldboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- wireboxserializable
- trueMethod Detail |
---|
Creates a default rule template with all our required fields and defaults
Load rules from a database
provider
- The firewall rules provider configurationdefaults
- Defaults to incorporate to each ruleLoad rules from json file
provider
- The firewall rules provider configurationdefaults
- Defaults to incorporate to each ruleLoad rules from an IOC bean
provider
- The firewall rules provider configurationdefaults
- Defaults to incorporate to each ruleLoad the appropriate rules from the source and return them in consumable focus.
provider
- The firewall rules provider configurationdefaults
- Defaults to incorporate to each ruleLoad rules from an XML file
provider
- The firewall rules provider configurationdefaults
- Defaults to incorporate to each ruleUtility function to normalize an array of rules to our standards
rules
- The rules to normalizemodule
- The module to incorporate if passeddefaults
- A set of defaults to incorporate into the rulesParse an XML node into a cbSecurity rule
xmlNode
- The XML node to parseConvert the query to an array of rules
query
- The target query to convertValidate from where we are getting rules from. This prepares the settings and normalizes them.
provider
- The firewall rules provider configurationcontroller
wirebox