Git Product home page Git Product logo

apiaxle's Introduction

ApiAxle

Gitter

http://apiaxle.com

A free, locally hosted API management solution. A proxy for your api, statistics for your api & a powerful api of its own.

There are three components which make up the Api Axle system:

The proxy

$ npm install apiaxle-proxy

This is the aspect of the system which does the actual proxying. It sits in front of your API and does the authentication, key checking, queries per day/second checking. This is the bit you want if you want anything. More detail on the main site.

The API

$ npm install apiaxle-api

This is the (optional) API for managing users, keys and endpoints. Once installed, run it with:

$ apiaxle-api

The REPL

$ npm install apiaxle-repl

A way to administer your ApiAxle installation via a command line. Once installed, run it with:

$ apiaxle

You then get a prompt where you can type help to find out more.

The base libs

This is a set of libraries which is required for the above components.


Installation

Check the main site for more detailed installation instructions.

Build

  • master: Build Status
  • develop: Build Status

Docker

Docker image

This repository is auto-built and published as apiaxle/apiaxle.

NOTE: If using this via Docker Compose, use the version 2 syntax for your docker-compose.yml file.

Dockerfiles

This project uses two Dockerfiles, one for production usage named Dockerfile, and a second for development of ApiAxle itself, named Dockerfile-development. Docker Compose is configured to build the development version for you, see below for examples.

Environment Variables

Environment variables can be used to configure NODE_ENV, REDIS_HOST, REDIS_PORT, API_NAME_REGEX and DEBUG_MODE. Below are defaults for production:

  • NODE_ENV = production
  • REDIS_HOST = redis
  • REDIS_PORT = 6379
  • API_NAME_REGEX = ^(.+?)\\.api\\. (extra backslash required for JSON)
  • DEBUG_MODE = false

Start services

docker-compose up -d redis
docker-compose up -d api
docker-compose up -d proxy

Run repl

docker-compose run repl

Run tests

docker-compose run repl test

Enter container

docker-compose run --entrypoint sh repl

Example adding an api and key:

api acme create endPoint='localhost:8000'
key 1234 create
api acme linkkey 1234

Example curl:

curl localhost:3000?api_key=1234 -H 'Host: acme.api.localhost'

apiaxle's People

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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apiaxle's Issues

Strip apiaxle_* query params

When the request is passed straight through to the endpoint the apiaxle_* params should be stripped. There are alternatives if people want the params passed through.

apiaxle-proxy does not install with nodejs 1.4 or 1.5 on CentOS 7.

I get several errors trying to install apiaxle under CentOS 7

