@@ -22,9 +22,13 @@ ServiceUtils.prototype = {
22
22
// name may fail because of duplicate usage. This function verifies
23
23
// that the url associated with the service, contains the matched
24
24
// input value, hence reducing the chances of a false match.
25
- checkCFForService : function ( serviceName , returnBoolean ) {
26
- var regex = new RegExp ( '(http|https)(://)([^\/]+)(/)(' + serviceName + ').*' ) ;
25
+ checkCFForService : function ( serviceName , returnBoolean , alchemyRegex ) {
26
+ var regex = alchemyRegex ?
27
+ RegExp ( '(http|https)(://)(' + serviceName + ').*' ) :
28
+ RegExp ( '(http|https)(://)([^\/]+)(/)(' + serviceName + ').*' ) ;
29
+
27
30
var services = appEnv . getServices ( ) ;
31
+
28
32
for ( var service in services ) {
29
33
if ( services [ service ] . hasOwnProperty ( 'credentials' ) ) {
30
34
if ( services [ service ] . credentials . hasOwnProperty ( 'url' ) ) {
@@ -39,13 +43,17 @@ ServiceUtils.prototype = {
39
43
40
44
// Check for service return a boolean to indicate if it is bound in
41
45
checkServiceBound : function ( serviceName ) {
42
- return ServiceUtils . prototype . checkCFForService ( serviceName , true ) ;
46
+ return ServiceUtils . prototype . checkCFForService ( serviceName , true , false ) ;
43
47
} ,
44
48
45
49
// Check for and return bound servie
46
50
getServiceCreds : function ( serviceName ) {
47
- return ServiceUtils . prototype . checkCFForService ( serviceName , false ) ;
48
- }
51
+ return ServiceUtils . prototype . checkCFForService ( serviceName , false , false ) ;
52
+ } ,
53
+
54
+ getServiceCredsAlchemy : function ( serviceName ) {
55
+ return ServiceUtils . prototype . checkCFForService ( serviceName , false , true ) ;
56
+ } ,
49
57
50
58
} ;
51
59
0 commit comments