Skip to content

Conversation

michaelborn
Copy link
Contributor

@michaelborn michaelborn commented Dec 10, 2020

…from module settings

The current syntax for module cbsecurity rules only appears to support a rules[] array when pulling cbSecurity module settings from the module's settings struct. (See module rules documentation for example.)

This commit adds support for full JSON/XML/model rules so folks can use their rule syntax of choice in module configurations.

For example, the following now works to pull in rules from #modulePath#/config/security.json.cfm:

// modules_app/myModule/ModuleConfig.cfc
settings = {
	// CB Security Rules to append to global rules
	cbsecurity = {
		"rules"	: "#modulePath#/config/security.json.cfm"
	}
};

Previously, this would throw an error: The RULES argument passed to the normalizeRules function is not of type array, precisely because only an array of rules was supported or expected in cbSecurity configuration pulled from a module.

…from module settings

The current syntax for module cbsecurity rules only appears to support a `rules[]` array. (See [module rules documentation](https://coldbox-security.ortusbooks.com/getting-started/first-chapter/rule-sources/module-rules) for example.) This commit adds support for full JSON/XML/model rules so folks can use their rule syntax of choice in module configurations.
@lmajano lmajano merged commit 0bef69a into coldbox-modules:development Dec 11, 2020
@lmajano
Copy link
Contributor

lmajano commented Dec 11, 2020

@michaelborn I also need a documentation udpate on the docs for this feature please.

michaelborn added a commit to michaelborn/cbsecurity-docs that referenced this pull request Dec 14, 2020
Document that modules can have different source rules too... since coldbox-modules/cbsecurity#21
@michaelborn
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants