Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
added TODO comments for password prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
mkloubert committed Jun 2, 2017
1 parent 40d139b commit 976a1cc
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/plugins/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class ApiPlugin extends deploy_objects.DeployPluginBase {

let user = deploy_helpers.normalizeString(target.user);
if (user) {
//TODO: password prompt

let pwd = deploy_helpers.toStringSafe(target.password);

headers['Authorization'] = `Basic ${(new Buffer(user + ':' + pwd).toString('base64'))}`;
Expand Down Expand Up @@ -277,6 +279,8 @@ class ApiPlugin extends deploy_objects.DeployPluginBase {

let user = deploy_helpers.normalizeString(target.user);
if (user) {
//TODO: password prompt

let pwd = deploy_helpers.toStringSafe(target.password);

headers['Authorization'] = `Basic ${(new Buffer(user + ':' + pwd).toString('base64'))}`;
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/dropbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ class DropboxPlugin extends deploy_objects.DeployPluginWithContextBase<DropboxCo
};

try {
//TODO: password prompt (access token)

let ctx: DropboxContext = {
dir: dir,
hasCancelled: false,
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/ftp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ class FtpClient extends FtpClientBase {
let port = parseInt(deploy_helpers.toStringSafe(target.port, isSecure ? '990' : '21').trim());

let user = deploy_helpers.toStringSafe(target.user, 'anonymous');
//TODO: password prompt
let pwd = deploy_helpers.toStringSafe(target.password);

let rejectUnauthorized = target.rejectUnauthorized;
Expand Down Expand Up @@ -529,6 +530,7 @@ class JsFTPClient extends FtpClientBase {
let port = parseInt(deploy_helpers.toStringSafe(target.port, isSecure ? '990' : '21').trim());

let user = deploy_helpers.toStringSafe(target.user, 'anonymous');
//TODO: password prompt
let pwd = deploy_helpers.toStringSafe(target.password);

return new Promise<boolean>((resolve, reject) => {
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,11 @@ class HttpPlugin extends deploy_objects.DeployPluginBase {

let user = deploy_helpers.toStringSafe(target.user);
if (user) {
//TODO: password prompt
let pwd = deploy_helpers.toStringSafe(target.password);

headers['Authorization'] = 'Basic ' +
(new Buffer(`${user}:${pwd}`)).toString('base64');
(new Buffer(`${user}:${pwd}`)).toString('base64');
}

let submitFileHeader = deploy_helpers.toBooleanSafe(target.submitFileHeader, false);
Expand Down
1 change: 1 addition & 0 deletions src/plugins/mail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class MailPlugin extends deploy_objects.ZipFileDeployPluginBase {
let auth: any;
let user = deploy_helpers.toStringSafe(target.user);
if (user) {
//TODO: password prompt
let password = deploy_helpers.toStringSafe(target.password);

auth = {
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/sftp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ class SFtpPlugin extends deploy_objects.DeployPluginWithContextBase<SFTPContext>
if ('' === user) {
user = undefined;
}
else {
//TODO: password prompt
}
let pwd = deploy_helpers.toStringSafe(target.password);
if ('' === pwd) {
pwd = undefined;
Expand Down
7 changes: 5 additions & 2 deletions src/sql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,15 @@ export function createMSSqlConnection(opts?: MSSqlOptions): Promise<MSSqlConnect
}

let user = deploy_helpers.toStringSafe(opts.user).trim();
if (!user) {
if ('' === user) {
user = 'sa';
}
else {
//TODO: password prompt
}

let pwd = deploy_helpers.toStringSafe(opts.password);
if (!pwd) {
if ('' === pwd) {
pwd = undefined;
}

Expand Down

0 comments on commit 976a1cc

Please sign in to comment.