Skip to content

Commit 59b0be4

Browse files
authored
Merge pull request #31 from peppelinux/main
v1.2.0: improved CI and alignemtn with the eUDIW reference implementation
2 parents 367d0f1 + db4eb31 commit 59b0be4

File tree

17 files changed

+126
-7
lines changed

17 files changed

+126
-7
lines changed

.github/workflows/code-quality.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,33 @@ on:
88
branches: ["*"]
99

1010
jobs:
11+
skip-check:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
should_skip: ${{ steps.check.outputs.should_skip }}
15+
steps:
16+
- uses: actions/github-script@v7
17+
id: check
18+
with:
19+
script: |
20+
const branch = process.env.BRANCH || '';
21+
const { data: { workflow_runs } } = await github.rest.actions.listWorkflowRunsForRepo({
22+
owner: context.repo.owner,
23+
repo: context.repo.repo,
24+
status: 'in_progress',
25+
});
26+
const otherRunning = workflow_runs.filter(
27+
r => r.id != context.runId &&
28+
r.name === context.workflow &&
29+
(!branch || r.head_branch === branch)
30+
);
31+
core.setOutput('should_skip', otherRunning.length > 0 ? 'true' : 'false');
32+
env:
33+
BRANCH: ${{ github.head_ref || github.ref_name }}
34+
1135
lint:
36+
needs: skip-check
37+
if: needs.skip-check.outputs.should_skip != 'true'
1238
name: flake8
1339
runs-on: ubuntu-latest
1440
steps:
@@ -29,6 +55,8 @@ jobs:
2955
flake8 pymdoccbor
3056
3157
isort:
58+
needs: skip-check
59+
if: needs.skip-check.outputs.should_skip != 'true'
3260
name: isort
3361
runs-on: ubuntu-latest
3462
steps:
@@ -48,6 +76,8 @@ jobs:
4876
isort pymdoccbor --check-only --diff
4977
5078
bandit:
79+
needs: skip-check
80+
if: needs.skip-check.outputs.should_skip != 'true'
5181
name: Bandit security scan
5282
runs-on: ubuntu-latest
5383
steps:
@@ -67,6 +97,8 @@ jobs:
6797
bandit -r -x pymdoccbor/tests pymdoccbor -f txt
6898
6999
radon:
100+
needs: skip-check
101+
if: needs.skip-check.outputs.should_skip != 'true'
70102
name: Radon complexity
71103
runs-on: ubuntu-latest
72104
steps:

.github/workflows/dependency-security.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,33 @@ on:
88
branches: ["*"]
99

1010
jobs:
11+
skip-check:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
should_skip: ${{ steps.check.outputs.should_skip }}
15+
steps:
16+
- uses: actions/github-script@v7
17+
id: check
18+
with:
19+
script: |
20+
const branch = process.env.BRANCH || '';
21+
const { data: { workflow_runs } } = await github.rest.actions.listWorkflowRunsForRepo({
22+
owner: context.repo.owner,
23+
repo: context.repo.repo,
24+
status: 'in_progress',
25+
});
26+
const otherRunning = workflow_runs.filter(
27+
r => r.id != context.runId &&
28+
r.name === context.workflow &&
29+
(!branch || r.head_branch === branch)
30+
);
31+
core.setOutput('should_skip', otherRunning.length > 0 ? 'true' : 'false');
32+
env:
33+
BRANCH: ${{ github.head_ref || github.ref_name }}
34+
1135
pip-audit:
36+
needs: skip-check
37+
if: needs.skip-check.outputs.should_skip != 'true'
1238
name: pip-audit
1339
runs-on: ubuntu-latest
1440
steps:
@@ -23,8 +49,8 @@ jobs:
2349
python -m venv env
2450
source env/bin/activate
2551
pip install --upgrade pip pip-audit
26-
pip install "cbor2>=5.4.0" "cbor-diag>=1.1.0" "pycose>=1.0.1"
2752
pip install -r requirements-dev.txt
53+
pip install -e .
2854
2955
# Exit 1 on any vulnerability (fail CI). --skip-editable whitelists pymdoccbor (local package, not on PyPI).
3056
# Ignore only unfixable: ecdsa CVE-2024-23342 (no upstream fix; see docs/SECURITY-DEPENDENCIES.md).

