diff --git a/kong.yml b/kong.yml index bb450199e52a..41809bbf4110 100644 --- a/kong.yml +++ b/kong.yml @@ -59,7 +59,7 @@ ###### ## A dictionary of DNS resolvers Kong can use, and their respective properties. ## Currently `dnsmasq` (default, http://www.thekelleys.org.uk/dnsmasq/doc.html) and `server` are supported. -## By choosing `dnsmasq`, Kong will resolve hostnames using the local `/etc/hosts` file and `resolv.conf` +## By choosing `dnsmasq`, Kong will resolve hostnames using the local `/etc/hosts` file and `resolv.conf` ## configuration. By choosing `server`, you can specify a custom DNS server. # dns_resolvers_available: # server: @@ -68,7 +68,7 @@ # port: 8053 ###### -## Cluster settings between Kong nodes. +## Cluster settings between Kong nodes. ## For more information take a look at the Clustering Reference: https://getkong.org/docs/latest/clustering/ # cluster: @@ -77,8 +77,8 @@ ## TCP messages. All the nodes in the cluster must be able to communicate with this node on this address. ## Only IPv4 addresses are allowed (no hostnames). ## The advertise flag is used to change the address that we advertise to other nodes in the - ## cluster. By default, the cluster_listen address is advertised. However, in some cases - ## (specifically NAT traversal), there may be a routable address that cannot be bound to. + ## cluster. By default, the cluster_listen address is advertised. However, in some cases + ## (specifically NAT traversal), there may be a routable address that cannot be bound to. ## This flag enables gossiping a different address to support this. # advertise: "" @@ -136,18 +136,18 @@ ###### ## Cluster authentication options. Provide a user and a password here if your cluster uses the ## PasswordAuthenticator scheme. - # user: cassandra + # username: cassandra # password: cassandra ###### -## Kong will send anonymous reports to Mashape. This helps Mashape fixing bugs/errors and improving Kong. +## Kong will send anonymous reports to Mashape. This helps Mashape fixing bugs/errors and improving Kong. ## By default is `true`. # send_anonymous_reports: true ###### -## A value specifying (in MB) the size of the internal preallocated in-memory cache. Kong uses an in-memory -## cache to store database entities in order to optimize access to the underlying datastore. The cache size -## needs to be as big as the size of the entities being used by Kong at any given time. The default value +## A value specifying (in MB) the size of the internal preallocated in-memory cache. Kong uses an in-memory +## cache to store database entities in order to optimize access to the underlying datastore. The cache size +## needs to be as big as the size of the entities being used by Kong at any given time. The default value ## is `128`, and the potential maximum value is the total size of the datastore. ## This value may not be smaller than 32MB. # memory_cache_size: 128 @@ -314,4 +314,4 @@ nginx: | return 200 'User-agent: *\nDisallow: /'; } } - } \ No newline at end of file + } diff --git a/kong/cli/services/nginx.lua b/kong/cli/services/nginx.lua index 941672460dcd..0e4c6e2752db 100644 --- a/kong/cli/services/nginx.lua +++ b/kong/cli/services/nginx.lua @@ -72,7 +72,7 @@ local function prepare_nginx_configuration(configuration, ssl_config) ssl_cert = ssl_config.ssl_cert_path, ssl_key = ssl_config.ssl_key_path, lua_ssl_trusted_certificate = ssl_config.trusted_ssl_cert_path and - 'lua_ssl_trusted_certificate "'..configuration.dao_config.ssl.certificate_authority..'";' + 'lua_ssl_trusted_certificate "'..configuration.dao_config.ssl.certificate_authority..'";' or "" } -- Auto-tune diff --git a/spec/unit/dao/cassandra/factory_spec.lua b/spec/unit/dao/cassandra/factory_spec.lua index 676fd27795ff..17ff5da98538 100644 --- a/spec/unit/dao/cassandra/factory_spec.lua +++ b/spec/unit/dao/cassandra/factory_spec.lua @@ -1,4 +1,5 @@ local Factory = require "kong.dao.cassandra.factory" +local utils = require "kong.tools.utils" local spec_helpers = require "spec.spec_helpers" local env = spec_helpers.get_env() local default_dao_properties = env.configuration.cassandra @@ -7,7 +8,8 @@ describe("Cassadra factory", function() describe("get_session_options()", function() local dao_properties before_each(function() - dao_properties = default_dao_properties + -- TODO switch to new default config getter and shallow copy in feature/postgres + dao_properties = utils.deep_copy(default_dao_properties) end) it("should reflect the default config", function() local factory = Factory(dao_properties) @@ -50,9 +52,32 @@ describe("Cassadra factory", function() } }, options) end) + it("should accept authentication properties", function() + dao_properties.username = "cassie" + dao_properties.password = "cassiepwd" + + local factory = Factory(dao_properties) + assert.truthy(factory) + local options = factory:get_session_options() + assert.truthy(options) + assert.same({ + shm = "cassandra", + prepared_shm = "cassandra_prepared", + contact_points = {"127.0.0.1:9042"}, + keyspace = "kong_tests", + query_options = { + prepare = true + }, + ssl_options = { + enabled = false, + verify = false + }, + username = "cassie", + password = "cassiepwd" + }, options) + end) it("should accept SSL properties", function() dao_properties.contact_points = {"127.0.0.1:9042"} - dao_properties.keyspace = "my_keyspace" dao_properties.ssl.enabled = false dao_properties.ssl.verify = true @@ -64,7 +89,7 @@ describe("Cassadra factory", function() shm = "cassandra", prepared_shm = "cassandra_prepared", contact_points = {"127.0.0.1:9042"}, - keyspace = "my_keyspace", + keyspace = "kong_tests", query_options = { prepare = true }, @@ -84,7 +109,7 @@ describe("Cassadra factory", function() shm = "cassandra", prepared_shm = "cassandra_prepared", contact_points = {"127.0.0.1:9042"}, - keyspace = "my_keyspace", + keyspace = "kong_tests", query_options = { prepare = true },