Skip to content

Allow eventbridge to use queryStringParam and pathParam for Detail #88

Open
@c4e

Description

@c4e

Thank you!

Some webhooks services like MangoPay use GET requests with query params with ids for security reasons.

Would be useful to allow the queryStringParam/pathParam to be use in - eventbridge: detail:

Something like this:

  // compileMethodsToEventBridge.js
  getEventBridgeDetail(http) {
    if (!_.has(http, 'detail')) {
      return '$util.escapeJavaScript($input.body)'
    }

    if (http.detail.pathParam) {
      return `{"${http.detail.pathParam}": "$input.params().path.${http.detail.pathParam}"}`.replace(/\"/g, "\\\"")
    }

    if (http.detail.queryStringParam) {
      return `{"${http.detail.queryStringParam}": "$input.params().querystring.${http.detail.queryStringParam}"}`.replace(/\"/g, "\\\"")
    }

    if (http.detail.bodyParam) {
      return `$util.escapeJavaScript($util.parseJson($input.body).${http.detail.bodyParam})`
    }

    return '$util.escapeJavaScript($input.body)'
  },

Regards!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions