Skip to content

Aws kinesis credentials should pass aws_credentials to KinesisService #5

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

Merged
merged 6 commits into from
Apr 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 6 additions & 14 deletions src/lua/api-gateway/logger/backend/AwsKinesisLogger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,16 @@ function _M:constructor(o)
self.aws_access_key = o.aws_access_key
self.aws_iam_user = o.aws_iam_user

local iam_user = o.aws_iam_user

local kinesisServiceConfig = {
aws_region = o.aws_region,
aws_secret_key = o.aws_secret_key,
aws_access_key = o.aws_access_key,
aws_debug = true, -- print warn level messages on the nginx logs
aws_conn_keepalive = 60000, -- how long to keep the sockets used for AWS alive
aws_conn_pool = 100 -- the connection pool size for sockets used to connect to AWS
aws_credentials = o.aws_credentials, -- credentials provider
aws_secret_key = o.aws_secret_key, -- deprecated but kept for backwards compatibility
aws_access_key = o.aws_access_key, -- deprecated but kept for backwards compatibility
aws_debug = o.aws_debug, -- print warn level messages on the nginx logs
aws_conn_keepalive = o.aws_conn_keepalive, -- how long to keep the sockets used for AWS alive
aws_conn_pool = o.aws_conn_pool -- the connection pool size for sockets used to connect to AWS
}

if (iam_user ~= nil) then
kinesisServiceConfig.aws_iam_user = iam_user.iam_user
kinesisServiceConfig.security_credentials_host = iam_user.security_credentials_host
kinesisServiceConfig.security_credentials_port = iam_user.security_credentials_port
kinesisServiceConfig.shared_cache_dict = iam_user.shared_cache_dict
end

kinesisService = KinesisService:new(kinesisServiceConfig)
end

Expand Down
3 changes: 2 additions & 1 deletion test/perl/aws_kinesis_logger.t
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ __DATA__
backend_opts = {
aws_region = ngx.var.aws_region,
kinesis_stream_name = ngx.var.kinesis_stream_name,
aws_iam_user = {
aws_credentials = {
provider = "api-gateway.aws.AWSIAMCredentials",
security_credentials_host = "127.0.0.1", -- test only
security_credentials_port = $TEST_NGINX_PORT, -- test only
security_credentials_timeout = 60 * 60 * 24,
Expand Down