Coder Social home page Coder Social logo

kong-plugin-s3's Introduction

Kong Plugin S3

summary: Get AWS S3 Objects with AWS V4 signed request

Plugin Priority

Priority: 750

Plugin Version

Version: 0.4.0

Config

* This field is referenceable, which means it can be securely stored as a secret in a vault. References must follow a specific format.

name type required validations default
aws_key* string
false
aws_secret* string
false
aws_assume_role_arn* string
false
aws_web_identity_credential boolean
false
true
aws_web_identity_token_file string
false
aws_web_identity_role_arn string
false
aws_role_session_name string
false
kong
aws_region string
false
aws_imds_protocol_version string
true
- one_of:
- v1
- v2
v1
bucket_name string
true
rewrites map[string][string]
false
/: /index.html
host string
false
port integer
false
- between:
- 0
- 65535
443
clear_query_string boolean
true
false

Usage

plugins:
  - name: s3
    enabled: true
    config:
      aws_key: ''
      aws_secret: ''
      aws_assume_role_arn: ''
      aws_web_identity_credential: true
      aws_web_identity_token_file: ''
      aws_web_identity_role_arn: ''
      aws_role_session_name: kong
      aws_region: ''
      aws_imds_protocol_version: v1
      bucket_name: ''
      rewrites:
        /: /index.html
      host: ''
      port: 443
      clear_query_string: false

kong-plugin-s3's People

Contributors

carnei-ro avatar

Stargazers

Jiajing LU avatar Abdalkarim Akilan avatar Sartre Brasil avatar Bryan avatar Syed Habib M avatar  avatar JinsYin avatar Joao C Costa avatar guoyibin avatar Maycon Ritzmann avatar

Watchers

Maycon Ritzmann avatar  avatar

kong-plugin-s3's Issues

License?

Hello,
I was wondering if it would be possible to add a license to this code? I would be interested in using it but would be unable to if there is no license information or if the license is unsuitable.
Thank you

S3 plugin doesn't supported by the new version of Kong

Looking at the S3 plugin code, there is a require call that looks like it could be related (although I would expect this to resolve to the plugin name "s3" rather than "aws-lambda");

https://github.com/carnei-ro/kong-plugin-s3/blob/main/kong/plugins/s3/access.lua#L2
local aws_v4 = require("kong.plugins." .. plugin_name .. ".v4")

The Kong "aws-lambda" plugin in 3.4.0.0 does refer to "kong.plugins.aws-lambda.v4" (the link below is for Kong OSS but this is the same code as for EE);

https://github.com/Kong/kong/blob/3.4.0/kong/plugins/aws-lambda/handler.lua#L3
local aws_v4 = require "kong.plugins.aws-lambda.v4"

The "aws-lambda" plugin has been refactored and no longer has this require statement. The refactor is mentioned in the Kong EE change log for 3.4.3.1
https://docs.konghq.com/gateway/changelog/#plugins-8

"AWS Lambda (aws-lambda): The AWS-Lambda plugin has been refactored by using lua-resty-aws as an underlying AWS library. The refactor simplifies the AWS-Lambda plugin code base and adds support for multiple IAM authenticating scenarios."

It looks like there is some incompatibility with the custom plugin and the refactored code using the "lua-resty-aws" library. Hopefully the above gives you some idea on why you see this error of incompatibility.

Rewrites

Hi!
I'm using this plugin for integration Kong with S3.

What is the right way to write Rewrites configuration? I need to add some prefix /path0/ before target path /path1/path2
I tried to rewrite /path1/path2 to /path0/path1/path2 and it's now working.

I tried different ways:

  • { "/path1/path2": "/path0/path1/path2" };
  • { "from": "/path1/path2", "to": "/path0/path1/path2" }
    Nothing works. Path doesn't change. Requests to upstream S3 are going by /path1/path2

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.