@@ -22,9 +22,13 @@ ServiceUtils.prototype = {
2222 // name may fail because of duplicate usage. This function verifies
2323 // that the url associated with the service, contains the matched
2424 // 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+
2730 var services = appEnv . getServices ( ) ;
31+
2832 for ( var service in services ) {
2933 if ( services [ service ] . hasOwnProperty ( 'credentials' ) ) {
3034 if ( services [ service ] . credentials . hasOwnProperty ( 'url' ) ) {
@@ -39,13 +43,17 @@ ServiceUtils.prototype = {
3943
4044 // Check for service return a boolean to indicate if it is bound in
4145 checkServiceBound : function ( serviceName ) {
42- return ServiceUtils . prototype . checkCFForService ( serviceName , true ) ;
46+ return ServiceUtils . prototype . checkCFForService ( serviceName , true , false ) ;
4347 } ,
4448
4549 // Check for and return bound servie
4650 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+ } ,
4957
5058} ;
5159
0 commit comments