File tree 3 files changed +6
-30
lines changed 3 files changed +6
-30
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ class AppSecConfig {
19
19
}
20
20
21
21
versions ( options ) {
22
-
23
22
return this . _configProvider . getConfigId ( options . config )
24
23
. then ( ( configId ) => {
25
24
return new Promise ( ( resolve ) => {
@@ -51,7 +50,6 @@ class AppSecConfig {
51
50
}
52
51
53
52
version ( options ) {
54
-
55
53
return this . _configProvider . getConfigId ( options . config )
56
54
. then ( ( configId ) => {
57
55
return new Promise ( ( resolve ) => {
@@ -72,31 +70,8 @@ class AppSecConfig {
72
70
throw err ;
73
71
} ) ;
74
72
}
75
-
76
- rules ( providedConfigId ) {
77
-
78
- let configId = this . _getConfigId ( providedConfigId ) ;
79
-
80
- return new Promise ( ( resolve , reject ) => {
81
- let customRulesUrl = URIs . GET_CRB . format ( configId ) ;
82
- logger . debug ( "Attempting to get all custom rules at: " + customRulesUrl ) ;
83
- let request = {
84
- method : "GET" ,
85
- path : customRulesUrl ,
86
- followRedirect : false
87
- } ;
88
- this . _edge . auth ( request ) . send ( function ( data , response ) {
89
- if ( response && response . statusCode >= 200 && response . statusCode < 400 ) {
90
- let parsed = JSON . parse ( response . body ) ;
91
- resolve ( parsed ) ;
92
- } else {
93
- reject ( data ) ;
94
- }
95
- } ) ;
96
- } ) ;
97
- }
98
73
}
99
74
100
75
module . exports = {
101
76
AppSecConfig : AppSecConfig
102
- } ;
77
+ } ;
Original file line number Diff line number Diff line change @@ -12,13 +12,14 @@ var logger = function (loggerName) {
12
12
name : loggerName
13
13
} ) ;
14
14
} ;
15
-
15
+ const CRB = '/appsec-resource/v1/configs/%s/custom-rules' ;
16
16
var resources = {
17
17
"GET_CONFIGS" : '/appsec-configuration/v1/configs' ,
18
18
"GET_VERSIONS" : '/appsec-configuration/v1/configs/%s/versions' ,
19
19
"GET_VERSION" : '/appsec-configuration/v1/configs/%s/versions/%s' ,
20
- "GET_CRB" : '/appsec-resource/v1/configs/%s/custom-rules'
20
+ "GET_CRB_ALL" : CRB ,
21
+ "GET_CRB" : CRB + '/%s'
21
22
} ;
22
23
23
24
define ( "URIS" , resources ) ;
24
- define ( "logger" , logger ) ;
25
+ define ( "logger" , logger ) ;
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class CRBHandler {
36
36
rules ( providedConfigId ) {
37
37
let configId = this . _configProvider . getConfigId ( providedConfigId ) ;
38
38
return new Promise ( ( resolve , reject ) => {
39
- let customRulesUrl = util . format ( URIs . GET_CRB , configId ) ;
39
+ let customRulesUrl = util . format ( URIs . GET_CRB_ALL , configId ) ;
40
40
logger . debug ( "Attempting to get all custom rules at: " + customRulesUrl ) ;
41
41
let request = {
42
42
method : "GET" ,
You can’t perform that action at this time.
0 commit comments