Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing body encoding in http_client #779

Closed
wants to merge 116 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
8954a1e
Adding a function to count the entities in a table
subnetmarco Oct 13, 2015
806ae78
Disabling access log for status endpoint
subnetmarco Oct 14, 2015
787b99e
Merge pull request #623 from Mashape/fix/status-logs
subnetmarco Oct 14, 2015
d26c761
Customizable DNS settings
subnetmarco Oct 15, 2015
3114ef7
Merge pull request #625 from Mashape/feat/custom-dns
subnetmarco Oct 15, 2015
731e203
fix(alf_serializer) always ensure mimeType is a string
thibaultcha Oct 15, 2015
956f94d
perf(alf_serializer) globals optimizations
thibaultcha Oct 15, 2015
eef305a
Merge pull request #626 from Mashape/fix/alf-serializer
thibaultcha Oct 15, 2015
c0ab86d
OAuth 2.0 tests to check for upstream headers
subnetmarco Oct 15, 2015
a0fc23f
Merge pull request #627 from Mashape/tests/oauth2
subnetmarco Oct 15, 2015
aa54b58
Updating dependencies
subnetmarco Oct 15, 2015
709f4b9
Merge pull request #628 from Mashape/enhancement/updating-dependencies
subnetmarco Oct 15, 2015
b912125
Merge pull request #632 from Mashape/dao/count
subnetmarco Oct 15, 2015
57b9e30
feat(cli) config validation and defaults utility
thibaultcha Oct 7, 2015
d26e179
feat(cli) use new config and dao loaders
thibaultcha Oct 7, 2015
92a37c8
Adding "total" field in API responses
subnetmarco Oct 15, 2015
21d77a5
Adding database stats into status endpoint
subnetmarco Oct 16, 2015
9f2e83a
Merge pull request #635 from Mashape/chore/api-totals
subnetmarco Oct 16, 2015
94747d8
Updating changelog for 0.6.x
subnetmarco Oct 16, 2015
15addbf
Refactoring the count function in DAO and API
subnetmarco Oct 16, 2015
d0edd94
Merge pull request #636 from Mashape/refactor/count
thibaultcha Oct 16, 2015
370f124
feat(config) commented configuration file
thibaultcha Oct 8, 2015
121a949
feat(config) add options for keyspace replication strategy
thibaultcha Sep 30, 2015
ccac50b
refactor(config) remove unnecessary dao config nesting
thibaultcha Oct 5, 2015
15e6205
feat(config) implement `enum` check for properties
thibaultcha Oct 16, 2015
303e235
feat(config) update `kong config` to new config file format
thibaultcha Oct 16, 2015
12d8171
Merge pull request #633 from Mashape/feat/commented-config
thibaultcha Oct 16, 2015
b97eef2
fix(readme): update community resources
Oct 16, 2015
fcfdc4d
Merge pull request #637 from Mashape/readme-patch
Oct 16, 2015
daa8632
Merge branch 'sinzone-patch-1' into next
thibaultcha Oct 19, 2015
99d584d
docs(readme)
sonicaghi Oct 19, 2015
50382d4
fix(config/rockspec) add missing files and remove dnsmasq_port property
thibaultcha Oct 20, 2015
f2f84fd
Merge pull request #645 from Mashape/fix/config
thibaultcha Oct 20, 2015
34fd7d8
Merge branch 'sinzone-patch-1' into next
thibaultcha Oct 20, 2015
00e5e2b
Merge branch 'master' into next
thibaultcha Oct 21, 2015
fb22f93
chore(ci) bump Cassandra version
thibaultcha Oct 21, 2015
77fd7e1
Merge pull request #649 from Mashape/chore/bump-cassandra
thibaultcha Oct 21, 2015
5163571
Merge remote-tracking branch 'mybuilder/fix-oauth2-https-check' into …
thibaultcha Oct 21, 2015
635daf0
Merge branch 'hotfix/hmac-date' into next
thibaultcha Oct 21, 2015
2bf4def
Merge branch 'release/0.5.2' into next
thibaultcha Oct 22, 2015
7595850
Merge branch 'hotfix/path-search' into next
thibaultcha Oct 22, 2015
6df7bbd
docs(ldoc) better documentation for public Lua API
thibaultcha Oct 27, 2015
e029020
Merge pull request #657 from Mashape/docs/comments
thibaultcha Oct 27, 2015
7d5420d
fix: remove erroneous inspect statement
thibaultcha Oct 27, 2015
c55e72b
docs(ldoc) improvements to base_dao and responses
thibaultcha Oct 28, 2015
742e377
Merge pull request #663 from Mashape/docs/ldoc-improvements
thibaultcha Oct 28, 2015
6203eb1
chore(scripts) remove scripts folder from 0.5.0
thibaultcha Oct 28, 2015
f9ddff5
Merge pull request #664 from Mashape/chore/rm-scripts
thibaultcha Oct 28, 2015
0989e77
Merge branch 'sinzone-patch-1' into next
thibaultcha Oct 30, 2015
d739d7c
Merge pull request #667 from jerizm/feature/jwt-allowpatch
thibaultcha Oct 30, 2015
17b70c1
Revert "Allow PATCH method on jwt credential endpoint"
thibaultcha Oct 29, 2015
09f6848
docs(readme) add links t oplugin development guide and Lua reference
thibaultcha Oct 30, 2015
e9355ad
fix(galileo buffer) immediate fire of send_batch if queue is not empty
thibaultcha Nov 2, 2015
7f97216
Merge remote-tracking branch 'origin/sinzone-patch-1' into next
thibaultcha Nov 3, 2015
c345918
Better URL handling
subnetmarco Nov 5, 2015
787c517
Merge pull request #687 from Mashape/chore/oauth2
subnetmarco Nov 5, 2015
d9220d1
syslog and loggly plugins
Nov 5, 2015
d637e9c
Merge branch 'sinzone-patch-1' into next
thibaultcha Nov 8, 2015
b8c5db1
Merge branch 'sinzone-patch-1-1' into next
thibaultcha Nov 8, 2015
752ac77
Replacing the previous uuid library with our lua_uuid
subnetmarco Nov 7, 2015
68e75d4
Closes #700
subnetmarco Nov 9, 2015
fc9715a
Merge pull request #695 from Mashape/chore/uuid
subnetmarco Nov 10, 2015
3614ee0
Merge branch 'hotfix/uri' into next
subnetmarco Nov 10, 2015
15d74b7
Cleaning up unused variables
subnetmarco Nov 10, 2015
ef43926
Merge branch 'hotfix/env' into next
subnetmarco Nov 10, 2015
d05d81f
refactor(resolver) simpler kong.lua and resolver
thibaultcha Nov 7, 2015
2465021
fix(resolver) remove uneeded `stop_phases` ctx variable
thibaultcha Nov 7, 2015
2ff1baa
refactor(resolver) resolver is now `core`
thibaultcha Nov 7, 2015
f23a7cc
refactor(resolver) custom iterator for plugins execution
thibaultcha Nov 10, 2015
96200df
refactor(resolver) decouple custom iterator
thibaultcha Nov 10, 2015
058c1c2
Merge pull request #708 from Mashape/refactor/resolver
thibaultcha Nov 10, 2015
e0a288b
hotfix(hmac-auth) constant time digest comparison
Oct 28, 2015
ad86c7f
Merge branch 'sinzone-patch-1' into next
thibaultcha Nov 10, 2015
93a10df
Fixing require statement
subnetmarco Nov 10, 2015
14d4a99
Merge branch 'next' of github.com:Mashape/kong into next
subnetmarco Nov 10, 2015
358fc1c
Request transformer add json
cgarvis Nov 10, 2015
c355ed2
Request transformation remove json
cgarvis Nov 10, 2015
8f77567
style(loggly/syslog) fix whitespaces...
thibaultcha Nov 10, 2015
c9971cb
Merge pull request #698 from Mashape/feat/syslog
thibaultcha Nov 10, 2015
330e6e2
Merge pull request #702 from Mashape/fix/admin-request-body
thibaultcha Nov 10, 2015
9aeb778
Merge pull request #712 from cgarvis/569-request-transform-json-next
thibaultcha Nov 10, 2015
fffbb14
chore(rocks) downgrade lrexlib to 2.7.2
thibaultcha Nov 12, 2015
b0b9412
Merge branch 'hotfix/galileo-custom-config' into next
subnetmarco Nov 16, 2015
e526551
(hotfix) galileo path
subnetmarco Nov 16, 2015
b5330ad
Revert "Revert "Allow PATCH method on jwt credential endpoint""
subnetmarco Nov 18, 2015
bbd609e
(chore) Updating lua_uuid library to latest version
subnetmarco Nov 19, 2015
fac0f70
:umbrella: Merge branch 'sinzone-patch-1' into next
thibaultcha Nov 23, 2015
f4b9be2
Merge branch 'docs/changelog' into next
thibaultcha Nov 23, 2015
808daa1
Fixing trailing slash bug
subnetmarco Nov 11, 2015
4281bdc
Merge pull request #715 from Mashape/fix/trailing-slash
subnetmarco Nov 25, 2015
b7b65f2
Scopes are not properly separated
subnetmarco Nov 25, 2015
da0abb4
Merge pull request #745 from Mashape/fix/oauth2-scopes
subnetmarco Nov 25, 2015
9c0db54
(chore) updating Lapis
subnetmarco Nov 25, 2015
514fa7b
Merge branch 'next' of github.com:Mashape/kong into next
subnetmarco Nov 25, 2015
8cd17d6
Properly printing DAO errors
subnetmarco Nov 25, 2015
41abc6b
Merge branch 'hotfix/galileo-bodies' into next
Nov 25, 2015
24cc4e8
Merge branch 'patch-1' into next
thibaultcha Nov 25, 2015
ba2259a
Merge pull request #746 from Mashape/chore/errors
subnetmarco Nov 30, 2015
af2ec4b
fix(specs) correct alf_serializer_spec fixture
thibaultcha Dec 1, 2015
571b631
specs(resolver) better unit testing for resolver
thibaultcha Nov 30, 2015
6d467c4
fix(resolver) percent-encode query args
thibaultcha Dec 1, 2015
6274cc4
fix+style: fix utils.encode_args failing some tests
thibaultcha Dec 1, 2015
c9b3a0e
Merge pull request #753 from Mashape/fix/alf-serializer-specs
thibaultcha Dec 2, 2015
51918e8
Merge pull request #752 from Mashape/fix/resolver-query-encoding
thibaultcha Dec 2, 2015
c0fd516
fix(core) smarter ngx.ctx.KONG_* timers
thibaultcha Dec 1, 2015
91082bb
Merge pull request #756 from Mashape/fix/timers
thibaultcha Dec 2, 2015
595bcdb
(chore) adding global process ID
subnetmarco Dec 2, 2015
016a91d
prevent tests from hanging when failing,
Dec 2, 2015
416f687
remove debug lines
Dec 2, 2015
3718f8f
Added accept_http_if_already_terminated to SLL and OAuth 2 plugins to…
subnetmarco Dec 2, 2015
8d63368
Merge pull request #764 from Mashape/fix/https
subnetmarco Dec 2, 2015
d8dc433
Merge branch 'hotfix/alf-buffer-under-load' into next
thibaultcha Dec 3, 2015
a211555
Merge branch 'hotfix/alf-serializer-json-body' into next
thibaultcha Dec 3, 2015
c38afeb
Merge pull request #769 from Tieske/fix_test
thibaultcha Dec 4, 2015
cf20cad
Merge branch 'release/0.5.4' into next
thibaultcha Dec 4, 2015
e1f213e
Merge branch 'hotfix/release-tag' into next
thibaultcha Dec 4, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: erlang

