GithubHelp home page GithubHelp logo

strongloop-archive / strong-gateway-demo Goto Github PK

View Code? Open in Web Editor NEW
35.0 35.0 35.0 621 KB

DEPRECATED | Our new gateway product is available at https://github.com/strongloop/microgateway.

License: Other

JavaScript 66.33% HTML 14.10% Shell 19.49% Batchfile 0.08%

strong-gateway-demo's People

Contributors

cgole avatar rmg avatar simonhoibm avatar superkhau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

strong-gateway-demo's Issues

User object in the gateway architecture

Hi

I have carefully study this schema :
Image of gateway

There is a point I don't understand : which server take care of the user ?
As I have understand it's the authorization server (here localhost:3005). But on my resource server (here 3002) I need to know who is my user: for exemple give the note that belong to me, or give me the note that belong to my role.
Should I share a model between the different server? Especially in our case, we will inherit from the User Model

It's not very clear in my mind how the user exist in the different entity of the architecture...

ECONNREFUSED error

Either running ./start-demo or manually following the steps yields following error when accessing http://localhost:2001/:

ECONNREFUSED

Error: connect ECONNREFUSED

http://localhost:2001/explorer/ works but only showing User model, not the Note model I am expecting.

`setup-db.js` error when using MySQL datasource for `auth-server`

Auto-updating database: {"name":"db","connector":"mysql","host":"localhost","port":3306,"database":"strong-gateway-demo","username":"root","password":"","createDatabase":true,"debug":false,"collation":"utf8_general_ci","charset":"utf8","supportBigNumbers":false,"timezone":"local","connectionLimit":10}
## StrongLoop API Gateway is licensed from 2015-06-22T07:00:00.000Z to 2016-06-22T07:00:00.000Z.
## StrongLoop API Gateway is licensed from 2015-06-22T07:00:00.000Z to 2016-06-22T07:00:00.000Z.
Error in setting database: {"code":"ER_TOO_LONG_KEY","errno":1071,"sqlState":"42000","index":0}

@raymondfeng I remember you making changes to gateway to fix this error before. Did you push those changes? I'm using MySQL 5.6.25 FYI.

License error

In Part 2 Step 2, running node auth-server gives me following error despite I can see my non-expired api gateway license when running slc arc --licenses and login:

## StrongLoop API Gateway licensing missing or invalid. Please verify your licen
ses in the Licenses page by running StrongLoop Arc by typing "slc arc --licenses
" . If you have questions about your license or StrongLoop licensing please cont
act [email protected].
##  Terminating process.

What is missing?

License Error

This is Part =-2/2 of the Demo Notes app, I'm getting this error
root@strongloop:~/notes-app-gateway# node auth-server
(node) crypto.createCredentials is deprecated. Use tls.createSecureContext instead.
Client application registered: id=123 name=demo-app key=secret
Client application registered: id=456 name=demo-app-2 key=secret
Client application registered: id=789 name=demo-app-3 key=secret
Client application registered: id=500 name=demo-app-4 key=secret
Client application registered: id=600 name=demo-app-5 key=secret
User registered: id=1 username=bob password=secret

Web server listening at http://0.0.0.0:3001
Web server listening at https://0.0.0.0:3101
Browse your REST API at https://localhost:3101/explorer

StrongLoop API Gateway licensing missing or invalid. Please verify your licenses in the Licenses page by running StrongLoop Arc by typing "slc arc --licenses" . If you have questions about your license or StrongLoop licensing please contact [email protected].

Terminating process.

StrongLoop API Gateway licensing missing or invalid. Please verify your licenses in the Licenses page by running StrongLoop Arc by typing "slc arc --licenses" . If you have questions about your license or StrongLoop licensing please contact [email protected].

Terminating process.

`oauthclientapplication` table not automigrated by `setup-db.js`

Step 7 has issues setting up database tables. The regular setup-db.js script automigrates most tables properly except oauthclientapplication form the loopback-component-oauth2:

15-09-04T23:55:48.688Z pid:14653 worker:3 .../strong-gateway-demo/notes-app-gateway/auth-server/node_modules/loopback-connector-mysql/node_modules/mysql/lib/protocol/Parser.js:82
2015-09-04T23:55:48.688Z pid:14653 worker:3         throw err;
2015-09-04T23:55:48.689Z pid:14653 worker:3               ^
2015-09-04T23:55:48.689Z pid:14653 worker:3 Error: ER_NO_SUCH_TABLE: Table 'strong-gateway-demo.oauthclientapplication' doesn't exist

Need updates

The README instructions and the example apps need to be updated.

how setup redis session in middleware

Hi~ all , this is my code in server.js ,NODE_ENV=dev run it's ok,but NODE_ENV=pro Warning: connect.session() MemoryStore is not designed

app.middleware('session:before', app.loopback.cookieParser("abc"));
var store =new redisstore({
  host: "127.0.0.1",
  port: "6379",
  pass: "secret",
  ttl:  "3600"
});
if (require.main === module) {
  store.client.unref();
}
app.middleware('session', loopback.session({
  saveUninitialized: true,
  resave: true,
  key: "secret",
  store:store ,
  "secret": "secret"
}));

Socket hangup while posting request to gateway web server

Hi~

I get error when run the post data to gateway, the problem is that proxy work excellent in case of get requests but in case of post requests it results in socket hang up exception ,no post body is ok!

{ [Error: socket hang up] code: 'ECONNRESET' }
Error: request aborted
    at IncomingMessage.onAborted (/Users/flat_peach/Downloads/strong-gateway-demo-master/oauth-playground/node_modules/raw-body/index.js:269:10)
    at emitNone (events.js:67:13)
    at IncomingMessage.emit (events.js:166:7)
    at abortIncoming (_http_server.js:280:11)
    at Socket.serverSocketCloseListener (_http_server.js:293:5)
    at emitOne (events.js:82:20)
    at Socket.emit (events.js:169:7)
    at TCP._onclose (net.js:469:12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.