Skip to content

Commit

Permalink
Adding cache API - CLI Rewrite - Serf integration/Clustering - Hooks/…
Browse files Browse the repository at this point in the history
…Events - Invalidations
  • Loading branch information
subnetmarco committed Jan 21, 2016
1 parent 9f1ffb3 commit 4ea5b2b
Show file tree
Hide file tree
Showing 127 changed files with 4,632 additions and 1,146 deletions.
4 changes: 2 additions & 2 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
redefined = false
unused_args = false
globals = {"ngx", "dao", "app", "configuration", "process_id"}
globals = {"ngx", "dao", "app", "configuration", "events"}

files["kong/"] = {
std = "luajit"
Expand All @@ -20,5 +20,5 @@ files["kong/vendor/resty_http.lua"] = {
}

files["spec/"] = {
globals = {"describe", "it", "before_each", "setup", "after_each", "teardown", "stub", "mock", "spy", "finally", "pending"}
globals = {"describe", "it", "before_each", "setup", "after_each", "teardown", "stub", "mock", "spy", "finally", "pending", "build"}
}
17 changes: 12 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ addons:
- build-essential
env:
global:
- LUA=luajit-2.1
- CASSANDRA_VERSION=2.1.9
- LUA_VERSION=luajit-2.1
- CASSANDRA_VERSION=2.2.4
- LUAROCKS_VERSION=2.2.2
- OPENSSL_VERSION=1.0.2e
- OPENRESTY_VERSION=1.9.3.1
- SERF_VERSION=0.7.0
- DNSMASQ_VERSION=2.75
- LUAJIT_DIR=$HOME/luajit
- LUAROCKS_DIR=$HOME/luarocks
- OPENRESTY_DIR=$HOME/openresty
- SERF_DIR=$HOME/serf
- DNSMASQ_DIR=$HOME/dnsmasq
- CASSANDRA_HOSTS=127.0.0.1
matrix:
- TEST_SUITE=unit
Expand All @@ -28,7 +32,9 @@ before_install:
- bash .ci/setup_lua.sh
- bash .ci/setup_openresty.sh
- bash .ci/setup_cassandra.sh
- export PATH="$LUAJIT_DIR/bin:$LUAROCKS_DIR/bin:$OPENRESTY_DIR/nginx/sbin:$PATH"
- bash .ci/setup_serf.sh
- bash .ci/setup_dnsmasq.sh
- export PATH="$LUAJIT_DIR/bin:$LUAROCKS_DIR/bin:$OPENRESTY_DIR/nginx/sbin:$SERF_DIR:$DNSMASQ_DIR/usr/local/sbin:$PATH"
- export LUA_PATH="./?.lua;$LUAROCKS_DIR/share/lua/5.1/?.lua;$LUAROCKS_DIR/share/lua/5.1/?/init.lua;$LUAROCKS_DIR/lib/lua/5.1/?.lua;$LUA_PATH"
- export LUA_CPATH="./?.so;$LUAROCKS_DIR/lib/lua/5.1/?.so;$LUA_CPATH"
install:
Expand All @@ -38,7 +44,6 @@ install:
- luarocks install luacheck
- luarocks make kong-*.rockspec
- "kong config -c kong.yml -e TEST"
- 'sed -i "2 i\dns_resolver: server" kong_TEST.yml'
script:
- make lint
- .ci/run_tests.sh
Expand All @@ -49,4 +54,6 @@ cache:
- $LUAJIT_DIR
- $LUAROCKS_DIR
- $OPENRESTY_DIR
- $HOME/.ccm/repository
- $SERF_DIR
- $DNSMASQ_DIR
- $HOME/.ccm/repository
28 changes: 15 additions & 13 deletions bin/kong
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,28 @@
-- This script is not parsed by lapp due to limitations of the said framework as it
-- is currently implemented.

local cutils = require "kong.cli.utils"
local infos = cutils.get_kong_infos()
local luarocks = require "kong.cli.utils.luarocks"
local infos = luarocks.get_kong_infos()
local commands = {
db = "kong.cli.db",
stop = "kong.cli.stop",
quit = "kong.cli.quit",
start = "kong.cli.start",
reload = "kong.cli.reload",
config = "kong.cli.config",
restart = "kong.cli.restart",
version = "kong.cli.version",
["--version"] = "kong.cli.version",
migrations = "kong.cli.migrations"
db = "kong.cli.cmds.db",
stop = "kong.cli.cmds.stop",
quit = "kong.cli.cmds.quit",
start = "kong.cli.cmds.start",
reload = "kong.cli.cmds.reload",
config = "kong.cli.cmds.config",
restart = "kong.cli.cmds.restart",
version = "kong.cli.cmds.version",
status = "kong.cli.cmds.status",
migrations = "kong.cli.cmds.migrations",
cluster = "kong.cli.cmds.cluster",
["--version"] = "kong.cli.cmds.version"
}

local help_message = string.format([[
Usage: kong <command>

where <command> is one of:
start, restart, reload, stop, quit, version
start, restart, reload, stop, quit, cluster, status, migrations, version

kong --help print this message
kong <command> --help print the help message of a command
Expand Down
56 changes: 43 additions & 13 deletions kong-0.5.4-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies = {
"ansicolors ~> 1.0.2-3",
"lbase64 ~> 20120820-1",
"lua-resty-iputils ~> 0.2.0-1",
"mediator_lua ~> 1.1.2-0",

"luasocket ~> 2.0.2-6",
"lrexlib-pcre ~> 2.7.2-1",
Expand All @@ -45,27 +46,33 @@ build = {

["kong.constants"] = "kong/constants.lua",

["kong.cli.utils"] = "kong/cli/utils.lua",
["kong.cli.utils.dnsmasq"] = "kong/cli/utils/dnsmasq.lua",
["kong.cli.utils.logger"] = "kong/cli/utils/logger.lua",
["kong.cli.utils.luarocks"] = "kong/cli/utils/luarocks.lua",
["kong.cli.utils.ssl"] = "kong/cli/utils/ssl.lua",
["kong.cli.utils.signal"] = "kong/cli/utils/signal.lua",
["kong.cli.utils.input"] = "kong/cli/utils/input.lua",
["kong.cli.db"] = "kong/cli/db.lua",
["kong.cli.config"] = "kong/cli/config.lua",
["kong.cli.quit"] = "kong/cli/quit.lua",
["kong.cli.stop"] = "kong/cli/stop.lua",
["kong.cli.start"] = "kong/cli/start.lua",
["kong.cli.reload"] = "kong/cli/reload.lua",
["kong.cli.restart"] = "kong/cli/restart.lua",
["kong.cli.version"] = "kong/cli/version.lua",
["kong.cli.migrations"] = "kong/cli/migrations.lua",
["kong.cli.utils.services"] = "kong/cli/utils/services.lua",
["kong.cli.cmds.config"] = "kong/cli/cmds/config.lua",
["kong.cli.cmds.quit"] = "kong/cli/cmds/quit.lua",
["kong.cli.cmds.stop"] = "kong/cli/cmds/stop.lua",
["kong.cli.cmds.start"] = "kong/cli/cmds/start.lua",
["kong.cli.cmds.reload"] = "kong/cli/cmds/reload.lua",
["kong.cli.cmds.restart"] = "kong/cli/cmds/restart.lua",
["kong.cli.cmds.version"] = "kong/cli/cmds/version.lua",
["kong.cli.cmds.status"] = "kong/cli/cmds/status.lua",
["kong.cli.cmds.migrations"] = "kong/cli/cmds/migrations.lua",
["kong.cli.cmds.cluster"] = "kong/cli/cmds/cluster.lua",
["kong.cli.services.base_service"] = "kong/cli/services/base_service.lua",
["kong.cli.services.dnsmasq"] = "kong/cli/services/dnsmasq.lua",
["kong.cli.services.serf"] = "kong/cli/services/serf.lua",
["kong.cli.services.nginx"] = "kong/cli/services/nginx.lua",

["kong.tools.io"] = "kong/tools/io.lua",
["kong.tools.utils"] = "kong/tools/utils.lua",
["kong.tools.faker"] = "kong/tools/faker.lua",
["kong.tools.syslog"] = "kong/tools/syslog.lua",
["kong.tools.ngx_stub"] = "kong/tools/ngx_stub.lua",
["kong.tools.printable"] = "kong/tools/printable.lua",
["kong.tools.cluster"] = "kong/tools/cluster.lua",
["kong.tools.responses"] = "kong/tools/responses.lua",
["kong.tools.timestamp"] = "kong/tools/timestamp.lua",
["kong.tools.migrations"] = "kong/tools/migrations.lua",
Expand All @@ -79,19 +86,24 @@ build = {
["kong.core.certificate"] = "kong/core/certificate.lua",
["kong.core.resolver"] = "kong/core/resolver.lua",
["kong.core.plugins_iterator"] = "kong/core/plugins_iterator.lua",
["kong.core.hooks"] = "kong/core/hooks.lua",
["kong.core.reports"] = "kong/core/reports.lua",
["kong.core.cluster"] = "kong/core/cluster.lua",
["kong.core.events"] = "kong/core/events.lua",

["kong.dao.cassandra.schema.migrations"] = "kong/dao/cassandra/schema/migrations.lua",
["kong.dao.error"] = "kong/dao/error.lua",
["kong.dao.schemas_validation"] = "kong/dao/schemas_validation.lua",
["kong.dao.schemas.apis"] = "kong/dao/schemas/apis.lua",
["kong.dao.schemas.nodes"] = "kong/dao/schemas/nodes.lua",
["kong.dao.schemas.consumers"] = "kong/dao/schemas/consumers.lua",
["kong.dao.schemas.plugins"] = "kong/dao/schemas/plugins.lua",
["kong.dao.cassandra.factory"] = "kong/dao/cassandra/factory.lua",
["kong.dao.cassandra.query_builder"] = "kong/dao/cassandra/query_builder.lua",
["kong.dao.cassandra.base_dao"] = "kong/dao/cassandra/base_dao.lua",
["kong.dao.cassandra.migrations"] = "kong/dao/cassandra/migrations.lua",
["kong.dao.cassandra.apis"] = "kong/dao/cassandra/apis.lua",
["kong.dao.cassandra.nodes"] = "kong/dao/cassandra/nodes.lua",
["kong.dao.cassandra.consumers"] = "kong/dao/cassandra/consumers.lua",
["kong.dao.cassandra.plugins"] = "kong/dao/cassandra/plugins.lua",

Expand All @@ -111,18 +123,21 @@ build = {
["kong.plugins.basic-auth.handler"] = "kong/plugins/basic-auth/handler.lua",
["kong.plugins.basic-auth.access"] = "kong/plugins/basic-auth/access.lua",
["kong.plugins.basic-auth.schema"] = "kong/plugins/basic-auth/schema.lua",
["kong.plugins.basic-auth.hooks"] = "kong/plugins/basic-auth/hooks.lua",
["kong.plugins.basic-auth.api"] = "kong/plugins/basic-auth/api.lua",
["kong.plugins.basic-auth.daos"] = "kong/plugins/basic-auth/daos.lua",

["kong.plugins.key-auth.schema.migrations"] = "kong/plugins/key-auth/schema/migrations.lua",
["kong.plugins.key-auth.handler"] = "kong/plugins/key-auth/handler.lua",
["kong.plugins.key-auth.hooks"] = "kong/plugins/key-auth/hooks.lua",
["kong.plugins.key-auth.schema"] = "kong/plugins/key-auth/schema.lua",
["kong.plugins.key-auth.api"] = "kong/plugins/key-auth/api.lua",
["kong.plugins.key-auth.daos"] = "kong/plugins/key-auth/daos.lua",

["kong.plugins.oauth2.schema.migrations"] = "kong/plugins/oauth2/schema/migrations.lua",
["kong.plugins.oauth2.handler"] = "kong/plugins/oauth2/handler.lua",
["kong.plugins.oauth2.access"] = "kong/plugins/oauth2/access.lua",
["kong.plugins.oauth2.hooks"] = "kong/plugins/oauth2/hooks.lua",
["kong.plugins.oauth2.schema"] = "kong/plugins/oauth2/schema.lua",
["kong.plugins.oauth2.daos"] = "kong/plugins/oauth2/daos.lua",
["kong.plugins.oauth2.api"] = "kong/plugins/oauth2/api.lua",
Expand All @@ -142,6 +157,7 @@ build = {
["kong.plugins.file-log.handler"] = "kong/plugins/file-log/handler.lua",
["kong.plugins.file-log.schema"] = "kong/plugins/file-log/schema.lua",

["kong.plugins.mashape-analytics.schema.migrations"] = "kong/plugins/mashape-analytics/schema/migrations.lua",
["kong.plugins.mashape-analytics.handler"] = "kong/plugins/mashape-analytics/handler.lua",
["kong.plugins.mashape-analytics.schema"] = "kong/plugins/mashape-analytics/schema.lua",
["kong.plugins.mashape-analytics.buffer"] = "kong/plugins/mashape-analytics/buffer.lua",
Expand Down Expand Up @@ -175,6 +191,7 @@ build = {
["kong.plugins.cors.schema"] = "kong/plugins/cors/schema.lua",

["kong.plugins.ssl.handler"] = "kong/plugins/ssl/handler.lua",
["kong.plugins.ssl.hooks"] = "kong/plugins/ssl/hooks.lua",
["kong.plugins.ssl.ssl_util"] = "kong/plugins/ssl/ssl_util.lua",
["kong.plugins.ssl.schema"] = "kong/plugins/ssl/schema.lua",

Expand All @@ -184,12 +201,24 @@ build = {
["kong.plugins.acl.schema.migrations"] = "kong/plugins/acl/schema/migrations.lua",
["kong.plugins.acl.handler"] = "kong/plugins/acl/handler.lua",
["kong.plugins.acl.schema"] = "kong/plugins/acl/schema.lua",
["kong.plugins.acl.hooks"] = "kong/plugins/acl/hooks.lua",
["kong.plugins.acl.api"] = "kong/plugins/acl/api.lua",
["kong.plugins.acl.daos"] = "kong/plugins/acl/daos.lua",

["kong.api.app"] = "kong/api/app.lua",
["kong.api.crud_helpers"] = "kong/api/crud_helpers.lua",
["kong.api.route_helpers"] = "kong/api/route_helpers.lua",
["kong.api.routes.kong"] = "kong/api/routes/kong.lua",
["kong.api.routes.apis"] = "kong/api/routes/apis.lua",
["kong.api.routes.consumers"] = "kong/api/routes/consumers.lua",
["kong.api.routes.plugins"] = "kong/api/routes/plugins.lua",
["kong.api.routes.cache"] = "kong/api/routes/cache.lua",
["kong.api.routes.cluster"] = "kong/api/routes/cluster.lua",

["kong.plugins.jwt.schema.migrations"] = "kong/plugins/jwt/schema/migrations.lua",
["kong.plugins.jwt.handler"] = "kong/plugins/jwt/handler.lua",
["kong.plugins.jwt.schema"] = "kong/plugins/jwt/schema.lua",
["kong.plugins.jwt.hooks"] = "kong/plugins/jwt/hooks.lua",
["kong.plugins.jwt.api"] = "kong/plugins/jwt/api.lua",
["kong.plugins.jwt.daos"] = "kong/plugins/jwt/daos.lua",
["kong.plugins.jwt.jwt_parser"] = "kong/plugins/jwt/jwt_parser.lua",
Expand All @@ -198,6 +227,7 @@ build = {
["kong.plugins.hmac-auth.handler"] = "kong/plugins/hmac-auth/handler.lua",
["kong.plugins.hmac-auth.access"] = "kong/plugins/hmac-auth/access.lua",
["kong.plugins.hmac-auth.schema"] = "kong/plugins/hmac-auth/schema.lua",
["kong.plugins.hmac-auth.hooks"] = "kong/plugins/hmac-auth/hooks.lua",
["kong.plugins.hmac-auth.api"] = "kong/plugins/hmac-auth/api.lua",
["kong.plugins.hmac-auth.daos"] = "kong/plugins/hmac-auth/daos.lua",

Expand All @@ -216,4 +246,4 @@ build = {
conf = { "kong.yml" },
bin = { "bin/kong" }
}
}
}
Loading

0 comments on commit 4ea5b2b

Please sign in to comment.