Skip to content
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
6 changes: 4 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.11",
"image": "mcr.microsoft.com/devcontainers/python:3.14",
"features": {
// "ghcr.io/devcontainers/features/aws-cli:1": {},
// "ghcr.io/devcontainers/features/azure-cli:1": {},
// "ghcr.io/devcontainers/features/docker-in-docker:2.16.1": {}
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": false
}
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Install Python 3
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: 3.14
- uses: Gr1N/setup-poetry@v8
- uses: Gr1N/setup-poetry@v9
- name: Install dependencies
run: |
sudo apt-get install tar
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME
- name: Log into registry
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'

- uses: Gr1N/setup-poetry@v8
- uses: Gr1N/setup-poetry@v9
- name: Install dependencies
run: |
poetry config virtualenvs.create false
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Trigger workflow in dotextensions-build
uses: actions/github-script@v7
uses: actions/github-script@v8
continue-on-error: true
with:
script: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update-badssl-certs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:

- name: Set up Python 3.11
if: steps.check-expiry.outputs.needs_update == 'true'
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'

Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:

- name: Create Pull Request
if: steps.check-expiry.outputs.needs_update == 'true'
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: |
Expand Down
185 changes: 87 additions & 98 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ requests-pkcs12 = "1.27"
parsys-requests-unixsocket = "0.3.2"
requests-aws4auth = "1.3.2"
requests-ntlm = "1.3.0"
restrictedpython = "8.1"
restrictedpython = "8.2"
faker = "40.21.0"
requests-hawk = "1.2.1"
msal = "1.34.0"
msal = "1.37.0"
pyyaml = "6.0.3"
toml = "0.10.2"
requests = "2.33.0"
cryptography = "46.0.7"
requests = "2.34.2"
cryptography = "48.0.1"
urllib3 = "2.7.0"
idna = "3.15"
idna = "3.18"
xmltodict = "^1.0.2"

