Merge branch 'master' into dev
This commit is contained in:
commit
d5a399f8fc
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,7 @@
|
||||
docs/Oscar_Credentials.md
|
||||
scripts/test_oscarhost.js
|
||||
scripts/oscarhost/private/
|
||||
|
||||
# iOS / Apple
|
||||
# ===========
|
||||
.DS_Store
|
||||
|
||||
50
README.md
50
README.md
@ -30,20 +30,6 @@ $ npm install -g bower
|
||||
$ npm install -g grunt-cli
|
||||
```
|
||||
|
||||
## Downloading MEAN.JS
|
||||
There are several ways you can get the MEAN.JS boilerplate:
|
||||
|
||||
### Yo Generator
|
||||
The recommended way would be to use the [Official Yo Generator](http://meanjs.org/generator.html), which generates the latest stable copy of the MEAN.JS boilerplate and supplies multiple sub-generators to ease your daily development cycles.
|
||||
|
||||
### Cloning The GitHub Repository
|
||||
You can also use Git to directly clone the MEAN.JS repository:
|
||||
```bash
|
||||
$ git clone https://github.com/whitef0x0/medforms.git medforms
|
||||
```
|
||||
This will clone the latest version of the Medforms repository to a **medforms** folder.
|
||||
|
||||
|
||||
## Quickstart
|
||||
|
||||
Install dependencies first.
|
||||
@ -81,32 +67,7 @@ And to run only the client tests, run the test:client task:
|
||||
$ grunt test:client
|
||||
```
|
||||
|
||||
## Development and deployment With Docker
|
||||
|
||||
* Install [Docker](http://www.docker.com/)
|
||||
* Install [Docker-Machine](https://docs.docker.com/machine/)
|
||||
|
||||
* Local development and setup with dockermachine:
|
||||
```bash
|
||||
$ curl -L https://github.com/docker/machine/releases/download/v0.3.0/docker-machine_darwin-amd64 > /usr/local/bin/docker-machine
|
||||
$ chmod +x /usr/local/bin/docker-machine
|
||||
$ docker-machine create -d virtualbox dev
|
||||
$ docker-machine env dev
|
||||
$ eval "$(docker-machine env dev)"
|
||||
```
|
||||
|
||||
* Local development and testing with just Docker:
|
||||
```bash
|
||||
$ docker build -t medforms .
|
||||
$ docker run -p 27017:27017 -d --name db mongo
|
||||
$ docker run -p 3000:3000 --link db:db_1 mean
|
||||
$
|
||||
```
|
||||
|
||||
* To enable live reload, forward port 35729 and mount /app and /public as volumes:
|
||||
```bash
|
||||
$ docker run -p 3000:3000 -p 35729:35729 -v /Users/mdl/workspace/mean-stack/mean/public:/home/mean/public -v /Users/mdl/workspace/mean-stack/mean/app:/home/mean/app --link db:db_1 mean
|
||||
```
|
||||
Currently the live example uses heroku github deployments. The Docker file is out of date and does not work. If someone wishes to get it working feel free to submit a pull request.
|
||||
|
||||
## Running in a secure environment
|
||||
To run your application in a secure manner you'll need to use OpenSSL and generate a set of self-signed certificates. Unix-based users can use the following command:
|
||||
@ -117,15 +78,6 @@ Windows users can follow instructions found [here](http://www.websense.com/suppo
|
||||
After you've generated the key and certificate, place them in the *config/sslcerts* folder.
|
||||
|
||||
|
||||
## Community
|
||||
* Use the [Official Website](http://meanjs.org) to learn about changes and the roadmap.
|
||||
* Join #meanjs on freenode.
|
||||
* Discuss it in the new [Google Group](https://groups.google.com/d/forum/meanjs)
|
||||
* Ping us on [Twitter](http://twitter.com/meanjsorg) and [Facebook](http://facebook.com/meanjs)
|
||||
|
||||
## Live Example
|
||||
Browse the live MEAN.JS example on [http://meanjs.herokuapp.com](http://meanjs.herokuapp.com).
|
||||
|
||||
## Credits
|
||||
Inspired/built off great work of the meanjs team [MeanJS](https://github.com/mean/)
|
||||
|
||||
|
||||
@ -149,25 +149,8 @@ FormSchema.pre('remove', function (next) {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var _original;
|
||||
// FormSchema.post( 'init', function() {
|
||||
// _original = this.toObject();
|
||||
// console.log(this);
|
||||
// } );
|
||||
// FormSchema.virtual('_original').get(function () {
|
||||
// this.constructor // ≈ mongoose.model('…', FieldSchema).findById
|
||||
// .findOne({_id: this._id}).exec(function(err, original){
|
||||
// if(err) {
|
||||
// console.log(err);
|
||||
// throw err;
|
||||
// } else {
|
||||
// console.log(original);
|
||||
// if(original) return original.toObject();
|
||||
// else return null;
|
||||
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
|
||||
//Set _original
|
||||
FormSchema.pre('save', function (next) {
|
||||
|
||||
2202
docs/sample_demographics.json
Executable file
2202
docs/sample_demographics.json
Executable file
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,7 @@
|
||||
"postinstall": "bower install --config.interactive=false; grunt build"
|
||||
},
|
||||
"dependencies": {
|
||||
"async": "^1.4.0",
|
||||
"async": "^1.4.2",
|
||||
"body-parser": "~1.9.0",
|
||||
"bower": "~1.3.8",
|
||||
"chalk": "~1.0.0",
|
||||
@ -77,6 +77,8 @@
|
||||
"passport-local": "~1.0.0",
|
||||
"passport-twitter": "~1.0.2",
|
||||
"raven": "^0.8.1",
|
||||
"request": "^2.60.0",
|
||||
"request-promise": "^0.4.3",
|
||||
"satelize": "~0.1.1",
|
||||
"shortid": "^2.2.2",
|
||||
"should": "~4.1.0",
|
||||
|
||||
23
scripts/oscarhost/OscarSecurity.js
Normal file
23
scripts/oscarhost/OscarSecurity.js
Normal file
@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
var crypto = require('crypto'),
|
||||
passwordDigest = require('soap/lib/utils').passwordDigest;
|
||||
|
||||
function WSSecurity(username, password) {
|
||||
this._username = username;
|
||||
this._password = password;
|
||||
}
|
||||
|
||||
WSSecurity.prototype.toXML = function() {
|
||||
var password = "<wsse:Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText\">" + this._password + "</wsse:Password>";
|
||||
|
||||
return "<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" soap:mustUnderstand=\"1\">" +
|
||||
"<wsse:UsernameToken xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"UsernameToken-1\">" +
|
||||
"<wsse:Username>" + this._username + "</wsse:Username>" +
|
||||
password +
|
||||
"</wsse:UsernameToken>" +
|
||||
"</wsse:Security>";
|
||||
|
||||
};
|
||||
|
||||
module.exports = WSSecurity;
|
||||
52
scripts/oscarhost/test_oscarhost.js
Normal file
52
scripts/oscarhost/test_oscarhost.js
Normal file
@ -0,0 +1,52 @@
|
||||
var soap = require('soap'),
|
||||
request = require('request'),
|
||||
async = require('async'),
|
||||
OscarSecurity = require('./OscarSecurity');
|
||||
|
||||
|
||||
var url_login = 'http://someurl.com/ws?wsdl',
|
||||
url_demo = 'http://someurl.com/ws?wsdl',
|
||||
args_demo = {arg0: 12351235},
|
||||
args_login = {arg0: 'mylogin', arg1: 'mypassword'};
|
||||
|
||||
var options = {
|
||||
ignoredNamespaces: {
|
||||
namespaces: ['targetNamespace', 'typedNamespace'],
|
||||
override: true
|
||||
}
|
||||
}
|
||||
|
||||
async.waterfall([
|
||||
function (callback) {
|
||||
soap.createClient(url_login, options, function(err, client) {
|
||||
client.login(args_login, function (err, result) {
|
||||
if(err) callback(err);
|
||||
callback(null, result.return);
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
function (security_obj, callback) {
|
||||
|
||||
console.log(security_obj);
|
||||
|
||||
soap.createClient(url_demo, options, function(err, client) {
|
||||
client.setSecurity(new OscarSecurity(security_obj.securityId, security_obj.securityTokenKey) );
|
||||
|
||||
client.getDemographic(args_demo, function (err, result) {
|
||||
if(err) callback(err);
|
||||
console.log(result);
|
||||
callback(null, 'DemographicService');
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
], function(err, result) {
|
||||
if(err) throw err;
|
||||
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user