Skip to content

Commit 942e92b

Browse files
committed
* Moved the registration of the validator from the configure() to the afterAspectsLoad() interception point to allow for modules to declare the validator if needed.
1 parent 4b2250b commit 942e92b

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
----
99

10+
## [2.10.0] => 2020-DEC-
11+
12+
### Added
13+
14+
* Moved the registration of the validator from the `configure()` to the `afterAspectsLoad()` interception point to allow for modules to declare the validator if needed.
15+
16+
----
17+
1018
## [2.9.0] => 2020-DEC-11
1119

1220
### Fixed

interceptors/Security.cfc

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ component accessors="true" extends="coldbox.system.Interceptor" {
3232
if ( len( variables.invalidEventHandler ) ) {
3333
variables.onInvalidEventHandlerBean = handlerService.getHandlerBean( variables.invalidEventHandler );
3434
}
35-
35+
3636
// init the security modules dictionary
3737
variables.securityModules = {};
3838

@@ -49,10 +49,7 @@ component accessors="true" extends="coldbox.system.Interceptor" {
4949
setProperty( "rules", variables.rulesLoader.loadRules( getProperties() ) );
5050
}
5151

52-
// Load up the validator
53-
registerValidator( getInstance( getProperty( "validator" ) ) );
54-
55-
// Coldbox version 5 (and lower) needs a little extra invalid event handler checking.
52+
// Coldbox version 5 (and lower) needs a little extra invalid event handler checking.
5653
variables.enableInvalidHandlerCheck = ( listGetAt( controller.getColdboxSettings().version, 1, "." ) <= 5 );
5754
}
5855

@@ -66,6 +63,10 @@ component accessors="true" extends="coldbox.system.Interceptor" {
6663
prc,
6764
buffer
6865
){
66+
67+
// Register the validator
68+
registerValidator( getInstance( getProperty( "validator" ) ) );
69+
6970
// Register cbSecurity modules so we can incorporate them.
7071
controller
7172
.getSetting( "modules" )
@@ -241,14 +242,14 @@ component accessors="true" extends="coldbox.system.Interceptor" {
241242
){
242243
// Get handler bean for the current event
243244
var handlerBean = variables.handlerService.getHandlerBean( arguments.event.getCurrentEvent() );
244-
245+
245246
// Are we running Coldbox 5 or older?
246247
// is an onInvalidHandlerBean configured?
247248
// is the current handlerBean the configured onInvalidEventHandlerBean?
248-
if (
249-
variables.enableInvalidHandlerCheck &&
250-
!isNull( variables.onInvalidEventHandlerBean ) &&
251-
isInvalidEventHandlerBean( handlerBean )
249+
if (
250+
variables.enableInvalidHandlerCheck &&
251+
!isNull( variables.onInvalidEventHandlerBean ) &&
252+
isInvalidEventHandlerBean( handlerBean )
252253
) {
253254
// ColdBox tries to detect invalid event handler loops by keeping
254255
// track of the last invalid event to fire. If that invalid event
@@ -260,7 +261,7 @@ component accessors="true" extends="coldbox.system.Interceptor" {
260261
request._lastInvalidEvent = variables.invalidEventHandler;
261262
return;
262263
}
263-
264+
264265
if ( handlerBean.getHandler() == "" ) {
265266
return;
266267
}
@@ -741,7 +742,7 @@ component accessors="true" extends="coldbox.system.Interceptor" {
741742

742743
return len( CGI.REMOTE_ADDR ) ? CGI.REMOTE_ADDR : "127.0.0.1";
743744
}
744-
745+
745746
/**
746747
* Returns true of the passed handlerBean matches Coldbox's configured invalid event handler.
747748
*

0 commit comments

Comments
 (0)