[tool.poetry.group.dev.dependencies]
Expand All @@ -47,7 +47,7 @@ flask = "3.1.3"
python-magic = "^0.4.27"
flask-cors = "^6.0.1"
pytest = "9.0.3"
pytest-html = "^4.1.1"
pytest-html = "^4.2.0"
pytest-xdist = "^3.6.1"
gunicorn = "^23.0.0"
httpbin = "^0.10.2"
Expand Down
2 changes: 1 addition & 1 deletion test/core/payload/dataasformpayload.http
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
POST "https://dothttp.azurewebsites.net"
POST "https://github.com"
data({"hi":"prasanth"})
2 changes: 1 addition & 1 deletion test/core/payload/filepayload.http
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
POST "https://dothttp.azurewebsites.net"
POST "https://github.com"
fileinput("{{filename}}")
2 changes: 1 addition & 1 deletion test/core/payload/filepayload2.http
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
POST "https://dothttp.azurewebsites.net"
POST "https://github.com"
< "{{filename}}"
2 changes: 1 addition & 1 deletion test/core/payload/jsonpayload.http
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
POST 'https://dothttp.azurewebsites.net'
POST 'https://github.com'
json({"string": "simple"})
2 changes: 1 addition & 1 deletion test/core/payload/jsonpayload2.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
POST 'https://dothttp.azurewebsites.net'
POST 'https://github.com'
json({
"string": "simple",
"list": ["dothttp", "azure"],
Expand Down
2 changes: 1 addition & 1 deletion test/core/payload/jsonpayload3.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
POST "https://dothttp.azurewebsites.net"
POST "https://github.com"
json({"menu": {
"header": "SVG Viewer",
"ite""ms": [
Expand Down
2 changes: 1 addition & 1 deletion test/core/payload/jsonpayload4.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
POST "https://dothttp.azurewebsites.net"
POST "https://github.com"
json({
"glossary": {
"title": "example glossary",
Expand Down
2 changes: 1 addition & 1 deletion test/core/payload/multipartfiles.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
POST "https://dothttp.azurewebsites.net"
POST "https://github.com"
files(
("resume", "{{filename}}"),
("content2", "{{data}}")
Expand Down
4 changes: 2 additions & 2 deletions test/core/payload/payload.http
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
POST 'https://dothttp.azurewebsites.net'
POST 'https://github.com'
data('{}')



POST 'https://dothttp.azurewebsites.net'
POST 'https://github.com'
data('😻')
2 changes: 1 addition & 1 deletion test/core/payload/payload2.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
POST 'https://dothttp.azurewebsites.net?key3=value3'
POST 'https://github.com?key3=value3'
? 'key1', 'value1'
? 'key2', 'value2'
data('{this is bad}')
2 changes: 1 addition & 1 deletion test/core/payload/payload3.http
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
POST 'https://dothttp.azurewebsites.net'
POST 'https://github.com'
json({})
2 changes: 1 addition & 1 deletion test/core/requests/defaultget.http
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GET "https://dothttp.azurewebsites.net"
GET "https://github.com"
"headerkey": "headervalue"
2 changes: 1 addition & 1 deletion test/core/requests/fail.http
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
POST https://dothttp.azurewebsites.net
POST https://github.com
? ranga prasanth // query didn't had ','
ranga : prasanth // correct header
2 changes: 1 addition & 1 deletion test/core/requests/fail2.http
Original file line number Diff line number Diff line change
@@ -1 +1 @@
PATCH2 'https://dothttp.azurewebsites.net'
PATCH2 'https://github.com'
2 changes: 1 addition & 1 deletion test/core/requests/non200.http
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GET "http://localhost:8000/redirect-to"
? 'url', "https://dothttp.azurewebsites.net"
? 'url', "https://github.com"
2 changes: 1 addition & 1 deletion test/core/requests/pass.http
Original file line number Diff line number Diff line change
@@ -1 +1 @@
GET 'https://dothttp.azurewebsites.net'
GET 'https://github.com'
2 changes: 1 addition & 1 deletion test/core/requests/pass2.http
Original file line number Diff line number Diff line change
@@ -1 +1 @@
POST 'https://dothttp.azurewebsites.net'
POST 'https://github.com'
2 changes: 1 addition & 1 deletion test/core/requests/query.http
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
GET 'https://dothttp.azurewebsites.net?key3=value3'
GET 'https://github.com?key3=value3'
? 'key1', 'value1'
? 'key2', 'value2'
2 changes: 1 addition & 1 deletion test/core/requests/redirect.http
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GET "http://endeavour.today/"
GET "https://github.com/"

2 changes: 1 addition & 1 deletion test/core/substitution/.dothttp.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"*": {
"host": "dothttp.azurewebsites.net",
"host": "github.com",
"queryname": "key1",
"valuename": "value2"
},
Expand Down
2 changes: 1 addition & 1 deletion test/core/substitution/prop1.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"*": {
"host": "dothttp.azurewebsites.net",
"host": "github.com",
"queryname": "key1",
"valuename": "value2"
},
Expand Down
2 changes: 1 addition & 1 deletion test/core/substitution/prop2.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"*": {
"host": "dothttp.azurewebsites.net",
"host": "github.com",
"queryname": "key1",
"valuename": "value2"
},
Expand Down
16 changes: 8 additions & 8 deletions test/core/test_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ class PayLoadTest(TestBase):
def test_json_payload(self):
req = self.get_request(f"{base_dir}/jsonpayload.http")
self.assertEqual(
"https://dothttp.azurewebsites.net/", req.url, "incorrect url computed"
"https://github.com/", req.url, "incorrect url computed"
)
self.assertEqual("POST", req.method, "incorrect method")
self.assertEqual(b'{"string": "simple"}', req.body, "incorrect method")

def test_json_payload2(self):
req = self.get_request(f"{base_dir}/jsonpayload2.http")
self.assertEqual(
"https://dothttp.azurewebsites.net/", req.url, "incorrect url computed"
"https://github.com/", req.url, "incorrect url computed"
)
self.assertEqual("POST", req.method, "incorrect method")
self.assertEqual(
Expand All @@ -47,7 +47,7 @@ def test_json_payload2(self):
def test_json_payload3(self):
req = self.get_request(f"{base_dir}/jsonpayload3.http")
self.assertEqual(
"https://dothttp.azurewebsites.net/", req.url, "incorrect url computed"
"https://github.com/", req.url, "incorrect url computed"
)
self.assertEqual("POST", req.method, "incorrect method")
self.assertEqual(
Expand Down Expand Up @@ -99,7 +99,7 @@ def test_root_array(self):
def test_json_payload_complex(self):
req = self.get_request(f"{base_dir}/jsonpayload4.http")
self.assertEqual(
"https://dothttp.azurewebsites.net/", req.url, "incorrect url computed"
"https://github.com/", req.url, "incorrect url computed"
)
self.assertEqual("POST", req.method, "incorrect method")
self.assertEqual(
Expand Down Expand Up @@ -133,7 +133,7 @@ def test_json_payload_complex(self):
def test_payload(self):
req = self.get_request(f"{base_dir}/payload.http")
self.assertEqual(
"https://dothttp.azurewebsites.net/", req.url, "incorrect url computed"
"https://github.com/", req.url, "incorrect url computed"
)
self.assertEqual("POST", req.method, "incorrect method")
self.assertEqual("{}", req.body, "incorrect body")
Expand All @@ -142,7 +142,7 @@ def test_smileys_or_special(self):
comp = self.get_req_comp(f"{base_dir}/payload.http", target=2)
req = comp.get_request()
self.assertEqual(
"https://dothttp.azurewebsites.net/", req.url, "incorrect url computed"
"https://github.com/", req.url, "incorrect url computed"
)
self.assertEqual("POST", req.method, "incorrect method")
self.assertEqual("😻", req.body, "incorrect method")
Expand All @@ -152,7 +152,7 @@ def test_smileys_or_special(self):
def test_payload2(self):
req = self.get_request(f"{base_dir}/payload2.http")
self.assertEqual(
"https://dothttp.azurewebsites.net/?key3=value3&key1=value1&key2=value2",
"https://github.com/?key3=value3&key1=value1&key2=value2",
req.url,
"incorrect url computed",
)
Expand All @@ -162,7 +162,7 @@ def test_payload2(self):
def test_payload3(self):
req = self.get_request(f"{base_dir}/payload3.http")
self.assertEqual(
"https://dothttp.azurewebsites.net/", req.url, "incorrect url computed"
"https://github.com/", req.url, "incorrect url computed"
)
self.assertEqual("POST", req.method, "incorrect method")
self.assertEqual(b"{}", req.body, "incorrect method")
Expand Down
14 changes: 7 additions & 7 deletions test/core/test_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
class RequestTest(TestBase):
def test_get(self):
req = self.get_request(f"{base_dir}/pass.http")
self.assertEqual("https://dothttp.azurewebsites.net/", req.url, "incorrect url")
self.assertEqual("https://github.com/", req.url, "incorrect url")
self.assertEqual("GET", req.method, "incorrect url")

def test_post(self):
req = self.get_request(f"{base_dir}/pass2.http")
self.assertEqual("https://dothttp.azurewebsites.net/", req.url, "incorrect url")
self.assertEqual("https://github.com/", req.url, "incorrect url")
self.assertEqual("POST", req.method, "incorrect url")

def test_query(self):
req = self.get_request(f"{base_dir}/query.http")
self.assertEqual(
"https://dothttp.azurewebsites.net/?key3=value3&key1=value1&key2=value2",
"https://github.com/?key3=value3&key1=value1&key2=value2",
req.url,
"incorrect url computed",
)
Expand Down Expand Up @@ -85,7 +85,7 @@ def test_curl_print(self):
)
output = req.get_curl_output()
self.assertEqual(
"""curl -X GET --url http://endeavour.today/ \\
"""curl -X GET --url https://github.com/ \\
""",
output,
)
Expand All @@ -94,7 +94,7 @@ def test_format_print(self):
req = self.get_req_comp(f"{base_dir}/redirect.http", format=True, stdout=True)
req.load()
output = req.format(req.model)
self.assertEqual('GET "http://endeavour.today/"\n\n\n', output)
self.assertEqual('GET "https://github.com/"\n\n\n', output)
print(output)

def test_format2_print(self):
Expand All @@ -118,7 +118,7 @@ def test_format2_print(self):
def test_curl_query(self):
req = self.get_req_comp(f"{sub_dir}/query.http", stdout=True, curl=True)
self.assertEqual(
"""curl -X POST --url https://dothttp.azurewebsites.net/ram?key1=value1&key2=value2 \\
"""curl -X POST --url https://github.com/ram?key1=value1&key2=value2 \\
-H 'content-type: application/json' \\
-d '{
"key1": "value2"
Expand All @@ -129,7 +129,7 @@ def test_curl_query(self):
def test_curl_query2(self):
req = self.get_req_comp(f"{base_dir}/query.http", stdout=True, curl=True)
self.assertEqual(
"""curl -X GET --url https://dothttp.azurewebsites.net/?key3=value3&key1=value1&key2=value2 \\
"""curl -X GET --url https://github.com/?key3=value3&key1=value1&key2=value2 \\
""",
req.get_curl_output(),
)
Expand Down
Loading
Loading