renamed config options ouath_client_id and oauth_client_secre to github_id and github_secret. Added dropbox_id option.

This commit is contained in:
coderaiser 2012-12-03 08:44:39 -05:00
parent 1afd2970b6
commit 28749bff53
5 changed files with 19 additions and 16 deletions

View file

@ -81,8 +81,9 @@ All main configuration could be done thrue config.json.
"html" : true,
"img" : false
},
"oauth_client_id" : "891c251b925e4e967fa9", /* github app id */
"oauth_client_secret" : "afe9bed1e810c5dc44c4c2a953fc6efb1e5b0545", /* github app secret */
"github_id" : "891c251b925e4e967fa9", /* github app id */
"github_secret" : "afe9bed1e810c5dc44c4c2a953fc6efb1e5b0545", /* github app secret */
"dropbox_id" : "o7d6llji052vijk",
"show_keys_panel" : true, /* show classic panel with buttons of keys */
"server" : true, /* server mode or testing mode */
"logs" : false, /* logs or console ouput */
@ -97,7 +98,7 @@ Authorization
Thru openID Cloud Commander could authorize clients on GitHub.
All things that should be done is must be added **id** and **secret** of application
from github settings page and added to **config.json** or env varibles with names:
*oauth_client_id* and *oauth_client_secret* that is more secure way.
*github_id* and *github_secret* that is more secure way.
Starting

View file

@ -7,8 +7,9 @@
"html" : false,
"img" : true
},
"oauth_client_id" : "891c251b925e4e967fa9",
"oauth_client_secret" : "afe9bed1e810c5dc44c4c2a953fc6efb1e5b0545",
"github_id" : "891c251b925e4e967fa9",
"github_secret" : "afe9bed1e810c5dc44c4c2a953fc6efb1e5b0545",
"dropbox_id" : "o7d6llji052vijk",
"show_keys_panel" : true,
"server" : true,
"logs" : false,

View file

@ -8,8 +8,8 @@ var CloudCommander, Util, DOM, $, Github, cb;
APIURL = '/api/v1',
AuthURL = APIURL + '/auth',
ClientIdURL = APIURL + '/client_id',
CLIENT_ID,
GitHubIdURL = APIURL + '/github_id',
GitHub_ID,
Cache = DOM.Cache,
GithubLocal,
User,
@ -46,9 +46,9 @@ var CloudCommander, Util, DOM, $, Github, cb;
function setConfig(pCallBack){
DOM.ajax({
url : ClientIdURL,
url : GitHubIdURL,
success : function(pData){
CLIENT_ID = pData;
GitHub_ID = pData;
Util.exec(pCallBack);
}
});
@ -113,7 +113,7 @@ var CloudCommander, Util, DOM, $, Github, cb;
//window.open('welcome.html', 'welcome','width=300,height=200,menubar=yes,status=yes')">
window.location =
'https://github.com/login/oauth/authorize?client_id=' +
CLIENT_ID + '&&scope=repo,user,gist';
GitHub_ID + '&&scope=repo,user,gist';
}
}

View file

@ -36,18 +36,19 @@
};
function authenticate(pCode, pCallBack) {
var lId = Config.oauth_client_id,
lSecret = Config.oauth_client_secret,
var lId = Config.github_id,
lSecret = Config.github_secret,
lEnv = process.env,
lClientId = lEnv.oauth_client_id || lId,
lClientSecret = lEnv.oauth_client_secret || lSecret;
lClientId = lEnv.github_id || lId,
lClientSecret = lEnv.github_secret || lSecret;
var data = qs.stringify({
client_id : lClientId,
client_secret : lClientSecret,
code : pCode
});
console.log(data);
GithubAuth.headers = { 'content-length': data.length };

View file

@ -101,11 +101,11 @@
lResult = {info: 'Cloud Commander API v1'};
break;
case 'client_id':
case 'github_id':
var lEnv = process.env,
lConfig = main.config;
lResult = lEnv.oauth_client_id || lConfig.oauth_client_id;
lResult = lEnv.github_id || lConfig.github_id;
break;
case 'kill':