FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Define GIT_SSH_MEMORY_CREDENTIALS for libgit2 by alantrrs · Pull Request #949 · nodegit/nodegit · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .gyp  (1) .js  (1) .json  (1) All 3 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nodegit",
"description": "Node.js libgit2 asynchronous native bindings",
"version": "0.15.1",
"version": "0.16.0",
"homepage": "http://nodegit.org",
"keywords": [
"libgit2",
Expand Down
18 changes: 18 additions & 0 deletions test/tests/cred.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var assert = require("assert");
var path = require("path");
var fs = require("fs");
var local = path.join.bind(path, __dirname);

describe("Cred", function() {
Expand All @@ -23,6 +24,23 @@ describe("Cred", function() {
assert.ok(cred instanceof NodeGit.Cred);
});

it("can create ssh credentials using passed keys in memory", function() {
var publicKeyContents = fs.readFileSync(sshPublicKey, {
encoding: "ascii"
});
var privateKeyContents = fs.readFileSync(sshPrivateKey, {
encoding: "ascii"
});

return NodeGit.Cred.sshKeyMemoryNew(
"username",
publicKeyContents,
privateKeyContents,
"").then(function(cred) {
assert.ok(cred instanceof NodeGit.Cred);
});
});

it("can create credentials using plaintext", function() {
var plaintextCreds = NodeGit.Cred.userpassPlaintextNew
("username", "password");
Expand Down
1 change: 1 addition & 0 deletions vendor/libgit2.gyp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"defines": [
"GIT_THREADS",
"GIT_SSH",
"GIT_SSH_MEMORY_CREDENTIALS",
# Node's util.h may be accidentally included so use this to guard
# against compilation error.
"SRC_UTIL_H_",
Expand Down

Back | FazBrowse Home | New Git URL