fastdsu 0.0.0__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.
@@ -0,0 +1,193 @@
1
+ # SECURITY.md
2
+
3
+ ## Summary
4
+ This policy explains how the public can responsibly [report vulnerabilities](reporting-a-vulnerability), and how DBT developers must protect [sensitive information](handling-secrets) and follow DBT’s required [security controls](security-controls) when working in GitHub.
5
+
6
+ ---
7
+
8
+ ## Reporting a Vulnerability
9
+
10
+ If you believe you have found a security vulnerability, please submit a report via our HackerOne [form](https://hackerone.com/2680e4cd-0436-42a5-bd2a-37fd86367276/embedded_submissions/new)
11
+
12
+ Please include:
13
+ - Where the issue can be observed (URL, IP address or page)
14
+ - A brief description (e.g. “XSS vulnerability”)
15
+ - Safe, non‑destructive reproduction steps
16
+
17
+ **Disclosure guidelines**
18
+ - Do **not** share vulnerability details beyond DBT and the asset owner
19
+ - HackerOne accounts are optional but allow updates
20
+ - You must agree to HackerOne’s Terms, Privacy Policy, and Disclosure Guidelines
21
+ - NCC Group triages reports within **five working days**
22
+ - DBT Cyber assists with coordination, but the asset owner is responsible for remediation
23
+
24
+ ---
25
+
26
+ ## Handling Secrets
27
+
28
+ These requirements apply to DBT developers.
29
+
30
+ Information on secrets and their management can be found [here](https://dbis.sharepoint.com/:w:/r/sites/DDaTDirectorate/Shared%20Documents/Work%20-%20GitHub%20Security/Github%20Security%20Framework/Guidelines%20and%20Policies/GitHub%20Security%20Standards%20v0.6.docx?d=w022dea8105074e36af5450797083c297&csf=1&web=1&e=SR5out).
31
+
32
+ Instructions on what to do in the event of a leak can be found [here](https://dbis.sharepoint.com/:w:/r/sites/DDaTDirectorate/Shared%20Documents/Work%20-%20GitHub%20Security/Github%20Security%20Framework/Incident%20Response/GitHub%20Repository%20Incident%20Playbook.docx?d=w9ba04ffa4a7c4ff38faaaf12ff030c94&csf=1&web=1&e=yZF5dO).
33
+
34
+ **In summary, developers must:**
35
+ - Never commit secrets or sensitive data to GitHub
36
+ - Use secure storage for managing secrets
37
+ - Ensure no secrets appear in PRs, logs or config files
38
+ - Follow incident‑response steps immediately if a leak occurs
39
+
40
+ ---
41
+
42
+ ## Security Controls
43
+
44
+ DBT uses several processes to strengthen the security posture of our GitHub repositories.
45
+
46
+ Use this checklist to ensure your repository implements these processes:
47
+
48
+ - [x] **Create or update `SECURITY_CHECKLIST.md`**
49
+ See: [SECURITY_CHECKLIST.md](#security_checklistmd)
50
+
51
+ - [x] **Review the CI/CD overview**
52
+ See: [CI/CD Overview](#cicd-overview)
53
+
54
+ - [x] **Set up the pre‑commit hook framework**
55
+ See: [Pre‑Commit Hooks](#precommit-hooks)
56
+
57
+ - [x] **Set up custom GitHub properties**
58
+ See: [Custom GitHub Properties](#custom-github-properties)
59
+
60
+ - [x] **Apply the DBT GitHub security policy**
61
+ See: [GitHub Security Policy](#github-security-policy)
62
+
63
+ - [x] **Ensure a `CODEOWNERS` file exists**
64
+ See: [CODEOWNERS](#codeowners)
65
+
66
+ - [x] **Review GitHub Safety Tips**
67
+ See: [GitHub Safety Tips](#github-safety-tips)
68
+
69
+ - [x] **Review Repository Access and Governance**
70
+ See: [Repository Access & Governance](#repository-access--governance)
71
+
72
+ - [x] **Review the Pull Request template**
73
+ See: [Pull Request Template](#pull-request-template)
74
+
75
+ - [x] **Review branch protection rules**
76
+ See: [Branch Protection Rules](#branch-protection-rules)
77
+
78
+ - [x] **Review push protection**
79
+ See: [Push Protection](#push-protection)
80
+
81
+ ---
82
+
83
+ ### SECURITY_CHECKLIST.md
84
+
85
+ Create `SECURITY_CHECKLIST.md` in the root of your repository if not present. Copy the checklist and update it as checks are completed.
86
+
87
+ ---
88
+
89
+ ### CI/CD Overview
90
+
91
+ Review the GitHub CI/CD Overview which summarises the controls DBT has in place to strengthen the security posture of our GitHub repositories.
92
+
93
+ ![CI/CD overview](https://raw.githubusercontent.com/uktrade/.github/refs/heads/main/assets/CI-CD%20pipeline.svg)
94
+
95
+ ---
96
+
97
+ ### Pre‑Commit Hooks
98
+
99
+ DBT requires all contributors to use the organisation‑approved pre‑commit hooks before committing. A GitHub Action blocks PRs where the hook has not run.
100
+
101
+ For more information and setup guidance please refer [here](https://github.com/uktrade/github-standards).
102
+
103
+ ---
104
+
105
+ ### Custom GitHub Properties
106
+
107
+ DBT uses custom github properties to enforce branch protection rules and run organisation level github actions.
108
+
109
+ Manage custom properties:
110
+ `https://github.com/uktrade/REPO_NAME/settings/access`
111
+
112
+ **Mandatory**
113
+ - `reusable_workflow_opt_in` - `true`
114
+ - `scs_portfolio` - The portfolio associated with your CSC. If your portfolio is missing, this can be added by raising an SRE ticket.
115
+
116
+ **Optional**
117
+ - `is_docker` — for repos that build Docker images
118
+ - `language` — all languages used by this repository should be selected, and github workflows will run with dedicated checks on that language.
119
+
120
+ ---
121
+
122
+ ### GitHub Security Policy
123
+
124
+ DBT has introduced a new organisation-wide GitHub security policy that applies the required security checks to every repository. New repositories get this policy by default, but existing ones must have it enabled before they can be made public. Over time, this policy will fully replace the old one across the uktrade account.
125
+
126
+ **You must be an organisation administrator to apply this policy**
127
+
128
+ To add the new security policy, follow these instructions:
129
+
130
+ 1. As an organisation administrator, navigate to the [security config page](https://github.com/organizations/uktrade/settings/security_products).
131
+ 1. Scroll down to the **Apply configurations** sections, and enter the name of the repository to be made public in the filter input field
132
+ 1. Use the checkbox next to the results list to select all repositories being made public, then use the **Apply configuration** button to select the **Default DBT security** configuration
133
+ 1. A confirmation modal will appear displaying a summary of the action being made. Click the apply button
134
+ 1. In the repository that has had the new policy applied, navigate to the **Advanced Security** page in the repository settings. At the top of the page there should be a banner message **Modifications to some settings have been blocked by organization administrators.**
135
+
136
+ ---
137
+
138
+ ### CodeQL for Fork‑Based PRs (Optional)
139
+
140
+ The default DBT GitHub Security policy does not currently support scanning PRs raised from a fork of a repository.
141
+ If PRs from forks must be supported, switch to **Advanced** CodeQL to generate a `codeql.yml` workflow:
142
+
143
+ 1. Open the GitHub settings page, and navigate to the Advanced Security section using the left hand menu
144
+ 1. Scroll down to the Code Scanning section, under the Tools sub-section there will be an item for CodeQL analysis
145
+ 1. Click the ... button next to Default setup text, then choose the Switch to advanced option from the menu
146
+ 1. On the popup, click the Disable CodeQL button. Although you are disabling CodeQL, there is still a branch protection rule in place that blocks a PR unless a CodeQL scan is detected. Disabling here will not allow PRs to be merged
147
+ 1. The GitHub online editor will open to create a new file called codeql.yml in your repo, and the contents of this file will be prefilled with the languages CodeQL has detected in your repo. You can modify the contents of this file if needed, however you must leave the workflow name as `CodeQL Advanced`
148
+ 1. Once happy with the workflow file contents, click the green Commit changes button to trigger a PR to merge this into the main branch
149
+ 1. Approve and merge the PR with this workflow file. Once merged, the CodeQL scan will perform an initial scan that can take a while but you can track the progress by viewing the Actions tab for your repository
150
+
151
+ ### CODEOWNERS
152
+
153
+ Repositories must include a `CODEOWNERS` file:
154
+ https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
155
+
156
+ ### GitHub Safety Tips
157
+
158
+ Internal contributors should review the [GitHub Safety Tips](https://uktrade.atlassian.net/wiki/x/n4AEKQE) to understand how to protect themselves when coding in the open.
159
+
160
+ ### Repository Access & Governance
161
+
162
+ TBC
163
+
164
+ ### Pull Request Template
165
+
166
+ If your repository does not already contain a pull_request_template.md file, you will inherit the DBT template by default. If you are already using your own template, you should add this section to remind reviewers they should be ensuring no secret values are visible:
167
+
168
+ ```
169
+ ### Reviewer Checklist
170
+
171
+ - [ ] I have reviewed the PR and ensured no secret or sensitive data is present
172
+ ```
173
+
174
+ ### Branch Protection Rules
175
+
176
+ An organisation ruleset has been created to apply a minimum set of branch protection rules:
177
+
178
+ - A PR is required for merges into the default branch (usually main)
179
+ - At least 1 approver is required before a PR can be merged
180
+ - Any conversations on the PR must be marked as resolved
181
+
182
+ Organisation admins and repository admins have been added to the bypass list for this branch protection ruleset.
183
+
184
+ Repository admins might decide to add additional rules to their own repositories. It is not possible for repository admins to add their own rules that reduce this level of protection. As an example, a repository admin could add a ruleset that drops the required number of approvers to 0 but that would have no effect as the organisation ruleset would take precedence. They could add a ruleset that sets the number of approvers to 3, and as this is not reducing the organisation ruleset protection this would take precedence.
185
+
186
+ ## Push Protection
187
+
188
+ Push protection is required for all repositories using the default DBT GitHub security policy.
189
+ DBT also defines [custom secret‑scanning patterns](https://docs.github.com/en/code-security/concepts/secret-security/about-push-protection).
190
+
191
+ You should confirm that push protection is enabled on your repository.
192
+
193
+ Please raise a ticket with SRE if you need additional patterns.
@@ -0,0 +1,29 @@
1
+ name: Setup toolchain
2
+ description: Install uv with Python and optionally just
3
+
4
+ inputs:
5
+ python-version:
6
+ description: Python version to install
7
+ required: false
8
+ default: "3.11"
9
+ install-just:
10
+ description: Whether to install just
11
+ required: false
12
+ default: "true"
13
+
14
+ runs:
15
+ using: composite
16
+ steps:
17
+ - name: Install uv and Python
18
+ uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
19
+ with:
20
+ enable-cache: true
21
+ cache-dependency-glob: "uv.lock"
22
+ python-version: ${{ inputs.python-version }}
23
+
24
+ - name: Install just
25
+ if: ${{ inputs.install-just == 'true' }}
26
+ uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1
27
+ with:
28
+ repo: casey/just
29
+ version: 1.55.1
@@ -0,0 +1,23 @@
1
+ <!-- Give high level context to this PR -->
2
+
3
+ ## 🛠️ Changes proposed in this pull request
4
+
5
+ * <!-- List the main changes you've made -->
6
+
7
+ ## 👀 Guidance to review
8
+
9
+ <!-- Help reviewers know where to focus their efforts, or flag controversial decisions -->
10
+ <!-- Add links and diagrams to explain decisions -->
11
+ <!-- Point out any **breaking changes** -->
12
+
13
+ ## 🤖 AI declaration
14
+
15
+ <!-- Declare code where AI was used, and how you ensured its quality -->
16
+
17
+ ## ✅ Checklist:
18
+
19
+ - [ ] This is the smallest, simplest solution to the problem
20
+ - [ ] I've read [our code standards](../CONTRIBUTING.md) and this code follows them
21
+ - [ ] All new code is tested
22
+ - [ ] I've updated all relevant documentation
23
+ - [ ] I've reviewed the PR and ensured no secret values are present
@@ -0,0 +1,97 @@
1
+ name: CD
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build-wheels:
9
+ name: Build wheels on ${{ matrix.os }}
10
+ runs-on: ${{ matrix.os }}
11
+ permissions:
12
+ contents: read
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ os: [
17
+ ubuntu-latest,
18
+ ubuntu-24.04-arm,
19
+ windows-latest,
20
+ macos-15-intel,
21
+ macos-14
22
+ ]
23
+
24
+ steps:
25
+ - name: Checkout repository
26
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
27
+
28
+ - name: Setup uv and just toolchain
29
+ uses: ./.github/actions/setup-toolchain
30
+ with:
31
+ python-version: "3.11"
32
+ install-just: "false"
33
+
34
+ - name: Set up Rust
35
+ uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
36
+
37
+ - name: Build wheels
38
+ run: uvx cibuildwheel --output-dir wheelhouse
39
+ env:
40
+ CIBW_BUILD: cp311-* cp312-* cp313-* cp314-*
41
+ CIBW_SKIP: pp* *-win32 *i686* *-musllinux*
42
+ CIBW_BUILD_VERBOSITY: 1
43
+ CIBW_BUILD_FRONTEND: "build"
44
+ MACOSX_DEPLOYMENT_TARGET: "11.0"
45
+
46
+ - name: Upload wheels
47
+ uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
48
+ with:
49
+ name: dist-wheels-${{ matrix.os }}
50
+ path: ./wheelhouse/*.whl
51
+
52
+ build-sdist:
53
+ name: Build source distribution
54
+ runs-on: ubuntu-latest
55
+ permissions:
56
+ contents: read
57
+
58
+ steps:
59
+ - name: Checkout repository
60
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
61
+
62
+ - name: Setup uv and just toolchain
63
+ uses: ./.github/actions/setup-toolchain
64
+ with:
65
+ python-version: "3.11"
66
+ install-just: "false"
67
+
68
+ - name: Set up Rust
69
+ uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
70
+
71
+ - name: Build source distribution
72
+ run: uv build --sdist --out-dir dist
73
+
74
+ - name: Upload sdist
75
+ uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
76
+ with:
77
+ name: dist-sdist
78
+ path: dist/*.tar.gz
79
+
80
+ deploy-package:
81
+ needs: [build-wheels, build-sdist]
82
+ runs-on: ubuntu-latest
83
+ permissions:
84
+ id-token: write
85
+
86
+ environment: pypi
87
+
88
+ steps:
89
+ - name: Download build artefacts
90
+ uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
91
+ with:
92
+ pattern: dist-*
93
+ path: dist
94
+ merge-multiple: true
95
+
96
+ - name: Publish package to PyPI
97
+ uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
@@ -0,0 +1,102 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [ main ]
6
+
7
+ jobs:
8
+ test-python:
9
+ name: test ${{ matrix.python-version }}
10
+ runs-on: ${{ matrix.os }}
11
+ strategy:
12
+ matrix:
13
+ os: [ubuntu-latest]
14
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
15
+
16
+ steps:
17
+ - name: Checkout repository
18
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
19
+
20
+ - name: Setup uv and just toolchain
21
+ uses: ./.github/actions/setup-toolchain
22
+ with:
23
+ python-version: ${{ matrix.python-version }}
24
+
25
+ - name: Set up Rust
26
+ uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
27
+
28
+ - name: Run Python tests
29
+ run: just test python
30
+
31
+ test-os:
32
+ name: test on ${{ matrix.os }}
33
+ runs-on: ${{ matrix.os }}
34
+ strategy:
35
+ matrix:
36
+ os: [ubuntu-latest, windows-latest, macos-latest]
37
+
38
+ steps:
39
+ - name: Checkout repository
40
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
41
+
42
+ - name: Setup uv and just toolchain
43
+ uses: ./.github/actions/setup-toolchain
44
+ with:
45
+ python-version: "3.11"
46
+
47
+ - name: Set up Rust
48
+ uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
49
+
50
+ - name: Run Rust tests
51
+ run: just test rust
52
+
53
+ - name: Run Python tests
54
+ run: just test python
55
+
56
+ format-and-lint:
57
+ runs-on: ubuntu-latest
58
+
59
+ steps:
60
+ - name: Checkout repository
61
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
62
+
63
+ - name: Setup uv and just toolchain
64
+ uses: ./.github/actions/setup-toolchain
65
+ with:
66
+ python-version: "3.11"
67
+
68
+ - name: Set up Rust
69
+ uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
70
+ with:
71
+ components: |
72
+ rustfmt
73
+ clippy
74
+
75
+ - name: Format and lint
76
+ run: just format
77
+
78
+ build-package:
79
+ runs-on: ubuntu-latest
80
+
81
+ steps:
82
+ - name: Checkout repository
83
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
84
+
85
+ - name: Setup uv and just toolchain
86
+ uses: ./.github/actions/setup-toolchain
87
+ with:
88
+ python-version: "3.11"
89
+
90
+ - name: Set up Rust
91
+ uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
92
+
93
+ - name: Build the package
94
+ run: uv build
95
+
96
+ ci-success:
97
+ needs: [format-and-lint, test-python, test-os, build-package]
98
+ runs-on: ubuntu-latest
99
+
100
+ steps:
101
+ - name: CI Success
102
+ run: echo "All CI checks passed!"
@@ -0,0 +1,30 @@
1
+ # Custom
2
+ scratch/
3
+
4
+ # Python
5
+ __pycache__/
6
+ *.py[oc]
7
+ *.egg-info/
8
+ dist/
9
+ wheels/
10
+ .pytest_cache
11
+ .ruff_cache
12
+
13
+ # Compiled extensions
14
+ *.so
15
+ *.pyd
16
+
17
+ # Rust
18
+ target/
19
+
20
+ # uv / virtualenvs
21
+ .venv
22
+
23
+ # Editor
24
+ .vscode/
25
+ .idea/
26
+ *.sw[po]
27
+
28
+ # OS
29
+ .DS_Store
30
+ Thumbs.db
@@ -0,0 +1,34 @@
1
+ repos:
2
+ - repo: local
3
+ hooks:
4
+ # Run the Python and Rust linter and formatter using just command
5
+ - id: format
6
+ name: format
7
+ description: "Format Python and Rust code via just command"
8
+ entry: just format
9
+ language: system
10
+ types_or: [python, pyi]
11
+ pass_filenames: false
12
+ stages: [pre-commit]
13
+
14
+ # Run the Python and Rust type checker using just command
15
+ - id: check
16
+ name: check
17
+ description: "Type check Python and Rust code via just command"
18
+ entry: just check
19
+ language: system
20
+ types_or: [python, pyi]
21
+ pass_filenames: false
22
+ stages: [pre-commit]
23
+
24
+ # Mandatory internal hooks
25
+ - repo: https://github.com/uktrade/github-standards
26
+ rev: v1.4.1 # update periodically with pre-commit autoupdate
27
+ hooks:
28
+ - id: run-security-scan
29
+ verbose: false
30
+ - id: run-personal-data-scan
31
+ verbose: false
32
+ - id: validate-security-scan
33
+ verbose: false
34
+
@@ -0,0 +1 @@
1
+ 3.12.12
@@ -0,0 +1 @@
1
+ * @uktrade/data-matching-service