Skip to content

Commit

Permalink
added optional X-My-X-Amzn-Trace-Id header
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-pmillz committed May 12, 2023
1 parent cdfae13 commit 62f312a
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 7 deletions.
80 changes: 80 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG-REPORT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: "🐛 Bug Report"
description: Create a new ticket for a bug.
title: "🐛 [BUG] - <title>"
labels: [
"bug"
]
body:
- type: textarea
id: description
attributes:
label: "Description"
description: Please enter an explicit description of your issue
placeholder: Short and explicit description of your incident...
validations:
required: true
- type: input
id: reprod-url
attributes:
label: "Reproduction URL"
description: Please enter your GitHub URL to provide a reproduction of the issue
placeholder: ex. https://github.com/USERNAME/REPO-NAME
validations:
required: true
- type: textarea
id: reprod
attributes:
label: "Reproduction steps"
description: Please enter an explicit description of your issue
value: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
render: bash
validations:
required: true
- type: textarea
id: screenshot
attributes:
label: "Screenshots"
description: If applicable, add screenshots to help explain your problem.
value: |
![DESCRIPTION](LINK.png)
render: bash
validations:
required: false
- type: textarea
id: logs
attributes:
label: "Logs"
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: bash
validations:
required: false
- type: dropdown
id: browsers
attributes:
label: "Browsers"
description: What browsers are you seeing the problem on ?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- Opera
validations:
required: false
- type: dropdown
id: os
attributes:
label: "OS"
description: What is the impacted environment ?
multiple: true
options:
- Windows
- Linux
- Mac
validations:
required: false
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: "\U0001F680 Feature request"
about: Suggest an idea for this project

---

<!--
Thank you for suggesting an idea to make GoFireProx.

Please fill in as much of the template below as you're able.
-->

**Is your feature request related to a problem? Please describe.**
Please describe the problem you are trying to solve.

**Describe the solution you'd like**
Please describe the desired behavior.

**Describe alternatives you've considered**
Please describe alternative solutions or features you have considered.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
21 changes: 21 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->

## Related Issue
<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Please link to the issue here: -->

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):
13 changes: 13 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Security Policy

## Supported Versions

| Version | Supported |
| -------- | ------------------ |
| > 0.1.0 | :white_check_mark: |
| < 0.0.9 | :x: |


## Reporting a Vulnerability

Create an issue of template type BUG-REPORT to report a vulnerability.
28 changes: 21 additions & 7 deletions gofireprox.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type FireProxOptions struct {
URL string
}

// List of all AWS regions as of 2023-05-10
// List of all AWS regions as of 2023-05-10 except governmental regions.
var validRegions = []string{
"us-east-1", "us-east-2", "us-west-1", "us-west-2", "af-south-1",
"ap-east-1", "ap-south-1", "ap-south-2", "ap-southeast-1", "ap-southeast-2",
Expand Down Expand Up @@ -116,7 +116,7 @@ func (fp *FireProx) Cleanup() {
}
_, err = fp.Client.DeleteRestApi(context.TODO(), input)
if err != nil {
log.Println("[ERROR] Failed to delete API:", item.Id)
log.Println("[ERROR] Failed to delete API:", aws.ToString(item.Id))
}
}
fmt.Println()
Expand Down Expand Up @@ -205,7 +205,13 @@ func (fp *FireProx) getTemplate(tmplInfo *templateInfo) (*apigateway.ImportRestA
"in": "header",
"required": false,
"type": "string"
}
},
{
"name" : "X-My-X-Amzn-Trace-Id",
"in" : "header",
"required" : false,
"type" : "string"
}
],
"responses": {},
"x-amazon-apigateway-integration": {
Expand All @@ -217,7 +223,8 @@ func (fp *FireProx) getTemplate(tmplInfo *templateInfo) (*apigateway.ImportRestA
},
"requestParameters": {
"integration.request.path.proxy": "method.request.path.proxy",
"integration.request.header.X-Forwarded-For": "method.request.header.X-My-X-Forwarded-For"
"integration.request.header.X-Forwarded-For": "method.request.header.X-My-X-Forwarded-For",
"integration.request.header.X-Amzn-Trace-Id" : "method.request.header.X-My-X-Amzn-Trace-Id"
},
"passthroughBehavior": "when_no_match",
"httpMethod": "ANY",
Expand Down Expand Up @@ -246,7 +253,13 @@ func (fp *FireProx) getTemplate(tmplInfo *templateInfo) (*apigateway.ImportRestA
"in": "header",
"required": false,
"type": "string"
}
},
{
"name" : "X-My-X-Amzn-Trace-Id",
"in" : "header",
"required" : false,
"type" : "string"
}
],
"responses": {},
"x-amazon-apigateway-integration": {
Expand All @@ -258,7 +271,8 @@ func (fp *FireProx) getTemplate(tmplInfo *templateInfo) (*apigateway.ImportRestA
},
"requestParameters": {
"integration.request.path.proxy": "method.request.path.proxy",
"integration.request.header.X-Forwarded-For": "method.request.header.X-My-X-Forwarded-For"
"integration.request.header.X-Forwarded-For": "method.request.header.X-My-X-Forwarded-For",
"integration.request.header.X-Amzn-Trace-Id": "method.request.header.X-My-X-Amzn-Trace-Id"
},
"passthroughBehavior": "when_no_match",
"httpMethod": "ANY",
Expand Down Expand Up @@ -341,7 +355,7 @@ func (fp *FireProx) DeleteAPI(apiID string) bool {
}
_, err = fp.Client.DeleteRestApi(context.TODO(), input)
if err != nil {
log.Println("[ERROR] Failed to delete API:", item.Id)
log.Println("[ERROR] Failed to delete API:", aws.ToString(item.Id))
}
return true
}
Expand Down

0 comments on commit 62f312a

Please sign in to comment.