Skip to content

Commit 8278270

Browse files
committed
Update gitignore to ignore helper shell file, and update cert library to account for custom urls.
1 parent bdcb803 commit 8278270

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ tests/cache-config.yaml
4141
tmp-*
4242
default.yaml.bak
4343
*-*-*config.yaml
44-
test-token.txt
44+
test-token.txt
45+
env.sh

cli/lib/cert.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,23 @@ Cert.prototype.installCert = function(options, cb) {
4444

4545
Cert.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

Comments
 (0)