Added sample config

This commit is contained in:
斟酌 鵬兄 2016-02-12 05:47:57 +08:00
parent e1f2926f64
commit 871591f049
4 changed files with 34 additions and 1 deletions

View File

@ -185,7 +185,7 @@ class WNSAuth extends EventEmitter
__authWNS()
{
var serviceAuth = cl.load( "notifyterm.config.auth" );
var serviceAuth = cl.load( "notifyterm.config.auth", true );
var Request = new HttpRequest( serviceAuth.Uri );

View File

@ -9,6 +9,7 @@ var Base = cl.load( "notifysrv.postframe" );
var WNSAuth = cl.load( "notifyterm.WNSAuth" );
var Model = cl.load( "notifyterm.schema" );
var NotisQ = cl.load( "notifyterm.Notis" );
var SrvAuth = cl.load( "notifyterm.config.auth" );
class App extends Base
{
@ -32,6 +33,20 @@ class App extends Base
var _self = this;
var query = e.Data;
// Protected Actions
switch( query.action )
{
case "register":
case "remove":
if(!( query.pass && query.pass == SrvAuth.Client ))
{
this.result = "Unauthorized Access";
this.plantResult();
return;
}
break;
}
switch( query.action )
{
case "register":

View File

@ -0,0 +1,11 @@
module.exports = {
// Defined in Docs
Uri: "https://login.live.com/accesstoken.srf"
// Given by Dev center
, Id: "ms-app://s-1-11-1-1111111111-1111111111-1111111111-1111111111-11111111-1111111111-1111111111"
, Secret: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
// basic protection pass
, Client: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
}

View File

@ -0,0 +1,7 @@
module.exports = {
host: "mongodb://123.456.789.0/database_name"
, auth:{
user: "UserName"
, pass: "Password"
}
};