mrok 0.1.5__tar.gz → 0.1.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mrok-0.1.7/.github/actions/setup-python-env/action.yml +30 -0
- mrok-0.1.7/.github/workflows/assets/turing_team_pr_bot.png +0 -0
- mrok-0.1.7/.github/workflows/notify-pr-closed.yaml +41 -0
- mrok-0.1.7/.github/workflows/notify-pr-reviewed.yml +33 -0
- mrok-0.1.7/.github/workflows/pr-build-merge.yaml +109 -0
- mrok-0.1.7/.github/workflows/release.yml +112 -0
- mrok-0.1.7/.gitignore +192 -0
- mrok-0.1.7/.pre-commit-config.yaml +29 -0
- mrok-0.1.7/.python-version +1 -0
- {mrok-0.1.5 → mrok-0.1.7}/PKG-INFO +7 -9
- mrok-0.1.7/dev.Dockerfile +50 -0
- mrok-0.1.7/docker-compose.yaml +82 -0
- mrok-0.1.7/entrypoint.sh +5 -0
- mrok-0.1.7/mrok/__init__.py +6 -0
- mrok-0.1.7/mrok/agent/__init__.py +0 -0
- mrok-0.1.7/mrok/agent/sidecar/__init__.py +3 -0
- mrok-0.1.7/mrok/agent/sidecar/app.py +30 -0
- mrok-0.1.7/mrok/agent/sidecar/main.py +27 -0
- mrok-0.1.7/mrok/agent/ziticorn.py +29 -0
- mrok-0.1.7/mrok/cli/__init__.py +3 -0
- mrok-0.1.7/mrok/cli/commands/__init__.py +7 -0
- mrok-0.1.7/mrok/cli/commands/admin/__init__.py +10 -0
- mrok-0.1.7/mrok/cli/commands/admin/bootstrap.py +58 -0
- mrok-0.1.7/mrok/cli/commands/admin/register/__init__.py +8 -0
- mrok-0.1.7/mrok/cli/commands/admin/register/extensions.py +46 -0
- mrok-0.1.7/mrok/cli/commands/admin/register/instances.py +60 -0
- mrok-0.1.7/mrok/cli/commands/admin/unregister/__init__.py +8 -0
- mrok-0.1.7/mrok/cli/commands/admin/unregister/extensions.py +33 -0
- mrok-0.1.7/mrok/cli/commands/admin/unregister/instances.py +34 -0
- mrok-0.1.7/mrok/cli/commands/admin/utils.py +23 -0
- mrok-0.1.7/mrok/cli/commands/agent/__init__.py +6 -0
- mrok-0.1.7/mrok/cli/commands/agent/run/__init__.py +7 -0
- mrok-0.1.7/mrok/cli/commands/agent/run/asgi.py +49 -0
- mrok-0.1.7/mrok/cli/commands/agent/run/sidecar.py +54 -0
- mrok-0.1.7/mrok/cli/commands/controller/__init__.py +7 -0
- mrok-0.1.7/mrok/cli/commands/controller/openapi.py +47 -0
- mrok-0.1.7/mrok/cli/commands/controller/run.py +87 -0
- mrok-0.1.7/mrok/cli/main.py +97 -0
- mrok-0.1.7/mrok/cli/rich.py +18 -0
- mrok-0.1.7/mrok/conf.py +32 -0
- mrok-0.1.7/mrok/controller/__init__.py +0 -0
- mrok-0.1.7/mrok/controller/app.py +62 -0
- mrok-0.1.7/mrok/controller/auth.py +87 -0
- mrok-0.1.7/mrok/controller/dependencies/__init__.py +4 -0
- mrok-0.1.7/mrok/controller/dependencies/conf.py +7 -0
- mrok-0.1.7/mrok/controller/dependencies/ziti.py +27 -0
- mrok-0.1.7/mrok/controller/openapi/__init__.py +3 -0
- mrok-0.1.7/mrok/controller/openapi/examples.py +44 -0
- mrok-0.1.7/mrok/controller/openapi/utils.py +35 -0
- mrok-0.1.7/mrok/controller/pagination.py +79 -0
- mrok-0.1.7/mrok/controller/routes.py +294 -0
- mrok-0.1.7/mrok/controller/schemas.py +67 -0
- mrok-0.1.7/mrok/errors.py +2 -0
- mrok-0.1.7/mrok/http/__init__.py +0 -0
- mrok-0.1.7/mrok/http/config.py +65 -0
- mrok-0.1.7/mrok/http/forwarder.py +299 -0
- mrok-0.1.7/mrok/http/lifespan.py +10 -0
- mrok-0.1.7/mrok/http/master.py +90 -0
- mrok-0.1.7/mrok/http/protocol.py +11 -0
- mrok-0.1.7/mrok/http/server.py +14 -0
- mrok-0.1.7/mrok/logging.py +76 -0
- mrok-0.1.7/mrok/ziti/__init__.py +15 -0
- mrok-0.1.7/mrok/ziti/api.py +467 -0
- mrok-0.1.7/mrok/ziti/bootstrap.py +71 -0
- mrok-0.1.7/mrok/ziti/constants.py +6 -0
- mrok-0.1.7/mrok/ziti/errors.py +25 -0
- mrok-0.1.7/mrok/ziti/identities.py +161 -0
- mrok-0.1.7/mrok/ziti/pki.py +52 -0
- mrok-0.1.7/mrok/ziti/services.py +87 -0
- mrok-0.1.7/prod.Dockerfile +50 -0
- {mrok-0.1.5 → mrok-0.1.7}/pyproject.toml +10 -9
- mrok-0.1.7/scripts/ziti.sh +62 -0
- mrok-0.1.7/settings.yaml +27 -0
- mrok-0.1.7/sonar-project.properties +14 -0
- mrok-0.1.7/tests/__init__.py +0 -0
- mrok-0.1.7/tests/agent/__init__.py +0 -0
- mrok-0.1.7/tests/agent/sidecar/__init__.py +0 -0
- mrok-0.1.7/tests/agent/sidecar/test_app.py +113 -0
- mrok-0.1.7/tests/agent/sidecar/test_main.py +53 -0
- mrok-0.1.7/tests/agent/test_ziticorn.py +47 -0
- mrok-0.1.7/tests/cli/__init__.py +0 -0
- mrok-0.1.7/tests/cli/admin/__init__.py +0 -0
- mrok-0.1.7/tests/cli/admin/test_bootstrap.py +80 -0
- mrok-0.1.7/tests/cli/admin/test_register.py +200 -0
- mrok-0.1.7/tests/cli/admin/test_unregister.py +156 -0
- mrok-0.1.7/tests/cli/agent/__init__.py +0 -0
- mrok-0.1.7/tests/cli/agent/test_run.py +53 -0
- mrok-0.1.7/tests/cli/controller/__init__.py +0 -0
- mrok-0.1.7/tests/cli/controller/test_openapi.py +39 -0
- mrok-0.1.7/tests/cli/controller/test_run.py +59 -0
- mrok-0.1.7/tests/cli/test_main.py +35 -0
- mrok-0.1.7/tests/conftest.py +225 -0
- mrok-0.1.7/tests/controller/__init__.py +0 -0
- mrok-0.1.7/tests/controller/test_auth.py +171 -0
- mrok-0.1.7/tests/controller/test_extensions.py +221 -0
- mrok-0.1.7/tests/controller/test_instances.py +271 -0
- mrok-0.1.7/tests/controller/test_openapi.py +22 -0
- mrok-0.1.7/tests/http/__init__.py +0 -0
- mrok-0.1.7/tests/http/test_config.py +88 -0
- mrok-0.1.7/tests/http/test_forwarder.py +548 -0
- mrok-0.1.7/tests/http/test_lifespan.py +11 -0
- mrok-0.1.7/tests/http/test_master.py +107 -0
- mrok-0.1.7/tests/http/test_protocol.py +12 -0
- mrok-0.1.7/tests/http/test_server.py +44 -0
- mrok-0.1.7/tests/ziti/__init__.py +0 -0
- mrok-0.1.7/tests/ziti/test_api.py +579 -0
- mrok-0.1.7/tests/ziti/test_bootstrap.py +142 -0
- mrok-0.1.7/tests/ziti/test_identities.py +422 -0
- mrok-0.1.7/tests/ziti/test_pki.py +63 -0
- mrok-0.1.7/tests/ziti/test_services.py +326 -0
- mrok-0.1.7/uv.lock +1580 -0
- mrok-0.1.5/mrok.egg-info/PKG-INFO +0 -248
- mrok-0.1.5/mrok.egg-info/SOURCES.txt +0 -9
- mrok-0.1.5/mrok.egg-info/dependency_links.txt +0 -1
- mrok-0.1.5/mrok.egg-info/entry_points.txt +0 -2
- mrok-0.1.5/mrok.egg-info/requires.txt +0 -15
- mrok-0.1.5/mrok.egg-info/top_level.txt +0 -1
- mrok-0.1.5/setup.cfg +0 -4
- {mrok-0.1.5 → mrok-0.1.7}/LICENSE.txt +0 -0
- {mrok-0.1.5 → mrok-0.1.7}/README.md +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: "Setup Python Environment"
|
|
2
|
+
description: "Set up Python environment for the given Python version"
|
|
3
|
+
|
|
4
|
+
inputs:
|
|
5
|
+
python-version:
|
|
6
|
+
description: "Python version to use"
|
|
7
|
+
required: true
|
|
8
|
+
default: "3.12"
|
|
9
|
+
uv-version:
|
|
10
|
+
description: "uv version to use"
|
|
11
|
+
required: true
|
|
12
|
+
default: "0.6.2"
|
|
13
|
+
|
|
14
|
+
runs:
|
|
15
|
+
using: "composite"
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: ${{ inputs.python-version }}
|
|
20
|
+
|
|
21
|
+
- name: Install uv
|
|
22
|
+
uses: astral-sh/setup-uv@v2
|
|
23
|
+
with:
|
|
24
|
+
version: ${{ inputs.uv-version }}
|
|
25
|
+
enable-cache: 'true'
|
|
26
|
+
cache-suffix: ${{ matrix.python-version }}
|
|
27
|
+
|
|
28
|
+
- name: Install Python dependencies
|
|
29
|
+
run: uv sync --frozen
|
|
30
|
+
shell: bash
|
|
Binary file
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Notify Teams on PR
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [closed]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
notify-teams:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
with:
|
|
13
|
+
fetch-depth: 0
|
|
14
|
+
- name: Compute added/removed lines for notification
|
|
15
|
+
id: diff
|
|
16
|
+
run: |
|
|
17
|
+
PR_DATA=$(gh pr view "${{ github.event.pull_request.number }}" --json additions,deletions -q '.')
|
|
18
|
+
ADDITIONS=$(echo "$PR_DATA" | jq '.additions')
|
|
19
|
+
DELETIONS=$(echo "$PR_DATA" | jq '.deletions')
|
|
20
|
+
echo "additions=$ADDITIONS" >> $GITHUB_OUTPUT
|
|
21
|
+
echo "deletions=$DELETIONS" >> $GITHUB_OUTPUT
|
|
22
|
+
env:
|
|
23
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
24
|
+
- name: Notify Microsoft Teams
|
|
25
|
+
uses: softwareone-platform/notify-pr-teams-action@v4
|
|
26
|
+
with:
|
|
27
|
+
webhook_url: ${{ secrets.TEAMS_WEBHOOK_URL }}
|
|
28
|
+
bot_image_url: https://raw.githubusercontent.com/softwareone-platform/mrok/main/.github/workflows/assets/turing_team_pr_bot.png
|
|
29
|
+
repo: ${{ github.repository }}
|
|
30
|
+
pr_url: ${{ github.event.pull_request.html_url }}
|
|
31
|
+
pr_title: ${{ github.event.pull_request.title }}
|
|
32
|
+
pr_author: ${{ github.event.pull_request.user.login }}
|
|
33
|
+
head_ref: ${{ github.event.pull_request.head.ref }}
|
|
34
|
+
base_ref: ${{ github.event.pull_request.base.ref }}
|
|
35
|
+
commits: ${{ github.event.pull_request.commits }}
|
|
36
|
+
changed_files: ${{ github.event.pull_request.changed_files }}
|
|
37
|
+
additions: ${{ steps.diff.outputs.additions }}
|
|
38
|
+
deletions: ${{ steps.diff.outputs.deletions }}
|
|
39
|
+
pr_number: ${{ github.event.pull_request.number }}
|
|
40
|
+
pr_status: ${{ github.event.pull_request.state }}
|
|
41
|
+
is_merged: ${{ github.event.pull_request.merged }}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: PR Review Notification
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_review:
|
|
5
|
+
types: [submitted, edited, dismissed]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
notify-teams:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- name: Get Review Comments Count
|
|
12
|
+
id: comments
|
|
13
|
+
run: |
|
|
14
|
+
COMMENTS_COUNT=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
|
15
|
+
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews/${{ github.event.review.id }}/comments" | jq 'length')
|
|
16
|
+
echo "count=$COMMENTS_COUNT" >> $GITHUB_OUTPUT
|
|
17
|
+
|
|
18
|
+
- name: Notify Teams
|
|
19
|
+
uses: softwareone-platform/notify-pr-reviews-teams-action@v2
|
|
20
|
+
with:
|
|
21
|
+
webhook_url: ${{ secrets.TEAMS_WEBHOOK_URL }}
|
|
22
|
+
bot_image_url: https://raw.githubusercontent.com/softwareone-platform/mrok/main/.github/workflows/assets/turing_team_pr_bot.png
|
|
23
|
+
repo: ${{ github.repository }}
|
|
24
|
+
pr_number: ${{ github.event.pull_request.number }}
|
|
25
|
+
pr_title: ${{ github.event.pull_request.title }}
|
|
26
|
+
reviewer: ${{ github.event.review.user.login }}
|
|
27
|
+
review_state: ${{ github.event.review.state }}
|
|
28
|
+
global_comment: ${{ github.event.review.body || 'No comment provided' }}
|
|
29
|
+
comments_count: ${{ steps.comments.outputs.count }}
|
|
30
|
+
head_ref: ${{ github.event.pull_request.head.ref }}
|
|
31
|
+
base_ref: ${{ github.event.pull_request.base.ref }}
|
|
32
|
+
event: ${{ github.event.action }}
|
|
33
|
+
pr_url: ${{ github.event.pull_request.html_url }}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
name: PR build and merge
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize, reopened]
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- main
|
|
9
|
+
- release/*
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
build:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
timeout-minutes: 10
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
- name: Install libprotobuf-c1
|
|
23
|
+
run: sudo apt install -y libprotobuf-c1
|
|
24
|
+
- name: Install uv and set up its cache
|
|
25
|
+
uses: astral-sh/setup-uv@v4
|
|
26
|
+
with:
|
|
27
|
+
enable-cache: true
|
|
28
|
+
cache-dependency-glob: "uv.lock"
|
|
29
|
+
|
|
30
|
+
- name: Install Python
|
|
31
|
+
uses: actions/setup-python@v5
|
|
32
|
+
with:
|
|
33
|
+
python-version-file: ".python-version"
|
|
34
|
+
|
|
35
|
+
- name: Install the project dependancies
|
|
36
|
+
run: uv sync --all-extras --dev
|
|
37
|
+
|
|
38
|
+
- name: Run formatting checks
|
|
39
|
+
run: uv run ruff format --check --diff .
|
|
40
|
+
|
|
41
|
+
- name: Run linting
|
|
42
|
+
run: uv run ruff check .
|
|
43
|
+
|
|
44
|
+
- name: Run security checks
|
|
45
|
+
run: uv run bandit -c pyproject.toml -r . -f json -o bandit.json
|
|
46
|
+
|
|
47
|
+
- name: Run tests
|
|
48
|
+
run: uv run pytest
|
|
49
|
+
- name: Compute added/removed lines for notification
|
|
50
|
+
if: ${{ github.event_name == 'pull_request' }}
|
|
51
|
+
id: diff
|
|
52
|
+
run: |
|
|
53
|
+
PR_DATA=$(gh pr view "${{ github.event.pull_request.number }}" --json additions,deletions -q '.')
|
|
54
|
+
ADDITIONS=$(echo "$PR_DATA" | jq '.additions')
|
|
55
|
+
DELETIONS=$(echo "$PR_DATA" | jq '.deletions')
|
|
56
|
+
echo "additions=$ADDITIONS" >> $GITHUB_OUTPUT
|
|
57
|
+
echo "deletions=$DELETIONS" >> $GITHUB_OUTPUT
|
|
58
|
+
env:
|
|
59
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
60
|
+
- name: Notify Microsoft Teams
|
|
61
|
+
if: ${{ github.event_name == 'pull_request' }}
|
|
62
|
+
uses: softwareone-platform/notify-pr-teams-action@v4
|
|
63
|
+
with:
|
|
64
|
+
webhook_url: ${{ secrets.TEAMS_WEBHOOK_URL }}
|
|
65
|
+
bot_image_url: https://raw.githubusercontent.com/softwareone-platform/mrok/main/.github/workflows/assets/turing_team_pr_bot.png
|
|
66
|
+
repo: ${{ github.repository }}
|
|
67
|
+
pr_url: ${{ github.event.pull_request.html_url }}
|
|
68
|
+
pr_title: ${{ github.event.pull_request.title }}
|
|
69
|
+
pr_author: ${{ github.event.pull_request.user.login }}
|
|
70
|
+
head_ref: ${{ github.event.pull_request.head.ref }}
|
|
71
|
+
base_ref: ${{ github.event.pull_request.base.ref }}
|
|
72
|
+
commits: ${{ github.event.pull_request.commits }}
|
|
73
|
+
changed_files: ${{ github.event.pull_request.changed_files }}
|
|
74
|
+
additions: ${{ steps.diff.outputs.additions }}
|
|
75
|
+
deletions: ${{ steps.diff.outputs.deletions }}
|
|
76
|
+
pr_number: ${{ github.event.pull_request.number }}
|
|
77
|
+
pr_status: ${{ github.event.pull_request.state }}
|
|
78
|
+
is_merged: ${{ github.event.pull_request.merged }}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
- name: SonarQube Scan
|
|
82
|
+
uses: sonarsource/sonarqube-scan-action@v6
|
|
83
|
+
env:
|
|
84
|
+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
85
|
+
|
|
86
|
+
- name: SonarQube Quality Gate check
|
|
87
|
+
id: sonarqube-quality-gate-check
|
|
88
|
+
uses: sonarsource/sonarqube-quality-gate-action@master
|
|
89
|
+
with:
|
|
90
|
+
pollingTimeoutSec: 600
|
|
91
|
+
env:
|
|
92
|
+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
93
|
+
|
|
94
|
+
- name: Save code coverage report in the artefacts
|
|
95
|
+
uses: actions/upload-artifact@v4
|
|
96
|
+
with:
|
|
97
|
+
name: coverage-report
|
|
98
|
+
path: htmlcov
|
|
99
|
+
retention-days: 10
|
|
100
|
+
|
|
101
|
+
- name: Generate openapi.json
|
|
102
|
+
run: uv run mrok controller openapi -f json -o openapi.json
|
|
103
|
+
|
|
104
|
+
- name: Save openapi.json the artefacts
|
|
105
|
+
uses: actions/upload-artifact@v4
|
|
106
|
+
with:
|
|
107
|
+
name: openapi-spec
|
|
108
|
+
path: openapi.json
|
|
109
|
+
retention-days: 10
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
id-token: write # for OIDC
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
docker-image:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
timeout-minutes: 10
|
|
15
|
+
needs: [ set-version ]
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout
|
|
18
|
+
uses: actions/checkout@v5
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
|
|
22
|
+
- name: Download updated pyproject.toml
|
|
23
|
+
uses: actions/download-artifact@v4
|
|
24
|
+
with:
|
|
25
|
+
name: pyproject-toml
|
|
26
|
+
|
|
27
|
+
- name: 'Get the version'
|
|
28
|
+
id: get_version
|
|
29
|
+
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_OUTPUT"
|
|
30
|
+
|
|
31
|
+
- name: 'Login to ACR'
|
|
32
|
+
uses: docker/login-action@v3
|
|
33
|
+
with:
|
|
34
|
+
registry: ${{ vars.REGISTRY_LOGIN_SERVER }}
|
|
35
|
+
username: ${{ vars.REGISTRY_USERNAME }}
|
|
36
|
+
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
37
|
+
- name: Docker meta
|
|
38
|
+
id: meta
|
|
39
|
+
uses: docker/metadata-action@v4
|
|
40
|
+
with:
|
|
41
|
+
images: ${{ vars.REGISTRY_LOGIN_SERVER }}/gha/mrok
|
|
42
|
+
tags: |
|
|
43
|
+
type=semver,pattern={{major}}.{{minor}}.{{patch}},value=${{ steps.get_version.outputs.VERSION }}
|
|
44
|
+
type=semver,pattern={{major}}.{{minor}},value=${{ steps.get_version.outputs.VERSION }}
|
|
45
|
+
type=semver,pattern={{major}},value=${{ steps.get_version.outputs.VERSION }}
|
|
46
|
+
flavor: |
|
|
47
|
+
latest=false
|
|
48
|
+
- name: Build and push docker image
|
|
49
|
+
id: docker_build
|
|
50
|
+
uses: docker/build-push-action@v3
|
|
51
|
+
with:
|
|
52
|
+
context: .
|
|
53
|
+
file: prod.Dockerfile
|
|
54
|
+
push: true
|
|
55
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
56
|
+
- name: Docker image digest
|
|
57
|
+
run: echo ${{ steps.docker_build.outputs.digest }}
|
|
58
|
+
|
|
59
|
+
dtrack:
|
|
60
|
+
uses: softwareone-platform/ops-template/.github/workflows/dependency-track-python-uv.yml@v1
|
|
61
|
+
with:
|
|
62
|
+
projectName: 'mrok'
|
|
63
|
+
secrets:
|
|
64
|
+
DEPENDENCYTRACK_APIKEY: ${{ secrets.DEPENDENCYTRACK_APIKEY }}
|
|
65
|
+
|
|
66
|
+
set-version:
|
|
67
|
+
runs-on: ubuntu-24.04
|
|
68
|
+
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
|
|
72
|
+
- name: Export tag
|
|
73
|
+
id: vars
|
|
74
|
+
run: echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT
|
|
75
|
+
if: ${{ github.event_name == 'release' }}
|
|
76
|
+
|
|
77
|
+
- name: Update project version
|
|
78
|
+
run: |
|
|
79
|
+
sed -i "s/^version = \".*\"/version = \"$RELEASE_VERSION\"/" pyproject.toml
|
|
80
|
+
env:
|
|
81
|
+
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
|
|
82
|
+
if: ${{ github.event_name == 'release' }}
|
|
83
|
+
|
|
84
|
+
- name: Upload updated pyproject.toml
|
|
85
|
+
uses: actions/upload-artifact@v4
|
|
86
|
+
with:
|
|
87
|
+
name: pyproject-toml
|
|
88
|
+
path: pyproject.toml
|
|
89
|
+
|
|
90
|
+
publish:
|
|
91
|
+
runs-on: ubuntu-latest
|
|
92
|
+
|
|
93
|
+
needs: [ set-version ]
|
|
94
|
+
steps:
|
|
95
|
+
- name: Check out
|
|
96
|
+
uses: actions/checkout@v4
|
|
97
|
+
|
|
98
|
+
- name: Set up the environment
|
|
99
|
+
uses: ./.github/actions/setup-python-env
|
|
100
|
+
|
|
101
|
+
- name: Download updated pyproject.toml
|
|
102
|
+
uses: actions/download-artifact@v4
|
|
103
|
+
with:
|
|
104
|
+
name: pyproject-toml
|
|
105
|
+
|
|
106
|
+
- name: Build package
|
|
107
|
+
run: uv build
|
|
108
|
+
|
|
109
|
+
- name: Publish to PyPI
|
|
110
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
111
|
+
with:
|
|
112
|
+
repository-url: https://upload.pypi.org/legacy/
|
mrok-0.1.7/.gitignore
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
charges_file_folder
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py,cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
.pybuilder/
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
88
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
89
|
+
# .python-version
|
|
90
|
+
|
|
91
|
+
# pipenv
|
|
92
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
93
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
94
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
95
|
+
# install all needed dependencies.
|
|
96
|
+
#Pipfile.lock
|
|
97
|
+
|
|
98
|
+
# poetry
|
|
99
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
100
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
101
|
+
# commonly ignored for libraries.
|
|
102
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
103
|
+
#poetry.lock
|
|
104
|
+
|
|
105
|
+
# pdm
|
|
106
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
107
|
+
#pdm.lock
|
|
108
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
109
|
+
# in version control.
|
|
110
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
111
|
+
.pdm.toml
|
|
112
|
+
.pdm-python
|
|
113
|
+
.pdm-build/
|
|
114
|
+
|
|
115
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
116
|
+
__pypackages__/
|
|
117
|
+
|
|
118
|
+
# Celery stuff
|
|
119
|
+
celerybeat-schedule
|
|
120
|
+
celerybeat.pid
|
|
121
|
+
|
|
122
|
+
# SageMath parsed files
|
|
123
|
+
*.sage.py
|
|
124
|
+
|
|
125
|
+
# Environments
|
|
126
|
+
.env
|
|
127
|
+
.env.*
|
|
128
|
+
.venv
|
|
129
|
+
env/
|
|
130
|
+
venv/
|
|
131
|
+
ENV/
|
|
132
|
+
env.bak/
|
|
133
|
+
venv.bak/
|
|
134
|
+
|
|
135
|
+
# Spyder project settings
|
|
136
|
+
.spyderproject
|
|
137
|
+
.spyproject
|
|
138
|
+
|
|
139
|
+
# Rope project settings
|
|
140
|
+
.ropeproject
|
|
141
|
+
|
|
142
|
+
# mkdocs documentation
|
|
143
|
+
/site
|
|
144
|
+
|
|
145
|
+
# mypy
|
|
146
|
+
.mypy_cache/
|
|
147
|
+
.dmypy.json
|
|
148
|
+
dmypy.json
|
|
149
|
+
|
|
150
|
+
# Pyre type checker
|
|
151
|
+
.pyre/
|
|
152
|
+
|
|
153
|
+
# pytype static type analyzer
|
|
154
|
+
.pytype/
|
|
155
|
+
|
|
156
|
+
# Cython debug symbols
|
|
157
|
+
cython_debug/
|
|
158
|
+
|
|
159
|
+
# unified cache dir
|
|
160
|
+
.cache/
|
|
161
|
+
|
|
162
|
+
# bandit report
|
|
163
|
+
bandit.json
|
|
164
|
+
|
|
165
|
+
# PyCharm
|
|
166
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
167
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
168
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
169
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
170
|
+
.idea/
|
|
171
|
+
|
|
172
|
+
# vscode
|
|
173
|
+
.devcontainer/
|
|
174
|
+
|
|
175
|
+
# Postgres data
|
|
176
|
+
pg_data/
|
|
177
|
+
test_pg_data/
|
|
178
|
+
|
|
179
|
+
# Default OpenAPI spec file
|
|
180
|
+
ffc_operations_openapi_spec.yml
|
|
181
|
+
|
|
182
|
+
# local dev tools configs
|
|
183
|
+
taplo.toml
|
|
184
|
+
|
|
185
|
+
# MacOS
|
|
186
|
+
.DS_Store
|
|
187
|
+
|
|
188
|
+
.identity
|
|
189
|
+
.ziti-home
|
|
190
|
+
|
|
191
|
+
# Ignore dynaconf secret files
|
|
192
|
+
.secrets.*
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
default_language_version:
|
|
2
|
+
python: python3.12
|
|
3
|
+
repos:
|
|
4
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
+
rev: v5.0.0
|
|
6
|
+
hooks:
|
|
7
|
+
- id: check-added-large-files
|
|
8
|
+
- id: check-toml
|
|
9
|
+
- id: check-yaml
|
|
10
|
+
args:
|
|
11
|
+
- --unsafe
|
|
12
|
+
- id: end-of-file-fixer
|
|
13
|
+
- id: trailing-whitespace
|
|
14
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
15
|
+
rev: v0.10.0
|
|
16
|
+
hooks:
|
|
17
|
+
- id: ruff
|
|
18
|
+
args:
|
|
19
|
+
- --fix
|
|
20
|
+
- id: ruff-format
|
|
21
|
+
- repo: https://github.com/PyCQA/bandit
|
|
22
|
+
rev: "1.8.0"
|
|
23
|
+
hooks:
|
|
24
|
+
- id: bandit
|
|
25
|
+
args:
|
|
26
|
+
- -c
|
|
27
|
+
- pyproject.toml
|
|
28
|
+
- -r
|
|
29
|
+
- .
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mrok
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: MPT Extensions OpenZiti Orchestrator
|
|
5
5
|
Author: SoftwareOne AG
|
|
6
6
|
License: Apache License
|
|
@@ -204,16 +204,14 @@ License: Apache License
|
|
|
204
204
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
205
205
|
See the License for the specific language governing permissions and
|
|
206
206
|
limitations under the License.
|
|
207
|
-
|
|
208
|
-
Requires-Python: <4,>=3.12
|
|
209
|
-
Description-Content-Type: text/markdown
|
|
210
207
|
License-File: LICENSE.txt
|
|
208
|
+
Requires-Python: <4,>=3.12
|
|
211
209
|
Requires-Dist: cryptography<46.0.0,>=45.0.7
|
|
212
210
|
Requires-Dist: dynaconf<4.0.0,>=3.2.11
|
|
213
211
|
Requires-Dist: fastapi-pagination<0.15.0,>=0.14.1
|
|
214
|
-
Requires-Dist: fastapi[standard]<0.
|
|
212
|
+
Requires-Dist: fastapi[standard]<0.120.0,>=0.119.0
|
|
215
213
|
Requires-Dist: gunicorn<24.0.0,>=23.0.0
|
|
216
|
-
Requires-Dist: httptools<0.
|
|
214
|
+
Requires-Dist: httptools<0.8.0,>=0.7.1
|
|
217
215
|
Requires-Dist: httpx<0.29.0,>=0.28.1
|
|
218
216
|
Requires-Dist: openziti<2.0.0,>=1.3.1
|
|
219
217
|
Requires-Dist: pydantic<3.0.0,>=2.11.7
|
|
@@ -221,9 +219,9 @@ Requires-Dist: pyfiglet<2.0.0,>=1.0.4
|
|
|
221
219
|
Requires-Dist: pyjwt<3.0.0,>=2.10.1
|
|
222
220
|
Requires-Dist: pyyaml<7.0.0,>=6.0.2
|
|
223
221
|
Requires-Dist: rich<15.0.0,>=14.1.0
|
|
224
|
-
Requires-Dist: typer<0.
|
|
225
|
-
Requires-Dist: uvicorn-worker<0.
|
|
226
|
-
|
|
222
|
+
Requires-Dist: typer<0.20.0,>=0.19.2
|
|
223
|
+
Requires-Dist: uvicorn-worker<0.5.0,>=0.4.0
|
|
224
|
+
Description-Content-Type: text/markdown
|
|
227
225
|
|
|
228
226
|
[](https://github.com/astral-sh/ruff) [](https://sonarcloud.io/summary/new_code?id=softwareone-platform_mrok) [](https://sonarcloud.io/summary/new_code?id=softwareone-platform_mrok)
|
|
229
227
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
FROM python:3.12
|
|
2
|
+
|
|
3
|
+
# The uv installer requires curl (and certificates) to download the release archive
|
|
4
|
+
RUN apt-get clean -y; \
|
|
5
|
+
apt-get update; \
|
|
6
|
+
apt-get install -y --no-install-recommends ca-certificates curl vim postgresql-client netcat-openbsd libprotobuf-c1; \
|
|
7
|
+
apt-get autoremove --purge -y; \
|
|
8
|
+
apt-get clean -y; \
|
|
9
|
+
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
|
|
10
|
+
|
|
11
|
+
RUN curl -sSf https://get.openziti.io/install.bash | bash -s openziti-controller openziti-router zrok
|
|
12
|
+
# Run the uv installer then remove it
|
|
13
|
+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
14
|
+
|
|
15
|
+
# Ensure the installed binary is on the `PATH`
|
|
16
|
+
ENV PATH="/root/.local/bin/:$PATH"
|
|
17
|
+
|
|
18
|
+
# Install the project into `/app`
|
|
19
|
+
WORKDIR /app
|
|
20
|
+
|
|
21
|
+
# Enable bytecode compilation
|
|
22
|
+
ENV UV_COMPILE_BYTECODE=1
|
|
23
|
+
|
|
24
|
+
# Copy from the cache instead of linking since it's a mounted volume
|
|
25
|
+
ENV UV_LINK_MODE=copy
|
|
26
|
+
|
|
27
|
+
# Install the project's dependencies using the lockfile and settings
|
|
28
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
29
|
+
--mount=type=bind,source=uv.lock,target=uv.lock \
|
|
30
|
+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
|
31
|
+
uv sync --frozen --no-install-project
|
|
32
|
+
|
|
33
|
+
RUN echo 'alias pip="uv pip"' >> ~/.bashrc
|
|
34
|
+
|
|
35
|
+
# Then, add the rest of the project source code and install it
|
|
36
|
+
# Installing separately from its dependencies allows optimal layer caching
|
|
37
|
+
COPY . /app
|
|
38
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
39
|
+
uv sync --frozen
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# Place executables in the environment at the front of the path
|
|
45
|
+
ENV PATH="/app/.venv/bin:$PATH"
|
|
46
|
+
|
|
47
|
+
COPY ./entrypoint.sh /entrypoint.sh
|
|
48
|
+
RUN chmod +x /entrypoint.sh
|
|
49
|
+
|
|
50
|
+
ENTRYPOINT ["/entrypoint.sh"]
|