mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
Switched to using token authentication for GitHub
no issue
This commit is contained in:
parent
eb7e7a8f31
commit
ff4d8ef903
@ -11,7 +11,6 @@ module.exports.create = (options = {}) => {
|
|||||||
'gistName',
|
'gistName',
|
||||||
'gistDescription',
|
'gistDescription',
|
||||||
'github',
|
'github',
|
||||||
'github.username',
|
|
||||||
'github.token',
|
'github.token',
|
||||||
'userAgent'
|
'userAgent'
|
||||||
);
|
);
|
||||||
@ -27,7 +26,7 @@ module.exports.create = (options = {}) => {
|
|||||||
content: content.toString('utf8')
|
content: content.toString('utf8')
|
||||||
};
|
};
|
||||||
|
|
||||||
const auth = 'Basic ' + new Buffer(options.github.username + ':' + options.github.token).toString('base64');
|
const auth = 'token ' + options.github.token;
|
||||||
|
|
||||||
const reqOptions = {
|
const reqOptions = {
|
||||||
uri: 'https://api.github.com/gists',
|
uri: 'https://api.github.com/gists',
|
||||||
|
@ -40,7 +40,6 @@ module.exports.create = (options = {}) => {
|
|||||||
localUtils.checkMissingOptions(options,
|
localUtils.checkMissingOptions(options,
|
||||||
'changelogPath',
|
'changelogPath',
|
||||||
'github',
|
'github',
|
||||||
'github.username',
|
|
||||||
'github.token',
|
'github.token',
|
||||||
'userAgent',
|
'userAgent',
|
||||||
'uri',
|
'uri',
|
||||||
@ -77,7 +76,7 @@ module.exports.create = (options = {}) => {
|
|||||||
body.push('You can see the [full change log](' + options.gistUrl + ') for the details of every change included in this release.');
|
body.push('You can see the [full change log](' + options.gistUrl + ') for the details of every change included in this release.');
|
||||||
}
|
}
|
||||||
|
|
||||||
const auth = 'Basic ' + new Buffer(options.github.username + ':' + options.github.token).toString('base64');
|
const auth = 'token ' + options.github.token;
|
||||||
|
|
||||||
const reqOptions = {
|
const reqOptions = {
|
||||||
uri: options.uri,
|
uri: options.uri,
|
||||||
@ -112,13 +111,12 @@ module.exports.uploadZip = (options = {}) => {
|
|||||||
localUtils.checkMissingOptions(options,
|
localUtils.checkMissingOptions(options,
|
||||||
'zipPath',
|
'zipPath',
|
||||||
'github',
|
'github',
|
||||||
'github.username',
|
|
||||||
'github.token',
|
'github.token',
|
||||||
'userAgent',
|
'userAgent',
|
||||||
'uri'
|
'uri'
|
||||||
);
|
);
|
||||||
|
|
||||||
const auth = 'Basic ' + new Buffer(options.github.username + ':' + options.github.token).toString('base64');
|
const auth = 'token ' + options.github.token;
|
||||||
const stats = fs.statSync(options.zipPath);
|
const stats = fs.statSync(options.zipPath);
|
||||||
|
|
||||||
const reqOptions = {
|
const reqOptions = {
|
||||||
|
@ -10,7 +10,7 @@ describe('Releases', function () {
|
|||||||
try {
|
try {
|
||||||
lib.releases.uploadZip();
|
lib.releases.uploadZip();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
err.message.should.eql('Missing options: zipPath, github, github.username, github.token, userAgent, uri');
|
err.message.should.eql('Missing options: zipPath, github, github.token, userAgent, uri');
|
||||||
return done();
|
return done();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ describe('Releases', function () {
|
|||||||
|
|
||||||
it('missing options', function (done) {
|
it('missing options', function (done) {
|
||||||
try {
|
try {
|
||||||
lib.releases.uploadZip({zipPath: 'test', github: {username: 'test'}});
|
lib.releases.uploadZip({zipPath: 'test', github: {}});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
err.message.should.eql('Missing options: github.token, userAgent, uri');
|
err.message.should.eql('Missing options: github.token, userAgent, uri');
|
||||||
return done();
|
return done();
|
||||||
|
Loading…
Reference in New Issue
Block a user