Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Update GitHub actions #151

Merged
merged 2 commits into from
Jul 16, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3.1.0
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Run pre-commit
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/manual_test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
jobs:
build-n-publish:
name: Build and publish distribution to TestPyPI
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with: {fetch-depth: 0} # deep clone for setuptools-scm
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.11'
- name: Install pypa/build
run: |
python3 -m pip install --upgrade pip
Expand All @@ -19,7 +19,7 @@ jobs:
run: |
python3 setup.py sdist
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
12 changes: 6 additions & 6 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ on:
types: [published]
jobs:
documentation:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
name: Create the documentation and deploy it to GitHub Pages
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: "14.x"
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.7"
python-version: "3.11"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -30,4 +30,4 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/.vuepress/dist
cname: gateway.theengs.io
cname: gateway.theengs.io
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:
jobs:
build-n-publish:
name: Build and publish distributions to PyPI
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with: {fetch-depth: 0} # deep clone for setuptools-scm
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install pypa/build
run: |
python3 -m pip install --upgrade pip
Expand All @@ -19,6 +21,6 @@ jobs:
run: |
python3 setup.py sdist
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
13 changes: 13 additions & 0 deletions TheengsGateway/ble_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,11 @@ def detection_callback(
decrypted_data, data_json, decoded_json
)

# Keep encrypted properties
cipher = decoded_json["cipher"]
mic = decoded_json["mic"]
ctr = decoded_json["ctr"]

# Re-decode advertisement, this time unencrypted
decoded_json = decodeBLE(json.dumps(data_json))
if decoded_json:
Expand All @@ -389,6 +394,11 @@ def detection_callback(
data_json["servicedata"],
)

# Re-add encrypted properties
decoded_json["cipher"] = cipher
decoded_json["mic"] = mic
decoded_json["ctr"] = ctr

except KeyError:
logger.exception(
"Can't find bindkey for %s.", device.address
Expand All @@ -413,6 +423,9 @@ def detection_callback(
"cont",
"track",
"encr",
"cipher",
"mic",
"ctr",
):
decoded_json.pop(key, None)

Expand Down