Skip to content

Commit

Permalink
v2.4.0rc4 (#894)
Browse files Browse the repository at this point in the history
* Merge pull request #840 from abhinavsingh/release-schedule-notes

Add release schedule under FAQ

* Green CI (#841)

* Cleanup parser & url classes (#843)

* Optimize parser logic

* Add `is_complete` property

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* pre commit fixes

* We need `ValueError`

* wuff

* useless

* flake8

* Simplify url

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* pip prod(deps): bump twine from 3.6.0 to 3.7.0 (#845)

Bumps [twine](https://github.com/pypa/twine) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/pypa/twine/releases)
- [Changelog](https://github.com/pypa/twine/blob/main/docs/changelog.rst)
- [Commits](pypa/twine@3.6.0...3.7.0)

---
updated-dependencies:
- dependency-name: twine
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* npm: bump jasmine from 3.6.3 to 3.10.0 in /dashboard (#844)

Bumps [jasmine](https://github.com/jasmine/jasmine-npm) from 3.6.3 to 3.10.0.
- [Release notes](https://github.com/jasmine/jasmine-npm/releases)
- [Commits](jasmine/jasmine-npm@v3.6.3...v3.10.0)

---
updated-dependencies:
- dependency-name: jasmine
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>

* npm: bump chrome-devtools-frontend in /dashboard (#846)

Bumps [chrome-devtools-frontend](https://github.com/ChromeDevTools/devtools-frontend) from 1.0.944903 to 1.0.947377.
- [Release notes](https://github.com/ChromeDevTools/devtools-frontend/releases)
- [Changelog](https://github.com/ChromeDevTools/devtools-frontend/blob/main/docs/release_management.md)
- [Commits](https://github.com/ChromeDevTools/devtools-frontend/commits)

---
updated-dependencies:
- dependency-name: chrome-devtools-frontend
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* pip prod(deps): bump coverage from 6.1.2 to 6.2 (#847)

Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.1.2 to 6.2.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](nedbat/coveragepy@6.1.2...6.2)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>

* Fix GHA check-gate to properly identify failures (#849)

* pip prod(deps): bump pylint from 2.12.1 to 2.12.2 (#851)

Bumps [pylint](https://github.com/PyCQA/pylint) from 2.12.1 to 2.12.2.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](pylint-dev/pylint@v2.12.1...v2.12.2)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* npm: bump @types/js-cookie from 2.2.6 to 3.0.1 in /dashboard (#850)

Bumps [@types/js-cookie](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/js-cookie) from 2.2.6 to 3.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/js-cookie)

---
updated-dependencies:
- dependency-name: "@types/js-cookie"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>

* pip prod(deps): bump sphinx from 4.3.0 to 4.3.1 (#853)

Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/4.x/CHANGES)
- [Commits](sphinx-doc/sphinx@v4.3.0...v4.3.1)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* pip prod(deps): bump paramiko from 2.8.0 to 2.8.1 (#855)

* npm: bump ws from 7.4.6 to 8.3.0 in /dashboard (#854)

* pip prod(deps): bump uvicorn from 0.15.0 to 0.16.0 (#857)

Bumps [uvicorn](https://github.com/encode/uvicorn) from 0.15.0 to 0.16.0.
- [Release notes](https://github.com/encode/uvicorn/releases)
- [Changelog](https://github.com/encode/uvicorn/blob/master/CHANGELOG.md)
- [Commits](encode/uvicorn@0.15.0...0.16.0)

---
updated-dependencies:
- dependency-name: uvicorn
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* npm: bump chrome-devtools-frontend in /dashboard (#856)

Bumps [chrome-devtools-frontend](https://github.com/ChromeDevTools/devtools-frontend) from 1.0.947377 to 1.0.949424.
- [Release notes](https://github.com/ChromeDevTools/devtools-frontend/releases)
- [Changelog](https://github.com/ChromeDevTools/devtools-frontend/blob/main/docs/release_management.md)
- [Commits](https://github.com/ChromeDevTools/devtools-frontend/commits)

---
updated-dependencies:
- dependency-name: chrome-devtools-frontend
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>

* Process `--enable-*` flags before loading plugins (#860)

* Process `--enable-*` flags before loading plugins

* Fix spelling

* Ignore RST299 and RST499

* npm: bump http-server from 0.12.3 to 14.0.0 in /dashboard (#858)

Bumps [http-server](https://github.com/http-party/http-server) from 0.12.3 to 14.0.0.
- [Release notes](https://github.com/http-party/http-server/releases)
- [Commits](http-party/http-server@v0.12.3...v14.0.0)

---
updated-dependencies:
- dependency-name: http-server
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>

* pip prod(deps): bump furo from 2021.11.15 to 2021.11.23 (#859)

Bumps [furo](https://github.com/pradyunsg/furo) from 2021.11.15 to 2021.11.23.
- [Release notes](https://github.com/pradyunsg/furo/releases)
- [Changelog](https://github.com/pradyunsg/furo/blob/main/docs/changelog.md)
- [Commits](pradyunsg/furo@2021.11.15...2021.11.23)

---
updated-dependencies:
- dependency-name: furo
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>

* Update web log context fields to match proxy log context fields (#861)

* Update web log context fields to match those with proxy log context for consistency

* Fix spell

* Fix `DEFAULT_WEB_ACCESS_LOG_FORMAT`

* pip prod(deps): bump pytest-xdist from 2.4.0 to 2.5.0 (#864)

Bumps [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) from 2.4.0 to 2.5.0.
- [Release notes](https://github.com/pytest-dev/pytest-xdist/releases)
- [Changelog](https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst)
- [Commits](pytest-dev/pytest-xdist@v2.4.0...v2.5.0)

---
updated-dependencies:
- dependency-name: pytest-xdist
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* npm: bump eslint-plugin-node from 10.0.0 to 11.1.0 in /dashboard (#863)

Bumps [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) from 10.0.0 to 11.1.0.
- [Release notes](https://github.com/mysticatea/eslint-plugin-node/releases)
- [Commits](mysticatea/eslint-plugin-node@v10.0.0...v11.1.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-node
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>

* Fix broken TLS interception  & CacheResponsesPlugin because UID is no longer a UUID (#866)

* Fix broken TLS interception because uid is now no longer a UUID

* Give enough context to work id for them to be unique within a `proxy.py` instance

* Use --port=0 by default within `proxy.TestCase`

* Attempt to fix weird buildx issue

* Add makefile targets within workflow

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Order?

* Write scm file for make

* Fetch depth

* Quote patch

* Try with sudo?

* docker/buildx#850

* Remove sudo hack

* https://github.com/docker/buildx/issues/850\#issuecomment-973270625

* Add explicit deps

* Add `requirements-testing.txt` during linting phase

* Pin buildx to v0.7.1

* Pin buildx to v0.7.0

* Revert back unnecessary change to dockerignore

* Skip container within make workflow (because GHA lacks support for docker on macOS by default)

* Repurpose make into developer workflow

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Integrate showing unreleased changelog draft (#873)

* pip prod(deps): bump types-paramiko from 2.8.2 to 2.8.4 (#868)

* npm: bump @types/jasmine from 3.6.1 to 3.10.2 in /dashboard (#867)

* pip prod(deps): bump py-spy from 0.3.10 to 0.3.11 (#875)

Bumps [py-spy](https://github.com/benfred/py-spy) from 0.3.10 to 0.3.11.
- [Release notes](https://github.com/benfred/py-spy/releases)
- [Changelog](https://github.com/benfred/py-spy/blob/master/CHANGELOG.md)
- [Commits](benfred/py-spy@v0.3.10...v0.3.11)

---
updated-dependencies:
- dependency-name: py-spy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>

* [GHA] Add container integration test & publish containers to GHCR (#818)

* Handle KBI in threadless

* Remove line-length disable clause

* Move `Set PROXYPY_CONTAINER_VERSION env` within pre-setup

* Use step output

* Use review suggestion

* Break line at less essential places

* Possibly fix?

* alignment necessary?

* :)

* Fix integration

* Add `v` prefix

* Load buildx image within docker for integration tests to work

* Run container in detached mode

* Enable web server for integration test to work

* Push to GHCR after successful tests

* Tag & Push to GHCR

* Add package permission

* Login to GHCR

* Login to GHCR

* Login to GHCR

* Explicitly use ghcr.io registry

* Add a ghcr manifest creation step which depends upon docker step

* Probably we need all images (tags) locally

* arm not amd

* Fix syntax

* Fix typo

* `Unable to find image ghcr.io/abhinavsingh/proxy.py:latest locally`

* GHCR doesnt support manifest?

* Publish multi-platform containers on GHCR (#877)

* Build containers without matrix based strategy. Helps with buildx based manifest generation

* Use buildx directly in workflows

* Add PROXYPY_PKG_PATH arg

* Add missing .

* --push from buildx

* Also add latest tag for GHCR

* Fix typo

* Explain differences between latest tag on DockerHub (stable) and GHCR (develop)

* Publish multi-platform containers to DockerHub (#878)

* Use `--local-executor` flag by default for Docker container (#880)

* Benchmark gets packaged within wheel if set as a package

* Use `--local-executor` flag by default for Docker containers

* Dockerfile update

* Fix mypy issues

* Remove conflicting dir names

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Pre-evaluate `args.threadless = is_threadless`  (#881)

* Pre-evaluate `args.threadless = is_threadless` during flag initialization

* Address some antipatterns in code

* Executor pool only started for _env_threadless_compliant

* ignore WPS450

* pip prod(deps): bump blacksheep from 1.2.1 to 1.2.2 (#885)

Bumps [blacksheep](https://github.com/Neoteroi/BlackSheep) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/Neoteroi/BlackSheep/releases)
- [Changelog](https://github.com/Neoteroi/BlackSheep/blob/main/CHANGELOG.md)
- [Commits](Neoteroi/BlackSheep@v1.2.1...v1.2.2)

---
updated-dependencies:
- dependency-name: blacksheep
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>

* npm: bump chrome-devtools-frontend in /dashboard (#884)

Bumps [chrome-devtools-frontend](https://github.com/ChromeDevTools/devtools-frontend) from 1.0.949424 to 1.0.952784.
- [Release notes](https://github.com/ChromeDevTools/devtools-frontend/releases)
- [Changelog](https://github.com/ChromeDevTools/devtools-frontend/blob/main/docs/release_management.md)
- [Commits](https://github.com/ChromeDevTools/devtools-frontend/commits)

---
updated-dependencies:
- dependency-name: chrome-devtools-frontend
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>

* Tag GHCR latest only when publishing from develop branch (#887)

* Tag GHCR latest only when publishing from develop branch

* Fix condition

* Quote platforms

* Fix output(s) typo

* Fix conditional for latest tag on GHCR (#889)

* pip prod(deps): bump mypy from 0.910 to 0.920 (#890)

Bumps [mypy](https://github.com/python/mypy) from 0.910 to 0.920.
- [Release notes](https://github.com/python/mypy/releases)
- [Commits](python/mypy@v0.910...v0.920)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* npm: bump chrome-devtools-frontend in /dashboard (#886)

Bumps [chrome-devtools-frontend](https://github.com/ChromeDevTools/devtools-frontend) from 1.0.949424 to 1.0.952865.
- [Release notes](https://github.com/ChromeDevTools/devtools-frontend/releases)
- [Changelog](https://github.com/ChromeDevTools/devtools-frontend/blob/main/docs/release_management.md)
- [Commits](https://github.com/ChromeDevTools/devtools-frontend/commits)

---
updated-dependencies:
- dependency-name: chrome-devtools-frontend
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>

* npm: bump jquery from 3.5.1 to 3.6.0 in /dashboard (#891)

Bumps [jquery](https://github.com/jquery/jquery) from 3.5.1 to 3.6.0.
- [Release notes](https://github.com/jquery/jquery/releases)
- [Commits](jquery/jquery@3.5.1...3.6.0)

---
updated-dependencies:
- dependency-name: jquery
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com>

* [TLSInterception] Fix serial number generation (#892)

* Fix serial number generation

* Fix spellcheck-doc

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
  • Loading branch information
4 people authored Dec 21, 2021
2 parents 009935b + ef730ec commit 2784cfb
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 127 deletions.
62 changes: 27 additions & 35 deletions .github/workflows/test-library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
sdist-artifact-name: ${{ steps.artifact-name.outputs.sdist }}
wheel-artifact-name: ${{ steps.artifact-name.outputs.wheel }}
container-version: v${{ steps.container.outputs.version }}
container-platforms: ${{ steps.container.outputs.platforms }}
steps:
- name: Switch to using Python 3.9 by default
uses: actions/setup-python@v2
Expand Down Expand Up @@ -204,7 +205,9 @@ jobs:
&& github.event.inputs.release-version
|| steps.scm-version.outputs.dist-version
}}' | tr + .);
echo "::set-output name=version::$VER"
PLATFORMS="linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x";
echo "::set-output name=version::$VER";
echo "::set-output name=platforms::$PLATFORMS"
build:
name: 👷 dists ${{ needs.pre-setup.outputs.git-tag }}
Expand Down Expand Up @@ -727,19 +730,36 @@ jobs:
--local-executor && ./tests/integration/test_integration.sh 8899
- name: Push to GHCR
run: >-
PLATFORMS=linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x;
REGISTRY_URL="ghcr.io/abhinavsingh/proxy.py";
CONTAINER_TAG=$REGISTRY_URL:${{
needs.pre-setup.outputs.container-version
}};
docker buildx build
--push
--platform ${{
needs.pre-setup.outputs.container-platforms
}}
--build-arg PROXYPY_PKG_PATH='dist/${{
needs.pre-setup.outputs.wheel-artifact-name
}}'
-t $CONTAINER_TAG .
- name: Tag latest on GHCR
if: >-
github.event_name == 'push' &&
github.ref == format(
'refs/heads/{0}', github.event.repository.default_branch
)
run: >-
REGISTRY_URL="ghcr.io/abhinavsingh/proxy.py";
LATEST_TAG=$REGISTRY_URL:latest;
docker buildx build
--push
--platform $PLATFORMS
--platform ${{
needs.pre-setup.outputs.container-platforms
}}
--build-arg PROXYPY_PKG_PATH='dist/${{
needs.pre-setup.outputs.wheel-artifact-name
}}'
-t $CONTAINER_TAG
-t $LATEST_TAG .
- name: Login to DockerHub
uses: docker/login-action@v1
Expand All @@ -748,14 +768,15 @@ jobs:
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Push to DockerHub
run: >-
PLATFORMS=linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x;
REGISTRY_URL="abhinavsingh/proxy.py";
CONTAINER_TAG=$REGISTRY_URL:${{
needs.pre-setup.outputs.container-version
}};
docker buildx build
--push
--platform $PLATFORMS
--platform ${{
needs.pre-setup.outputs.container-platforms
}}
--build-arg PROXYPY_PKG_PATH='dist/${{
needs.pre-setup.outputs.wheel-artifact-name
}}'
Expand Down Expand Up @@ -839,35 +860,6 @@ jobs:
password: ${{ secrets.TESTPYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
# publish-docker:
# name: Publish 🐳 📦 ${{ needs.pre-setup.outputs.git-tag }} to Docker Hub
# needs:
# - check
# - pre-setup # transitive, for accessing settings
# if: >-
# fromJSON(needs.pre-setup.outputs.release-requested)
# runs-on: Ubuntu-latest

# environment:
# name: release-docker
# url: >-
# https://test.pypi.org/project/proxy.py/${{
# needs.pre-setup.outputs.dist-version
# }}

# steps:
# - name: Download all the dists
# uses: actions/download-artifact@v2
# with:
# name: python-package-distributions
# path: dist/
# - name: >-
# Publish 🐳 📦 ${{ needs.pre-setup.outputs.git-tag }} to Docker Hub
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.TESTPYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/

post-release-repo-update:
name: >-
Publish post-release Git tag
Expand Down
2 changes: 1 addition & 1 deletion benchmark/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
aiohttp==3.8.1
blacksheep==1.2.1
blacksheep==1.2.2
starlette==0.17.1
tornado==6.1
uvicorn==0.16.0
28 changes: 14 additions & 14 deletions dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@types/js-cookie": "^3.0.1",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"chrome-devtools-frontend": "^1.0.949424",
"chrome-devtools-frontend": "^1.0.952865",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.25.3",
Expand All @@ -40,7 +40,7 @@
"http-server": "^14.0.0",
"jasmine": "^3.10.0",
"jasmine-ts": "^0.3.0",
"jquery": "^3.5.1",
"jquery": "^3.6.0",
"js-cookie": "^3.0.1",
"jsdom": "^15.2.1",
"ncp": "^2.0.0",
Expand Down
2 changes: 0 additions & 2 deletions helper/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ run_benchmark

POST_RUN_OPEN_FILES=$(./helper/monitor_open_files.sh)

echo $output

echo "Open files diff:"
diff <( echo "$PRE_RUN_OPEN_FILES" ) <( echo "$POST_RUN_OPEN_FILES" )

Expand Down
1 change: 1 addition & 0 deletions proxy/common/backports.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def randint(self):
backports
getter
Arndt
del
"""

def __init__(self, ttl: float = 0):
Expand Down
28 changes: 18 additions & 10 deletions proxy/common/flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from ._compat import IS_WINDOWS # noqa: WPS436
from .plugins import Plugins
from .types import IpAddress
from .utils import bytes_, is_py2, set_open_file_limit
from .utils import bytes_, is_py2, is_threadless, set_open_file_limit
from .constants import COMMA, DEFAULT_DATA_DIRECTORY_PATH, DEFAULT_NUM_ACCEPTORS, DEFAULT_NUM_WORKERS
from .constants import DEFAULT_DEVTOOLS_WS_PATH, DEFAULT_DISABLE_HEADERS, PY2_DEPRECATION_MESSAGE
from .constants import PLUGIN_DASHBOARD, PLUGIN_DEVTOOLS_PROTOCOL, DEFAULT_MIN_COMPRESSION_LIMIT
Expand Down Expand Up @@ -186,7 +186,7 @@ def initialize(
for p in FlagParser.get_default_plugins(args)
]
requested_plugins = Plugins.resolve_plugin_flag(
args.plugins, opts.get('plugins', None),
args.plugins, opts.get('plugins'),
)
plugins = Plugins.load(
default_plugins + auth_plugins + requested_plugins,
Expand Down Expand Up @@ -340,21 +340,29 @@ def initialize(
),
)
args.timeout = cast(int, opts.get('timeout', args.timeout))
args.threadless = cast(bool, opts.get('threadless', args.threadless))
args.threaded = cast(bool, opts.get('threaded', args.threaded))
args.pid_file = cast(
Optional[str], opts.get(
'pid_file',
args.pid_file,
),
)
args.local_executor = cast(
bool,
opts.get(
'local_executor',
args.local_executor,
),
)
args.threaded = cast(bool, opts.get('threaded', args.threaded))
# Pre-evaluate threadless values based upon environment and config
#
# --threadless is now default mode of execution
# but we still have exceptions based upon OS config.
# Make sure executors are not started if is_threadless
# evaluates to False.
args.threadless = cast(bool, opts.get('threadless', args.threadless))
args.threadless = is_threadless(args.threadless, args.threaded)

args.pid_file = cast(
Optional[str], opts.get(
'pid_file',
args.pid_file,
),
)

args.proxy_py_data_dir = DEFAULT_DATA_DIRECTORY_PATH
os.makedirs(args.proxy_py_data_dir, exist_ok=True)
Expand Down
20 changes: 10 additions & 10 deletions proxy/common/pki.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,16 +298,16 @@ def run_openssl_command(command: List[str], timeout: int) -> bool:
', '.join(available_actions),
)
sys.exit(1)
if args.action in ('gen_private_key', 'gen_public_key'):
if args.private_key_path is None:
logger.error('--private-key-path is required for ' + args.action)
sys.exit(1)
if args.action == 'gen_public_key':
if args.public_key_path is None:
logger.error(
'--public-key-file is required for private key generation',
)
sys.exit(1)
if args.action in ('gen_private_key', 'gen_public_key') and \
args.private_key_path is None:
logger.error('--private-key-path is required for ' + args.action)
sys.exit(1)
if args.action == 'gen_public_key' and \
args.public_key_path is None:
logger.error(
'--public-key-file is required for private key generation',
)
sys.exit(1)

# Execute
if args.action == 'gen_private_key':
Expand Down
18 changes: 12 additions & 6 deletions proxy/common/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,18 @@ def load(
mro = list(inspect.getmro(klass))
mro.reverse()
iterator = iter(mro)
while next(iterator) is not abc.ABC:
pass
base_klass = next(iterator)
if klass not in p[bytes_(base_klass.__name__)]:
p[bytes_(base_klass.__name__)].append(klass)
logger.info('Loaded plugin %s.%s', module_name, klass.__name__)
try:
while next(iterator) is not abc.ABC:
pass
base_klass = next(iterator)
if klass not in p[bytes_(base_klass.__name__)]:
p[bytes_(base_klass.__name__)].append(klass)
logger.info('Loaded plugin %s.%s', module_name, klass.__name__)
except StopIteration:
logger.warn(
'%s is NOT a valid plugin',
text_(plugin_),
)
return p

@staticmethod
Expand Down
6 changes: 3 additions & 3 deletions proxy/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def build_http_response(
headers = {}
has_content_length = False
has_transfer_encoding = False
for k in headers:
for k, _ in headers.items():
if k.lower() == b'content-length':
has_content_length = True
if k.lower() == b'transfer-encoding':
Expand All @@ -124,8 +124,8 @@ def build_http_pkt(
"""Build and returns a HTTP request or response packet."""
pkt = WHITESPACE.join(line) + CRLF
if headers is not None:
for k in headers:
pkt += build_http_header(k, headers[k]) + CRLF
for k, v in headers.items():
pkt += build_http_header(k, v) + CRLF
pkt += CRLF
if body:
pkt += body
Expand Down
25 changes: 12 additions & 13 deletions proxy/core/acceptor/acceptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from typing import List, Optional, Tuple

from ...common.flag import flags
from ...common.utils import is_threadless
from ...common.logger import Logger
from ...common.backports import NonBlockingQueue
from ...common.constants import DEFAULT_LOCAL_EXECUTOR
Expand Down Expand Up @@ -113,17 +112,17 @@ def accept(
) -> List[Tuple[socket.socket, Optional[Tuple[str, int]]]]:
works = []
for _, mask in events:
if mask & selectors.EVENT_READ:
if self.sock is not None:
try:
conn, addr = self.sock.accept()
logging.debug(
'Accepting new work#{0}'.format(conn.fileno()),
)
works.append((conn, addr or None))
except BlockingIOError:
# logger.info('blocking io error')
pass
if mask & selectors.EVENT_READ and \
self.sock is not None:
try:
conn, addr = self.sock.accept()
logging.debug(
'Accepting new work#{0}'.format(conn.fileno()),
)
works.append((conn, addr or None))
except BlockingIOError:
# logger.info('blocking io error')
pass
return works

def run_once(self) -> None:
Expand Down Expand Up @@ -207,7 +206,7 @@ def _stop_local(self) -> None:

def _work(self, conn: socket.socket, addr: Optional[Tuple[str, int]]) -> None:
self._total = self._total or 0
if is_threadless(self.flags.threadless, self.flags.threaded):
if self.flags.threadless:
# Index of worker to which this work should be dispatched
# Use round-robin strategy by default.
#
Expand Down
Loading

0 comments on commit 2784cfb

Please sign in to comment.