@@ -44,15 +44,23 @@ Cert.prototype.installCert = function(options, cb) {
4444
4545Cert . prototype . checkCert = function ( options , cb ) {
4646
47-
48-
4947 assert ( options . org , "org is required" ) ;
5048 assert ( options . env , "env is required" )
5149
5250 assert ( options . username , "username is required" ) ;
5351 assert ( options . password , "password is required" )
5452
5553 const config = edgeconfig . load ( { source : configLocations . getSourcePath ( options . org , options . env ) } ) ;
54+ if ( options . url ) {
55+ if ( options . url . indexOf ( '://' ) === - 1 ) {
56+ options . url = 'https://' + options . url ;
57+ }
58+ config . edge_config . authUri = options . url + '/edgemicro-auth' ;
59+ } else {
60+ var newAuthURI = util . format ( config . edge_config . authUri , options . org , options . env ) ;
61+ config . edge_config . authUri = newAuthURI ;
62+ }
63+
5664 cert ( config ) . checkCertWithPassword ( options , ( err , res ) => {
5765 if ( err ) {
5866 if ( cb ) {
@@ -94,6 +102,15 @@ Cert.prototype.retrievePublicKey = function(options,cb) {
94102 assert ( options . env , "env is required" )
95103
96104 const config = edgeconfig . load ( { source : configLocations . getSourcePath ( options . org , options . env ) } ) ;
105+ if ( options . url ) {
106+ if ( options . url . indexOf ( '://' ) === - 1 ) {
107+ options . url = 'https://' + options . url ;
108+ }
109+ config . edge_config . authUri = options . url + '/edgemicro-auth' ;
110+ } else {
111+ var newAuthURI = util . format ( config . edge_config . authUri , options . org , options . env ) ;
112+ config . edge_config . authUri = newAuthURI ;
113+ }
97114 cert ( config ) . retrievePublicKey ( options , ( err , certificate ) => {
98115 if ( err ) {
99116 cb && cb ( err ) ;
@@ -133,4 +150,4 @@ function printError(err) {
133150 } else {
134151 console . log ( err ) ;
135152 }
136- }
153+ }
0 commit comments