npm install -g apiaxle-proxy
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
...snip...
In file included from ../src/libxmljs.cc:3:0:
/usr/lib/node_modules/apiaxle-proxy/node_modules/libxmljs/.node-gyp/4.4.3/include/node/v8.h:7603:16: note: static v8::Local<v8::Boolean> v8::Boolean::New(v8::Isolate*, bool)
 Local<Boolean> Boolean::New(Isolate* isolate, bool value) {
                ^
/usr/lib/node_modules/apiaxle-proxy/node_modules/libxmljs/.node-gyp/4.4.3/include/node/v8.h:7603:16: note:   candidate expects 2 arguments, 1 provided
../src/libxmljs.cc:137:19: error: ‘NewSymbol’ is not a member of ‘v8::String’
       target->Set(v8::String::NewSymbol("libxml"), target);
                   ^
../src/libxmljs.cc: In function ‘v8::Handle<v8::Value> libxmljs::ThrowError(const char*)’:
../src/libxmljs.cc:97:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [Release/obj.target/xmljs/src/libxmljs.o] Error 1
make: Leaving directory `/usr/lib/node_modules/apiaxle-proxy/node_modules/libxmljs/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.10.0-327.10.1.el7.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/apiaxle-proxy/node_modules/libxmljs
gyp ERR! node -v v4.4.3
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Linux 3.10.0-327.10.1.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "apiaxle-proxy"
npm ERR! node v4.4.3
npm ERR! npm  v2.15.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the hiredis package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs hiredis
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls hiredis
npm ERR! There is likely additional logging output above.

have a response template for apiaxle response

Hello,

It would be very usefull to have a response template to keep consistency between API responses and apiAxle responses.
e.g. the common apiAxle response:

{
  "meta": {
    "version": 1,
    "status_code": 403
  },
  "results": {
    "error": {
      "type": "KeyError",
      "message": "No api_key specified."
    }
  }
}

Our current response template:

{
  "status": "OK",
  "response": [],
  "error": null
}

Adding capture path

I have configured an api name "places" with endpoint "localhost:2100". My API has many routes, now i want to add capture path to the configured "places" api in ApiAxle so tthat i can get the statistics for that particular API.

I am using the following PUT API From the documentation:

curl -H 'content-type: application/json'
-X PUT
'http://localhost:3000/v1/api/places/addcapturepath/localhost:2100/xx/yy/zz'
But i am getting the error:

{"meta":{"version":1,"status_code":404},"results":{"error":{"type":"NotFoundError","message":"'/v1/api/places/addcapturepath/localhost:2100/xx/yy/zz' not found."}}}

In what way i have to specify the capture path.

apiaxle-proxy from command-line crashes with errors

started apiaxle-proxy from command-line crashes with errors after a number of minutes.
Env: Ubuntu

With following output:

[2013-08-23 13:42:02.857] [INFO] [default] - Loaded configuration from
[2013-08-23 13:42:02.932] [INFO] [default] - Loaded getcatchall, postcatchall, putcatchall, deletecatchall, headcatchall, patchcatchall from '/usr/lib/node_modules/apiaxle-proxy/app/controller/__controller.{js,coffee}'
[2013-08-23 13:42:03.011] [INFO] [default] - Loaded apifactory, apilimits, statcounters, stattimers, cache, counters, keyfactory, keyringfactory, register, stats from '/usr/lib/node_modules/apiaxle-proxy/node_modules/apiaxle-base/lib/../app/model/redis/_.{js,coffee}'
[2013-08-23 13:42:03.018] [INFO] [default] - Listening at 127.0.0.1:3000

/usr/lib/node_modules/apiaxle-proxy/node_modules/redis/index.js:551
throw err;
^
TypeError: Cannot read property 'value' of undefined
at /usr/lib/node_modules/apiaxle-proxy/node_modules/async/lib/async.js:158:23
at iterate (/usr/lib/node_modules/apiaxle-proxy/node_modules/async/lib/async.js:118:13)
at /usr/lib/node_modules/apiaxle-proxy/node_modules/async/lib/async.js:129:25
at /usr/lib/node_modules/apiaxle-proxy/node_modules/async/lib/async.js:160:17
at RedisClient. (/usr/lib/node_modules/apiaxle-proxy/node_modules/async/lib/async.js:458:34)
at RedisClient.EventEmitter.emit (events.js:92:17)
at RedisClient.on_ready (/usr/lib/node_modules/apiaxle-proxy/node_modules/redis/index.js:334:10)
at RedisClient.on_info_cmd (/usr/lib/node_modules/apiaxle-proxy/node_modules/redis/index.js:365:14)
at /usr/lib/node_modules/apiaxle-proxy/node_modules/redis/index.js:389:14
at try_callback (/usr/lib/node_modules/apiaxle-proxy/node_modules/redis/index.js:548:9)
Worker 1515 died.

Unlimited qpd causes header switch

Unlimited qpd causes headers to show qps in the place of qpd.

To duplicate, set a key's limits to qpd: -1, qps: 20.
First response should give you headers:

< X-ApiaxleProxy-Qpd-Left: 19
< X-ApiaxleProxy-Qps-Left: undefined

How to change ‘Development’?

According to the help documentation, when ues the configuration file[integration.json] to start the server, but receive ApiUnknown Error.Look up redis database,i guess the key contain 'development' leads to this error,i want to know how to change this “Development” field?
2014-08-30 3 12 16

Friendly name for api keys and list of all keys

Unless I have missed it, we need a way to append friendly names to api keys in order to know which key belongs to which client and a way to list all keys (without including the keyless access keys) and a way to search for a specific key based on the friendly name.

Right now is impossible (unless like I said I missed the way to do it) to manage a lot of clients.

Emscripten: Coffeescript -> JS -> C

Hi,

I think that for performance critical applications it would be nice to have a task that converts the application into a (consolidated) C application. What do you think about this?

Whoa, this project is awesome! I can think of so many useful scenarios..
I really like it!

PUT Update a key does not support removing Apis

The forApis parameters only supports adding new Apis, it does not remove Apis e.g. :
if I do a PUT with this array:

{
  forApis: [1,2,3]
}

and then a PUT with this array

{
  forApis: [1,3]
}

the API 2 will still be linked to the key

Symlink to phils home directory

https://github.com/apiaxle/apiaxle/blob/develop/circle.yml

drwxrwxr-x 11 peter peter 4.0K Sep 23 13:25 .
drwxrwxrwx 53 peter peter 4.0K Sep 23 13:25 ..
drwxrwxr-x  7 peter peter 4.0K Sep 23 13:25 api
drwxrwxr-x  6 peter peter 4.0K Sep 23 13:25 base
drwxrwxr-x  2 peter peter 4.0K Sep 23 13:25 bin
lrwxrwxrwx  1 peter peter   39 Sep 23 13:25 circle.yml -> /home/phil/projects/apiaxle/.travis.yml
-rw-rw-r--  1 peter peter  706 Sep 23 13:25 coffeelint.json

An option to find keyring(s) a key belongs to

Sometime I need to track, who is consuming my resources. Knowing api_key from logs, I want to find which keyring it belongs to.

In current version of ApiAxle API I did not find the way to list keyring(s), a key belongs to. The only method is from the other side - loop through all keyrings and list their apikeys, checking, where is they key I care about mentioned.

As workaround I could find that information in Redis:

$ redis-cli
127.0.0.1:6379> hgetall "gk:development:key:javl-keyrings"
1) "jan.vlcinsky"
2) "1"
127.0.0.1:6379> 

It would be great to see that option via API too.

(PS: I am a Python guy, so it would take me a bit longer to add such modification in your code, but I may try later on, if there is a need and time)

How do stats work?

I've got a couple test APIs configured (one of which is the apiaxle-api), and a test key.

I've made a bunch of requests through both APIs, but when I fetch stats, I get nothing.

I'm putting together our "production" setup, so when I set apiaxle-proxy to start, I'm not using the -q option when I start.

I'm assuming this is why I'm not getting stats.

How does the apiaxle-proxy-event-processor work?

Is it run on a cron? Is it another service to start up?

Or, do you just recommend running with the -q option?

Thanks!

A key is not unlinked from keyring when it is deleted.

Hi, i have tried to add and delete some keys and to link them to a keyring and see what happens.
And i have found that a key is not unlinked from keyring when it is deleted.

Do you know this already or maybe is a my fault for some configuration problem or so?

Feature Request - Add the ability to register custom request and response filters

Similar to the pattern used in Netflix's Zuul, providing a framework to register filters would allow API Axle developers the ability to create a set of actions that would run on the request where applicable before it's passed to the origin, and likewise more actions to be applied to the response on the way out.

These actions might be to do something simple like adding headers or fields to the request/response body (very easily done with JSON in node/coffeescript) or something more complex like creating callouts to other services to do some sort of authorisation to add a JWT header or grab data from another API necessary for the request or for a mashup response.

See IZuulFilter for the basic interface which is simply boolean shouldFilter() to decide whether to run the filter and run() to run it.

Also see the abstract ZuulFilter to see the base filter which includes some more functions, most importantly ordering where necessary (otherwise filters can run concurrently)

Performance statistics

It would be useful to monitor the following things:

  • The average, max and min time taken for each HTTP request within the same time periods and RRD style as the HTTP status statistics.

I guess this means we need to store, for each time period:

  • current average
  • count making up the current score
  • minimum value
  • maximum value

ACL?

ApiAxle looks really promising thus far. But I can't find a definite answer if there is ACL (Access Control)?

For example, I want to have user X with it's API key to only be able to access /api/apicall1 and /api/apicall2 nothing else.

Is this possible?

Thanks.

Proxy veyr slow during our load tests

I'm hoping you can help me optimize the configuration of the proxy for our service load test.
We are using to stress test through apiaxle with 4800 connections over 5 minutes and I think we have reached the limit apiaxle, at least as we have it configured.

Our setup:
APIAxle is running in a docker container behind and nginx reverse proxy.
We have a cluster of 6 machines with round robin load balancing for each service via haproxy.
The complete path for an incoming request is:
nginx -> haproxy -> api axle (6 instances 8 forks on 8 core machines) -> our service

When I remove apiaxle from the chain, we have no problems. When apiaxle is included in that chain we quickly run into 504s from apiaxle and 502 from nginx. I'm inclined to believe that the 504 timeouts are not due to slowness in our service, since without apiaxle in the chain, our response times are still ~60ms during the load test

I was hoping you might have some ideas for things I can try for optimization.
Thanks

Support for specifying from where in the url to grab a key

Some APIs specify the key as part of the path:

http://api-merchants.skimlinks.com/merchants/xml/aabbccddeeffgghhiijjkk1122334455/categories
http://api-merchants.skimlinks.com/merchants/xml/aabbccddeeffgghhiijjkk1122334455/domains/limit/1/start/100
http://api-merchants.skimlinks.com/merchants/xml/aabbccddeeffgghhiijjkk112233445566/search/con/limit/2/start/0?filter_by=preferred
http://api-merchants.skimlinks.com/merchants/xml/aabbccddeeffgghhiijjkk1122334455/category/2/limit/1

We would need to give an API owner a way to extract the key from the URL and use that in place of apiaxle_key or api_key.

apiaxle doesn't install on node v6.3.1 npm v3.10.6 gcc 4.8.4 ubuntu 14.04

I tried first with

npm install apiaxle-api

but it failed exactly for the same reason as #81
As I saw the fix on the development branch #82 , so I downloaded the source and compiled with make.
I could compile it without any problems. But after that when I try to npm install <folder-to-apiaxle-base> it fails still:

In file included from ../src/libxmljs.h:7:0,
                 from ../src/libxmljs.cc:7:
../node_modules/nan/nan.h: At global scope:
../node_modules/nan/nan.h:592:20: error: variable or field ‘AddGCEpilogueCallback’ declared void
       v8::Isolate::GCEpilogueCallback callback
                    ^
../node_modules/nan/nan.h:592:7: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCEpilogueCallback callback
       ^
../node_modules/nan/nan.h:593:18: error: expected primary-expression before ‘gc_type_filter’
     , v8::GCType gc_type_filter = v8::kGCTypeAll) {
                  ^
../node_modules/nan/nan.h:598:20: error: variable or field ‘RemoveGCEpilogueCallback’ declared void
       v8::Isolate::GCEpilogueCallback callback) {
                    ^
../node_modules/nan/nan.h:598:7: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCEpilogueCallback callback) {
       ^
../node_modules/nan/nan.h:603:20: error: variable or field ‘AddGCPrologueCallback’ declared void
       v8::Isolate::GCPrologueCallback callback
                    ^
../node_modules/nan/nan.h:603:7: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCPrologueCallback callback
       ^
../node_modules/nan/nan.h:604:18: error: expected primary-expression before ‘gc_type_filter’
     , v8::GCType gc_type_filter = v8::kGCTypeAll) {
                  ^
../node_modules/nan/nan.h:609:20: error: variable or field ‘RemoveGCPrologueCallback’ declared void
       v8::Isolate::GCPrologueCallback callback) {
                    ^
../node_modules/nan/nan.h:609:7: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCPrologueCallback callback) {
       ^
../node_modules/nan/nan.h: In function ‘bool Nan::SetAccessor(v8::Local<v8::Object>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’:
../node_modules/nan/nan.h:1939:16: warning: ‘bool v8::Object::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’ is deprecated (declared at /home/gulyas/.node-gyp/6.3.1/include/node/v8.h:2735): Use maybe version [-Wdeprecated-declarations]
     , attribute);
                ^
../src/libxmljs.cc: In function ‘void libxmljs::xmlMemFreeWrap(void*)’:
../src/libxmljs.cc:56:24: warning: ‘static bool v8::V8::IsDead()’ is deprecated (declared at /home/gulyas/.node-gyp/6.3.1/include/node/v8.h:8462): Use isolate version [-Wdeprecated-declarations]
     if (v8::V8::IsDead())
                        ^
make: *** [Release/obj.target/xmljs/src/libxmljs.o] Error 1
make: Leaving directory `/home/gulyas/Projects/gli-solutions/apiaxle/apiaxle-user/node_modules/libxmljs/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Linux 3.16.0-77-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/gulyas/Projects/gli-solutions/apiaxle/apiaxle-user/node_modules/libxmljs
gyp ERR! node -v v6.3.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
[email protected] /home/gulyas/Projects/gli-solutions/apiaxle/apiaxle-user
├── [email protected]  extraneous
├── [email protected]  extraneous
├── [email protected]  extraneous
├── [email protected]  extraneous
├── [email protected]  extraneous
├── [email protected]  extraneous
└── [email protected]  extraneous

npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! Linux 3.16.0-77-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "../apiaxle/base"
npm ERR! node v6.3.1
npm ERR! npm  v3.10.6
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the libxmljs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs libxmljs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls libxmljs
npm ERR! There is likely additional logging output above.

npm-debug.log.zip

Suppressing version tag

For the design of our API we would sometimes like to have no version tag in a URI.

(As a policy choice, the plan is to add a version tag if we do a breaking change, but otherwise omit the tag, in order to keep the URI short and pretty. So /foo would be succeeded by /v2/foo).

There appears to be no way to do this with ApiAxle as it is currently implemented. Is that right?

Feature request - Add option to expire regular API keys

I have an outside system that is provisioning API keys on ApiAxle, and would like for ApiAxle to expire these keys after a set period of time, similar to the temporary keys that are created in "keyless" mode, but the TTL would be set on a per key basis at the time of key creation. One hitch is these keys are attached to keyrings, so this relationship would also need expiring.

Thanks.

429 does not return X-ApiaxleProxy-* headers

429 responses (and possibly other errors?) do not contain X-ApiaxleProxy-* headers.

Eg. when exceeding a QPS limit, the client cannot see how many QPD they have left

< HTTP/1.1 429 Too Many Requests
< Content-Type: application/json
< Date: Tue, 13 Oct 2015 12:52:32 GMT
* Server nginx/1.4.6 (Ubuntu) is not blacklisted
< Server: nginx/1.4.6 (Ubuntu)
< Content-Length: 159
< Connection: keep-alive
< 

Stats endpoints

At the moment we have stats for individual keys at /v1/stats/:key/all (this endpoint is wrong, should be at /v1/keys/:key/stats). Would be good to have them for entire APIs, at, say /v1/api/:api/stats/all

Licencing

Need to decide on which licence(s) to use. When that's done:

  • Add a licence to the source code.
  • Document on the front page of the website.

Allow custom meta error response

The way in which apiaxle returns its own errors is different to our API. For example, when an API key is not valid:

{"meta":{"version":1,"status_code":403},"results":{"error":{"type":"KeyError","message":"'xxx' is not a valid key."}}}

This error message includes information about apiaxle itself. We don't want to show this to users. It would be very useful if it was possible to configure apiaxle to return errors in a particular format.

Custom port on HTTPS endpoint is not logged

 { protocol: 'https',
 apiFormat: 'json',
 endPointTimeout: 30,
 disabled: false,
 strictSSL: true,
 sendThroughApiKey: false,
 sendThroughApiSig: false,
 hasCapturePaths: false,
 allowKeylessUse: false,
 keylessQps: 2,
 keylessQpd: 172800,
 endPoint: 'sample.api.com:18201',  // custom port
 createdAt: 1396446648145,
 updatedAt: 1396540278244 }

port is missing

[2014-04-03 09:54:31.924] [DEBUG] [default] - Backend: POST to 'https://sample.api.com/

Values for apikey param

It would be good to support a broader range of param names for the apikey in the request, or even specify a custom value on api creation.
I have an api that uses api_key, the workaround of also including apikey as a parameter suffices but it could be cleaner.

Thanks

More narrowing down for stats endpoint

It would be nice to add the following to the stats endpoint:

Just show 200s:

&filter_status=200

Just show uncached:

&filter_type=uncached

So uncached 400s:

&filter_type=uncached&filter_status=400

Caching - per url basis

Details for this to be set in the configuration file. Allow arbitrary timed caching based on regexps. Config excerpt might look like this:

{
  "^/products/.*$": 20,
  "^/users/.+/details": 200
}

Should be a way of expiring the cache through a header (check RFC for which one).

Using apiaxle with redis instance that requires auth

I can not figure out how to configure my json file so that when apiaxle connects to redis it uses our auth key. I have looked on the site and see the config example which only includes host and port. Does ApiAxle support connecting to a redis instance that requires auth?

Creating an api, keyring or key called "all" would break everything

It's possible for people to override the 'magic' all keys for models. I would suggest we move the objects to a new namespace eg:

gk:development:apifactory:facebook

becomes:

gk:development:apifactory:api:facebook

Meaning a model gets much more namespace maneuverability. Sound sensible?

Feature Request: Authenticate via the API

Hello,

It would be nice to be able to authenticate directly via the API.

Architecturally this would separate the proxy from apiaxle allowing different modes of working.

For example, applications could call the API directly from inside (without the need for a proxy) or proxy servers, such as nginx, could be used to front applications whilst delegating to apiaxle for authentication, limiting, monitoring etc. on the APIs.

Thanks
Peter

DEPTH_ZERO_SELF_SIGNED_CERT error

Hi, I am configuring ApiAxle in Ubuntu 12 and i am getting an error when i try to get an url from the api.

The error is "DEPTH_ZERO_SELF_SIGNED_CERT".

I am using Node.js and restify. The protocol used is https, and when i write my custom api url in the browser, i get a correct answerd, but when i use apiaxle i receive that error.

If i change https to http, it works!!

Commands i used:

api “myapi” create endPoint=”localhost:3001” protocol=”https”
key “1234” create
api myapi linkkey “1234”

And used this command to test it

curl 'http://myapi.api.localhost:3000/user/new?api_key=1234'

Could you give some advice or knowledgement to fix it?

Thanks, best regards

Something weird with Keys By API call

Making a call to /v1/api/facebook/keys?from=0&to=10&resolve=true seems to return all keys regardless of the API they belong to.

axle_screen

Will try to get a look at it today

Implement repl quit/exit command

This is probably a bit silly, but it would be nice if there is an exit/quit command instead of using Ctrl+C to get out of the api repl.

It's just a command that you usually expect a shell to have :)

Cheeers,

Alex

Uncaught error in REPL when requesting help

Somewhat low priority, but why not. Appears to happen with any nonexistant argument after help, exits back to shell.

axle> help xoxo

/usr/lib/node_modules/apiaxle-repl/lib/repl.js:99
        command_object = new this.constructor.all_commands[subcommand](this.ap
                         ^
TypeError: undefined is not a function
    at ReplHelper.exports.ReplHelper.ReplHelper.runCommands (/usr/lib/node_modules/apiaxle-repl/lib/repl.js:99:26)
    at ReplHelper.exports.ReplHelper.ReplHelper.processLine (/usr/lib/node_modules/apiaxle-repl/lib/repl.js:137:17)
    at /usr/lib/node_modules/apiaxle-repl/lib/repl.js:144:20
    at Interface._onLine (readline.js:200:5)
    at Interface._line (readline.js:531:8)
    at Interface._ttyWrite (readline.js:760:14)
    at ReadStream.onkeypress (readline.js:99:10)
    at ReadStream.EventEmitter.emit (events.js:98:17)
    at emitKey (readline.js:1095:12)
    at ReadStream.onData (readline.js:840:14)

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.