forked from gpickin/coldbox-plugin-BCrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleConfig.cfc
More file actions
49 lines (42 loc) · 1.27 KB
/
ModuleConfig.cfc
File metadata and controls
49 lines (42 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
component {
// Module Properties
this.title = "CryptBox";
this.author = "Seth Feldkamp";
this.webURL = "https://github.com/sfeldkamp/coldbox-plugin-BCrypt";
this.description = "A ColdBox library for BCrypt for creating cryptographically strong (and slow) password hashes.";
this.version = "2.1.0";
this.modelNamespace = "bcrypt";
this.cfmapping = "bcrypt";
// Module Dependencies That Must Be Loaded First, use internal names or aliases
this.dependencies = [ "cbjavaloader" ];
function configure(){
// Module Settings
settings = {
libPath = modulePath & "/models/lib"
};
}
/**
* Fired when the module is registered and activated.
*/
function onLoad(){
// parse parent settings
parseParentSettings();
// Class load antisamy
wireBox.getInstance( "loader@cbjavaloader" )
.appendPaths( settings.libPath );
}
/**
* parse parent settings
*/
private function parseParentSettings(){
var oConfig = controller.getSetting( "ColdBoxConfig" );
var configStruct = controller.getConfigSettings();
var bcryptDSL = oConfig.getPropertyMixin( "bCrypt", "variables", structnew() );
//defaults
configStruct.bCrypt = {
workFactor = 12
};
// incorporate settings
structAppend( configStruct.bCrypt, bcryptDSL, true );
}
}