env:
global:
- CASSANDRA_VERSION=2.1.10
- CASSANDRA_VERSION=2.1.11
matrix:
- LUA=lua5.1

Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
## [Unreleased][unreleased]

### Added

- Added a `total` field in API responses, that counts the total number of entities in the table. [#635](https://github.com/Mashape/kong/pull/635)
- You can now specify a custom DNS resolver address that Kong will use when resolving hostnames. [#625](https://github.com/Mashape/kong/pull/635)

### Changed

- Removed the `dnsmasq_port` property, and introduced `dns_resolver` that also allows to specify a custom DNS server. [#625](https://github.com/Mashape/kong/pull/635)
- The `/status` endpoint now includes `database` statistics, while the previous stats have been moved to a `server` field. [#635](https://github.com/Mashape/kong/pull/635)
- Disabled access logs for `/status` endpoint

### Fixed

- In the API, the `next` link is not being displayed anymore if there are no more entities to return. [#635](https://github.com/Mashape/kong/pull/635)

## [0.5.4] - 2015/12/03

### Fixed
Expand Down
21 changes: 0 additions & 21 deletions config.ld

This file was deleted.

37 changes: 23 additions & 14 deletions kong-0.5.4-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ dependencies = {
"lua ~> 5.1",
"luasec ~> 0.5-2",

"uuid ~> 0.2-1",
"lua_uuid ~> 0.1-8",
"luatz ~> 0.3-1",
"yaml ~> 1.1.1-1",
"lapis ~> 1.1.0-1",
"yaml ~> 1.1.2-1",
"lapis ~> 1.3.1-1",
"stringy ~> 0.4-1",
"lua-cassandra ~> 0.3.6-0",
"multipart ~> 0.2-1",
Expand All @@ -27,10 +27,11 @@ dependencies = {
"lbase64 ~> 20120820-1",
"lua-resty-iputils ~> 0.2.0-1",

"luasocket ~> 2.0.2-5",
"luasocket ~> 2.0.2-6",
"lrexlib-pcre ~> 2.7.2-1",
"lua-llthreads2 ~> 0.1.3-1",
"luacrypto >= 0.3.2-1"
"luacrypto >= 0.3.2-1",
"luasyslog >= 1.0.0-2"
}
build = {
type = "builtin",
Expand Down Expand Up @@ -70,15 +71,15 @@ build = {
["kong.tools.migrations"] = "kong/tools/migrations.lua",
["kong.tools.http_client"] = "kong/tools/http_client.lua",
["kong.tools.database_cache"] = "kong/tools/database_cache.lua",
["kong.tools.config_defaults"] = "kong/tools/config_defaults.lua",
["kong.tools.config_loader"] = "kong/tools/config_loader.lua",
["kong.tools.dao_loader"] = "kong/tools/dao_loader.lua",

["kong.resolver.handler"] = "kong/resolver/handler.lua",
["kong.resolver.access"] = "kong/resolver/access.lua",
["kong.resolver.header_filter"] = "kong/resolver/header_filter.lua",
["kong.resolver.certificate"] = "kong/resolver/certificate.lua",

["kong.reports.handler"] = "kong/reports/handler.lua",
["kong.reports.init_worker"] = "kong/reports/init_worker.lua",
["kong.reports.log"] = "kong/reports/log.lua",
["kong.core.handler"] = "kong/core/handler.lua",
["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.reports"] = "kong/core/reports.lua",

["kong.dao.cassandra.schema.migrations"] = "kong/dao/cassandra/schema/migrations.lua",
["kong.dao.error"] = "kong/dao/error.lua",
Expand Down Expand Up @@ -220,7 +221,15 @@ build = {
["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.api"] = "kong/plugins/hmac-auth/api.lua",
["kong.plugins.hmac-auth.daos"] = "kong/plugins/hmac-auth/daos.lua"
["kong.plugins.hmac-auth.daos"] = "kong/plugins/hmac-auth/daos.lua",

["kong.plugins.syslog.handler"] = "kong/plugins/syslog/handler.lua",
["kong.plugins.syslog.log"] = "kong/plugins/syslog/log.lua",
["kong.plugins.syslog.schema"] = "kong/plugins/syslog/schema.lua",

["kong.plugins.loggly.handler"] = "kong/plugins/loggly/handler.lua",
["kong.plugins.loggly.log"] = "kong/plugins/loggly/log.lua",
["kong.plugins.loggly.schema"] = "kong/plugins/loggly/schema.lua"
},
install = {
conf = { "kong.yml" },
Expand Down
211 changes: 145 additions & 66 deletions kong.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,144 @@
## Available plugins on this server
plugins_available:
- ssl
- jwt
- acl
- cors
- oauth2
- tcp-log
- udp-log
- file-log
- http-log
- key-auth
- hmac-auth
- basic-auth
- ip-restriction
- mashape-analytics
- request-transformer
- response-transformer
- request-size-limiting
- rate-limiting
- response-ratelimiting

## The Kong working directory
## (Make sure you have read and write permissions)
nginx_working_dir: /usr/local/kong/

## Port configuration
proxy_port: 8000
proxy_ssl_port: 8443
admin_api_port: 8001

## Secondary port configuration
dnsmasq_port: 8053

## Specify the DAO to use
database: cassandra

## Databases configuration
databases_available:
cassandra:
properties:
contact_points:
- "localhost:9042"
timeout: 1000
keyspace: kong
keepalive: 60000 # in milliseconds
# ssl: false
# ssl_verify: false
# ssl_certificate: "/path/to/cluster-ca-certificate.pem"
# user: cassandra
# password: cassandra

## Cassandra cache configuration
database_cache_expiration: 5 # in seconds

## SSL Settings
## (Uncomment the two properties below to set your own certificate)
######
## Kong configuration file. All commented values are default values.
## Uncomment and update a value to configure Kong to your needs.
##
## Lines starting with `##` are comments.
## Lines starting with `#` are properties that can be updated.
## Beware of YAML formatting for nested properties.

######
## Plugins that this node needs to execute.
## By default, Kong will try to execute all installed plugins on every request.
## If you are sure to only use a few plugins, uncomment and update this property to contain
## only those.
## Custom plugins also need to be added to this list.
# plugins_available:
# - ssl
# - jwt
# - ...

######
## The Kong working directory. Equivalent to nginx's prefix path.
## This is where this running nginx instance will keep server files including logs.
## Make sure it has the appropriate permissions.
# nginx_working_dir: /usr/local/kong/

######
## Port which Kong proxies HTTP requests through, consumers will make requests against this port
## so make sure it is publicly available.
# proxy_port: 8000

######
## Same as proxy_port, but for HTTPS requests.
# proxy_ssl_port: 8443

######
## Specify how Kong performs DNS resolution (in the `dns_resolvers_available` property) you want to use.
## Options are: "dnsmasq" (You will need dnsmasq to be installed) or "server".
# dns_resolver: dnsmasq

######
## DNS resolvers configuration. Specify a DNS server or the port on which you want
## dnsmasq to run.
# dns_resolvers_available:
# server:
# address: "8.8.8.8:53"
# dnsmasq:
# port: 8053

######
## Port on which the admin API will listen to. The admin API is a private API which lets you
## manage your Kong infrastructure. It needs to be secured appropriatly.
# admin_api_port: 8001

######
## Specify which database to use from the databases_available property.
# database: cassandra

######
## Databases configuration.
# databases_available:
# cassandra:
######
## Contact points to your Cassandra cluster.
# contact_points:
# - "localhost:9042"

# timeout: 1000

# keyspace: kong

######
## Time (in milliseconds) for which sockets will be keep alive.
## for being eventually re-used before being closed.
# keepalive: 60000

######
## Keyspace options. Set those before running Kong or any migration.
## Those settings will be used to create a keyspace with the desired options
## when first running the migrations.
## See http://docs.datastax.com/en/cql/3.1/cql/cql_reference/create_keyspace_r.html

######
## The name of the replica placement strategy class for the new keyspace.
## Can be "SimpleStrategy" or "NetworkTopologyStrategy".
# replication_strategy: SimpleStrategy

######
## For SimpleStrategy only.
## The number of replicas of data on multiple nodes.
# replication_factor: 1

######
## For NetworkTopologyStrategy only.
## The number of replicas of data on multiple nodes in each data center.
# data_centers:
# dc1: 2
# dc2: 3

######
## If true, will enable client-to-node encryption.
# ssl: false

######
## If true, will verify the SSL certificate in use.
## `ssl_certificate` must be provided.
# ssl_verify: false

######
## **Absolute path** to the certificate authority file for your cluster.
# ssl_certificate: "/path/to/cluster-ca-certificate.pem"

######
## If the cluster as authentication enabled, provide a user and a password here.
# user: cassandra
# password: cassandra

######
## Time (in seconds) for which entities from the database (APIs, plugins configurations...)
## are cached by Kong. Increase this value if you want to lower the number of requests made
## to your database.
# database_cache_expiration: 5

######
## SSL certificates to use.
# ssl_cert_path: /path/to/certificate.pem
# ssl_key_path: /path/to/certificate.key

## Sends anonymous error reports
send_anonymous_reports: true
######
## Sending anonymous error reports helps Kong developers to understand how it performs.
# send_anonymous_reports: true

## In-memory cache size (MB)
memory_cache_size: 128
######
## Size (in MB) of the Lua cache. This value may not be smaller than 32MB.
# memory_cache_size: 128

## Nginx configuration
######
## The nginx configuration file which allows Kong to run.
## The placeholders will be computed and this property will be written as a file
## by Kong at `<nginx_working_dir>/nginx.conf` during startup.
## This file can tweaked to some extent, but many directives are necessary for Kong to work.
## /!\ BE CAREFUL
nginx: |
worker_processes auto;
error_log logs/error.log error;
Expand Down Expand Up @@ -151,18 +225,19 @@ nginx: |
default_type 'text/plain';

# These properties will be used later by proxy_pass
set $backend_host nil;
set $backend_url nil;
set $upstream_host nil;
set $upstream_url nil;

# Authenticate the user and load the API info
access_by_lua 'kong.exec_plugins_access()';

# Proxy the request
# Proxy the request
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $backend_host;
proxy_pass $backend_url;
proxy_set_header Host $upstream_host;
proxy_pass $upstream_url;
proxy_pass_header Server;

# Add additional response headers
Expand Down Expand Up @@ -192,6 +267,9 @@ nginx: |
server {
listen {{admin_api_port}};

client_max_body_size 10m;
client_body_buffer_size 10m;

location / {
default_type application/json;
content_by_lua '
Expand All @@ -208,6 +286,7 @@ nginx: |

location /nginx_status {
internal;
access_log off;
stub_status;
}

Expand Down
Loading