.github/workflows/python-app.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,33 @@ on:
1010
branches: [ "*" ]
1111

1212
jobs:
13-
build:
13+
skip-check:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
should_skip: ${{ steps.check.outputs.should_skip }}
17+
steps:
18+
- uses: actions/github-script@v7
19+
id: check
20+
with:
21+
script: |
22+
const branch = process.env.BRANCH || '';
23+
const { data: { workflow_runs } } = await github.rest.actions.listWorkflowRunsForRepo({
24+
owner: context.repo.owner,
25+
repo: context.repo.repo,
26+
status: 'in_progress',
27+
});
28+
const otherRunning = workflow_runs.filter(
29+
r => r.id != context.runId &&
30+
r.name === context.workflow &&
31+
(!branch || r.head_branch === branch)
32+
);
33+
core.setOutput('should_skip', otherRunning.length > 0 ? 'true' : 'false');
34+
env:
35+
BRANCH: ${{ github.head_ref || github.ref_name }}
1436

37+
build:
38+
needs: skip-check
39+
if: needs.skip-check.outputs.should_skip != 'true'
1540
runs-on: ubuntu-22.04
1641

1742
strategy:
@@ -21,6 +46,8 @@ jobs:
2146
- '3.10'
2247
- "3.11"
2348
- "3.12"
49+
- "3.13"
50+
- "3.14"
2451

2552
steps:
2653
- uses: actions/checkout@v4

NOTICE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
IdentityPython pyMDOC-CBOR
2+
https://github.com/IdentityPython/pyMDOC-CBOR
3+
4+
This project aligns with the EU Digital Identity Wallet reference implementation:
5+
https://github.com/eu-digital-identity-wallet/pyMDOC-CBOR
6+
7+
Modifications in that repository are Copyright (c) European Commission
8+
and licensed under the Apache License, Version 2.0.
9+
10+
This project is licensed under the Apache License, Version 2.0.
11+
See the LICENSE file for details.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ Other examples at [cbor official documentation](https://github.com/agronholm/cbo
285285

286286
- [Python Certvalidator](https://github.com/wbond/certvalidator/blob/master/docs/usage.md)
287287

288+
## EUDI Wallet reference implementation
289+
290+
This project aligns with the [EU Digital Identity Wallet pyMDOC-CBOR](https://github.com/eu-digital-identity-wallet/pyMDOC-CBOR) reference implementation. That repository may contain additional modifications for EUDI Wallet PID and mDL use cases (European Commission) since the EU Digital Identity Wallet pyMDOC-CBOR is a fork of this project.
291+
288292
## Authors and contributors
289293

290294
- Giuseppe De Marco

pymdoccbor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.1.0"
1+
__version__ = "1.2.0"

pymdoccbor/exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Aligns with https://github.com/eu-digital-identity-wallet/pyMDOC-CBOR
12
class InvalidMdoc(Exception):
23
"""
34
"""

pymdoccbor/mdoc/exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Aligns with https://github.com/eu-digital-identity-wallet/pyMDOC-CBOR
12
class MissingPrivateKey(Exception):
23
pass
34

pymdoccbor/mdoc/issuer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Aligns with https://github.com/eu-digital-identity-wallet/pyMDOC-CBOR
12
import base64
23
import binascii
34
import logging

pymdoccbor/mdoc/issuersigned.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Aligns with https://github.com/eu-digital-identity-wallet/pyMDOC-CBOR
12
from typing import Union
23

34
import cbor2

0 commit comments

Comments
 (0)