From 31f36b5617bd795456d8d672325ec5541c21ab61 Mon Sep 17 00:00:00 2001 From: John Haley Date: Thu, 23 Oct 2014 12:44:58 -0700 Subject: [PATCH 1/4] Added more git_cred methods --- generate/descriptor.json | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/generate/descriptor.json b/generate/descriptor.json index 4207c7d1d..2483a94f5 100644 --- a/generate/descriptor.json +++ b/generate/descriptor.json @@ -284,11 +284,33 @@ "isStruct": true, "cType": "git_cred", "functions": { + "git_cred_default_new": { + "ignore": false, + "isPrototypeMethod": false, + "args": [{ "isSelf": false }], + "isAsync": false + }, + "git_cred_has_username": { + "ignore": false, + "args": [{ "isSelf": true}] + }, "git_cred_ssh_key_from_agent": { "ignore": false, "isPrototypeMethod": false, "args": [{ "isSelf": false }], "isAsync": false + }, + "git_cred_ssh_key_new": { + "ignore": false, + "isPrototypeMethod": false, + "args": [{ "isSelf": false }], + "isAsync": false + }, + "git_cred_userpass_plaintext_new": { + "ignore": false, + "isPrototypeMethod": false, + "args": [{ "isSelf": false }], + "isAsync": false } } }, From 435924b16a354fb7c19816b09a6802a074daf843 Mon Sep 17 00:00:00 2001 From: John Haley Date: Thu, 23 Oct 2014 15:17:25 -0700 Subject: [PATCH 2/4] Added a few unit tests for credentials These just confirm that the credentials are actually created not that we can do anything with them right now. --- test/tests/cred.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/tests/cred.js diff --git a/test/tests/cred.js b/test/tests/cred.js new file mode 100644 index 000000000..c2fbae3c4 --- /dev/null +++ b/test/tests/cred.js @@ -0,0 +1,28 @@ +var assert = require("assert"); + +describe("Cred", function() { + var NodeGit = require("../../"); + + it("can create default credentials", function() { + var defaultCreds = NodeGit.Cred.defaultNew(); + + assert(defaultCreds instanceof NodeGit.Cred); + }); + + it("can create ssh credentials using passed keys", function() { + var sshCreds + = NodeGit.Cred.sshKeyNew( + "username", + "public key", + "private key", + "passphrase"); + + assert(sshCreds instanceof NodeGit.Cred); + }); + + it("can create credentials using plaintext", function() { + var plaintextCreds = NodeGit.Cred.userpassPlaintextNew("username", "password"); + + assert(plaintextCreds instanceof NodeGit.Cred); + }); +}); From 2fe56eb5aa28e421109f1e91e3a270fd2a9cd7b9 Mon Sep 17 00:00:00 2001 From: John Haley Date: Thu, 23 Oct 2014 15:40:51 -0700 Subject: [PATCH 3/4] Fixed lint error --- test/tests/cred.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/tests/cred.js b/test/tests/cred.js index c2fbae3c4..46221d7a8 100644 --- a/test/tests/cred.js +++ b/test/tests/cred.js @@ -21,7 +21,8 @@ describe("Cred", function() { }); it("can create credentials using plaintext", function() { - var plaintextCreds = NodeGit.Cred.userpassPlaintextNew("username", "password"); + var plaintextCreds + = NodeGit.Cred.userpassPlaintextNew("username", "password"); assert(plaintextCreds instanceof NodeGit.Cred); }); From 09d310ecaec7fe3c86dcaf3be5da9a73a86667c6 Mon Sep 17 00:00:00 2001 From: John Haley Date: Thu, 23 Oct 2014 15:55:24 -0700 Subject: [PATCH 4/4] Added some notifications to slack channel for Travis --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 47077fe04..e7aba778f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,3 +23,6 @@ branches: only: - master script: npm --expose-gc test +notifications: + slack: + secure: KglNSqZiid9YudCwkPFDh+sZfW5BwFlM70y67E4peHwwlbbV1sSBPHcs74ZHP/lqgEZ4hMv4N2NI58oYFD5/1a+tKIQP1TkdIMuq4j2LXheuirA2HDcydOVrsC8kRx5XFGKdVRg/uyX2dlRHcOWFhxrS6yc6IxtxYWlRTD2SmEc=