diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..3205926 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,41 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: + +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- Version [e.g. 22] + +**Smartphone (please complete the following information):** + +- Device: [e.g. iPhone6] +- OS: [e.g. iOS8.1] +- Browser [e.g. stock browser, safari] +- Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..0ffef9b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,27 @@ + + +### Type of Change + + + +### Description + + + +### Checklist + + + +- [ ] Test code against a test environment and not just on a local cluster +- [ ] Reference relevant issue(s) where applicable and close them after merging +- [ ] Update any documentation and relevant `CHANGELOG.md` files \ No newline at end of file diff --git a/.github/workflows/auto-back-merge.yml b/.github/workflows/auto-back-merge.yml new file mode 100644 index 0000000..111d548 --- /dev/null +++ b/.github/workflows/auto-back-merge.yml @@ -0,0 +1,93 @@ +# SPDX-License-Identifier: Apache-2.0 +# © Crown Copyright 2026. This work has been developed by the National Digital Twin Programme and is legally attributed to the Department for Business and Trade (UK) as the governing entity. + +# This workflow is triggered when a pull request is merged into the main branch and automatically merges the main branch back into develop to keep it up to date. +# If the merge fails (e.g., due to conflicts), a manual intervention is required. The workflow generates a Job summary of the merge attempt. +name: Auto Back-merge Main to Develop + +on: + pull_request: + types: + - closed + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + merge-main-to-develop: + + permissions: {} + + name: Back-merge Main to Develop + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + + steps: + + - name: Generate Sync Token + id: sync-token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 + with: + app-id: ${{ secrets.NODE_NET_REPOSITORY_WRITER_APP_CLIENT_ID }} + private-key: ${{ secrets.NODE_NET_REPOSITORY_WRITER_APP_PRIVATE_KEY }} + permission-contents: write + permission-workflows: write + + - name: Merge main into develop and Generate Summary + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + github-token: ${{ steps.sync-token.outputs.token }} + script: | + const prNumber = context.payload.pull_request.number; + const mergedBy = context.payload.sender.login; + const prUrl = context.payload.pull_request.html_url; + + try { + // Attempt to merge main into develop, use the api to ensure the commit + // is gpg signed. + await github.rest.repos.merge({ + owner: context.repo.owner, + repo: context.repo.repo, + base: 'develop', + head: 'main', + commit_message: `Merge branch 'main' into 'develop' (#${prNumber})` + }); + + let summaryText = + `## Sync Main to Develop ✅ + + Successfully triggered a merge of \`main\` into \`develop\` following the closure of PR #${prNumber}. + + **Original PR Merged by**: @${mergedBy} + + [View Original PR](${prUrl}) + `; + + await core.summary.addRaw(summaryText).write(); + } catch (error) { + const finalErrorMessage = error.message || error; + // Write failure summary + summaryText = + `## Sync Main to Develop ❌ + + Failed to trigger a merge of \`main\` into \`develop\`! This is usually due to a merge conflict. Please resolve it manually by opening a PR from \`main\` to \`develop\`. + + ### Error Details: + + \`\`\`text + ${finalErrorMessage} + \`\`\` + + **Original PR Merged by**: @${mergedBy} + + [View Original PR](${prUrl}) + `; + + await core.summary.addRaw(summaryText).write(); + + // Fail the workflow step + core.setFailed(`Merge failed: ${finalErrorMessage}`); + } diff --git a/.github/workflows/oss-checker.yml b/.github/workflows/oss-checker.yml new file mode 100644 index 0000000..dc6e45f --- /dev/null +++ b/.github/workflows/oss-checker.yml @@ -0,0 +1,564 @@ +# SPDX-License-Identifier: Apache-2.0 +# © Crown Copyright 2025. This work has been developed by the National Digital Twin Programme and is legally attributed to the Department for Business and Trade (UK) as the governing entity. + +name: Run OSS check helper + +on: + pull_request: + types: + - opened + - synchronize + - reopened + - labeled + - unlabeled + workflow_dispatch: + +jobs: + oss-checks: + permissions: + contents: read + if: github.actor != 'dependabot[bot]' && + (github.event.repository.private == false || + (github.event.repository.private == true && + contains(join(github.event.pull_request.labels.*.name), 'oss-preparation'))) + runs-on: ubuntu-latest + outputs: + summary-table: ${{ steps.summarise_results.outputs.summaryTable }} + has-results: ${{ steps.summarise_results.outputs.hasResults }} + + steps: + - name: Fetch GitHub App token for target repo + id: target_token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 + with: + app-id: ${{ secrets.OSPO_WORKFLOW_APP_ID }} + private-key: ${{ secrets.OSPO_WORKFLOW_PRIVATE_KEY }} + permission-contents: read + + - name: Fetch GitHub App token for OSPO source repo (read-only) + id: ospo_token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 + with: + app-id: ${{ secrets.OSPO_WORKFLOW_APP_ID }} + private-key: ${{ secrets.OSPO_WORKFLOW_PRIVATE_KEY }} + owner: National-Node-Net + repositories: ospo-resources + permission-contents: read + + - name: Checkout target repository + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + token: ${{ steps.target_token.outputs.token }} + + - name: Checkout OSPO source repository + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + repository: National-Node-Net/ospo-resources + path: ospo-resources + token: ${{ steps.ospo_token.outputs.token }} + + - name: Checkout archetypes source repository + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + repository: National-Node-Net/archetypes + path: archetypes + + - name: Fetch Repository Metadata + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} + with: + script: | + const { owner, repo } = context.repo; + const { writeFileSync } = require('fs'); + + // Check specifically for 'develop' branch existence + let hasDevelopBranch = false; + try { + await github.rest.repos.getBranch({ + owner, + repo, + branch: 'develop', + }); + hasDevelopBranch = true; + } catch (error) { + if (error.status !== 404) { + core.warning(`Error checking for develop branch: ${error.message}`); + } + } + + const metadata = { + repository: { + defaultBranch: process.env.DEFAULT_BRANCH, + hasDevelopBranch: hasDevelopBranch + } + }; + + const rawMetadata = JSON.stringify(metadata, null, 2); + + core.info('Content for repository-metadata.json:'); + core.info(rawMetadata); + + writeFileSync('repository-metadata.json', rawMetadata); + core.info('Generated repository-metadata.json for policy context.'); + + - name: Install Conftest + env: + FALLBACK_VERSION: '0.67.1' + run: | + set -euo pipefail + + install_conftest() { + local version="$1" + local file_name="conftest_${version}_Linux_x86_64.deb" + curl --proto "=https" --fail -sSL "https://github.com/open-policy-agent/conftest/releases/download/v${version}/${file_name}" -o "${file_name}" + sudo dpkg -i "${file_name}" + rm -f "${file_name}" + } + + LATEST_VERSION="$(curl --proto "=https" --fail -s "https://api.github.com/repos/open-policy-agent/conftest/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+' || true)" + + if [[ -n "${LATEST_VERSION}" ]] && install_conftest "${LATEST_VERSION}"; then + echo "Installed latest Conftest version: ${LATEST_VERSION}" + else + echo "Failed to install latest Conftest. Falling back to version ${FALLBACK_VERSION}." + install_conftest "${FALLBACK_VERSION}" + fi + + - name: Run Policy Checks + id: run_conftest + run: | + conftest test .github/dependabot.yml \ + -p ospo-resources/tools/policy-as-code/policy \ + --data repository-metadata.json \ + --namespace github.dependabot \ + --output json > policy-report.json || true + + - name: Process Policy Results + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const { existsSync, readFileSync, writeFileSync } = require('fs'); + + let resultJson = []; + if (existsSync('policy-report.json')) { + try { + const rawContent = readFileSync('policy-report.json', 'utf8'); + if (rawContent.trim()) { + resultJson = JSON.parse(rawContent); + } + } catch(e) { + core.error(`Failed to parse policy-report.json: ${e.message}`); + core.setFailed(`Failed to parse policy-report.json: ${e.message}`); + return; + } + } + + const results = resultJson.map(r => { + const failureReasons = (r.failures || []).map(f => f.msg); + return { + path: r.filename, + status: failureReasons.length > 0 ? 'failed' : 'passed', + failureReasons: failureReasons, + checks: { + namespace: r.namespace, + successes: r.successes + } + }; + }); + + const passed = results.filter((result) => result.status === 'passed').length; + const failed = results.length - passed; + const score = results.length > 0 ? Number((passed / results.length).toFixed(2)) : 0; + + const prHead = context.payload.pull_request?.head; + const repoFullName = prHead?.repo?.full_name ?? process.env.GITHUB_REPOSITORY ?? 'unknown/unknown'; + const commitSha = prHead?.sha ?? process.env.GITHUB_SHA ?? 'unknown'; + + const report = { + runMetadata: { + timestamp: new Date().toISOString(), + repo: repoFullName, + commit: commitSha, + checkType: 'policy', + }, + files: results, + summary: { + total: results.length, + passed, + failed, + score, + }, + }; + + const reportPath = 'policy-results.json'; + writeFileSync(reportPath, JSON.stringify(report, null, 2)); + core.info(`Wrote policy summary to ${reportPath}`); + + if (failed > 0) { + core.setFailed('Policy checks failed for one or more files.'); + } else { + core.info('All policy checks passed.'); + } + + - name: Test for presence of OSS files and variation from templated content + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + if: success() || failure() + with: + script: | + const { existsSync, readFileSync, writeFileSync } = require('fs'); + + const checklistPath = 'ospo-resources/oss-checklist-files.txt'; + const checklist = readFileSync(checklistPath, 'utf8') + .split('\n') + .map((line) => line.trim()) + .filter((line) => line && !line.startsWith('#')); + + const results = []; + const prHead = context.payload.pull_request?.head; + const repoFullName = prHead?.repo?.full_name ?? process.env.GITHUB_REPOSITORY ?? 'unknown/unknown'; + const commitSha = prHead?.sha ?? process.env.GITHUB_SHA ?? 'unknown'; + + for (const relativePath of checklist) { + const record = { + path: relativePath, + status: 'passed', + checks: { + exists: false, + differsFromTemplate: null, + }, + failureReasons: [], + }; + + const targetPath = relativePath; + const archetypePath = `archetypes/${relativePath}`; + + const fileExists = existsSync(targetPath); + record.checks.exists = fileExists; + + if (!fileExists) { + record.status = 'failed'; + record.failureReasons.push('missing or misnamed'); + core.info(`Missing or misnamed OSS file in target repository: ${targetPath}`); + results.push(record); + continue; + } + + const targetContent = readFileSync(targetPath, 'utf8'); + + if (existsSync(archetypePath)) { + const archetypeContent = readFileSync(archetypePath, 'utf8'); + const differsFromTemplate = targetContent !== archetypeContent; + record.checks.differsFromTemplate = differsFromTemplate; + + if (!differsFromTemplate) { + record.failureReasons.push('unchanged from archetype template'); + core.info(`OSS file unchanged from archetypes template: ${targetPath}`); + } else { + core.info(`OSS file present and different from the archetypes template: ${targetPath}`); + } + } else { + record.checks.differsFromTemplate = null; + core.info(`Template file missing for ${relativePath}; skipping template comparison.`); + } + + record.status = record.failureReasons.length > 0 ? 'failed' : 'passed'; + results.push(record); + } + + const passed = results.filter((result) => result.status === 'passed').length; + const failed = results.length - passed; + const score = results.length > 0 ? Number((passed / results.length).toFixed(2)) : 0; + + const report = { + runMetadata: { + checklistFile: checklistPath, + timestamp: new Date().toISOString(), + repo: repoFullName, + commit: commitSha, + checkType: 'OSS', + }, + files: results, + summary: { + total: results.length, + passed, + failed, + score, + }, + }; + + const reportPath = 'oss-results.json'; + writeFileSync(reportPath, JSON.stringify(report, null, 2)); + core.info(`Wrote checklist summary to ${reportPath}`); + + if (failed > 0) { + const failedFiles = results + .filter((result) => result.status === 'failed') + .map((result) => result.path); + core.setFailed(`The following files failed checks:\n${failedFiles.join('\n')}`); + } else { + core.info('All OSS files are present and have been updated from their original templated content.'); + } + + - name: Check GitHub template files are present + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + if: success() || failure() + with: + script: | + const { existsSync, writeFileSync } = require('fs'); + + core.info('Checking for pull request and issue template files'); + + const filesToCheck = [ + '.github/PULL_REQUEST_TEMPLATE.md', + '.github/ISSUE_TEMPLATE/bug_report.md', + '.github/ISSUE_TEMPLATE/feature_request.md', + ]; + + const results = filesToCheck.map((filePath) => { + const exists = existsSync(filePath); + return { + path: filePath, + status: exists ? 'passed' : 'failed', + checks: { + exists, + differsFromTemplate: null, + }, + failureReasons: exists ? [] : ['missing or misnamed'], + }; + }); + + const passed = results.filter((result) => result.status === 'passed').length; + const failed = results.length - passed; + const score = results.length > 0 ? Number((passed / results.length).toFixed(2)) : 0; + + const prHead = context.payload.pull_request?.head; + const report = { + runMetadata: { + timestamp: new Date().toISOString(), + repo: prHead?.repo?.full_name ?? process.env.GITHUB_REPOSITORY ?? 'unknown/unknown', + commit: prHead?.sha ?? process.env.GITHUB_SHA ?? 'unknown', + checkType: 'template', + }, + files: results, + summary: { + total: results.length, + passed, + failed, + score, + }, + }; + + const reportPath = 'template-results.json'; + writeFileSync(reportPath, JSON.stringify(report, null, 2)); + core.info(`Wrote template checklist summary to ${reportPath}`); + + if (failed > 0) { + const missingTemplates = results + .filter((result) => result.status === 'failed') + .map((result) => result.path); + + core.info(''); + core.info('Required GitHub template files were not found or did not match expected casing:'); + missingTemplates.forEach((file) => core.info(` - ${file}`)); + core.info(''); + core.info('These files help improve project collaboration and are considered best practice.'); + core.info('These need to be included in repository contents to improve the developer and repository consumer experience.'); + core.setFailed('Missing or misnamed GitHub template files.'); + } else { + core.info('Required pull request and issue template files present.'); + } + + - name: Generate summary + id: summarise_results + if: always() + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const { existsSync, readFileSync } = require('fs'); + + const reportFiles = [ + 'oss-results.json', + 'template-results.json', + 'policy-results.json', + ]; + + const reports = reportFiles + .filter((reportPath) => { + const present = existsSync(reportPath); + if (!present) { + core.info(`Summary step skipping missing report: ${reportPath}`); + } + return present; + }) + .map((reportPath) => JSON.parse(readFileSync(reportPath, 'utf8'))); + + if (reports.length === 0) { + core.info('No report files found; skipping combined summary.'); + core.setOutput('hasResults', 'false'); + return; + } + + const allResults = reports.flatMap((report) => + report.files.map((file) => ({ + ...file, + category: report.runMetadata?.checkType ?? 'unknown', + repo: report.runMetadata?.repo ?? process.env.GITHUB_REPOSITORY ?? 'unknown/unknown', + commit: report.runMetadata?.commit ?? process.env.GITHUB_SHA ?? 'unknown', + })), + ); + + const combinedTableMarkdown = [ + '| 📄 File | ✅ Result | 🧾 Details |', + '| :--- | :---: | :--- |', + ...allResults.map((result) => { + const href = `https://github.com/${result.repo}/blob/${result.commit}/${result.path}`; + const details = result.failureReasons.length > 0 + ? result.failureReasons.join('; ') + : 'Compliant'; + const statusLabel = result.status === 'passed' ? '🟢 Pass' : '🔴 Fail'; + return `| [${result.path}](${href}) | ${statusLabel} | ${details} |`; + }), + ].join('\n'); + + const total = allResults.length; + const passed = allResults.filter((result) => result.status === 'passed').length; + const failed = total - passed; + const score = total > 0 ? (passed / total) * 100 : 0; + const summary = { total, passed, failed, score }; + + const overallStatus = summary.failed === 0 + ? '🎉 Overall status: PASS (all files compliant).' + : '⚠️ Overall status: FAIL (see table below for details).'; + + const summaryMarkdown = [ + '| 📊 Total Files | 🟢 Passed | 🔴 Failed | 🧮 Score |', + '| ---: | ---: | ---: | ---: |', + `| ${summary.total} | ${summary.passed} | ${summary.failed} | ${summary.score.toFixed(0)}% |` + ].join('\n'); + + const prHead = context.payload.pull_request?.head; + const repoFullName = prHead?.repo?.full_name ?? process.env.GITHUB_REPOSITORY ?? 'unknown/unknown'; + const fullSha = prHead?.sha ?? process.env.GITHUB_SHA ?? ''; + const shortSha = fullSha?.slice(0, 7) ?? 'unknown'; + const commitUrl = fullSha + ? `https://github.com/${repoFullName}/commit/${fullSha}` + : null; + const commitLine = commitUrl + ? `Results from commit [\`${shortSha}\`](${commitUrl}).` + : `Results from commit \`${shortSha}\`.`; + + await core.summary + .addRaw('# OSS Check Results ⚙️\n', true) + .addRaw(`\n${combinedTableMarkdown}\n`, true) + .addRaw('\n# Summary 🏁\n', true) + .addRaw(`\n${overallStatus}\n`, true) + .addRaw(`\n${summaryMarkdown}\n`, true) + .addRaw(`\n${commitLine}\n`, true) + .write(); + + core.setOutput('hasResults', 'true'); + core.setOutput('summaryTable', summaryMarkdown); + + if (summary.failed > 0) { + core.setFailed('OSS checks detected one or more failing files.'); + } + + - name: Upload OSS result artifacts + if: ${{ steps.summarise_results.outputs.hasResults == 'true' }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: oss-checks-${{ github.run_id }} + retention-days: 30 + path: | + oss-results.json + template-results.json + policy-results.json + + comment-on-results: + needs: oss-checks + if: >- + always() && + github.event_name == 'pull_request' && + needs.oss-checks.outputs.has-results == 'true' + runs-on: ubuntu-latest + + permissions: + contents: read + pull-requests: write + + steps: + - name: Comment with OSS summary + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + SUMMARY_TABLE: ${{ needs.oss-checks.outputs.summary-table }} + JOB_RESULT: ${{ needs.oss-checks.result }} + with: + script: | + const { owner, repo } = context.repo; + const prNumber = context.payload.pull_request?.number; + + if (!prNumber) { + core.info('No pull request context; skipping comment step.'); + return; + } + + const jobSummaryUrl = `https://github.com/${owner}/${repo}/actions/runs/${context.runId}`; + const prHead = context.payload.pull_request?.head; + const headCommitSha = prHead?.sha ?? process.env.GITHUB_SHA ?? ''; + const shortSha = headCommitSha ? headCommitSha.slice(0, 7) : 'unknown'; + const runResult = process.env.JOB_RESULT?.toLowerCase() ?? ''; + const isFailure = runResult === 'failure'; + + const marker = ''; + const heading = isFailure + ? '## ⚠️ OSS Checks Failed' + : '## ✅ OSS Checks Passed'; + const narration = isFailure + ? 'One or more OSS checks failed in this run.' + : 'All tracked OSS checks passed in this run.'; + + const bodySections = [ + heading, + narration, + process.env.SUMMARY_TABLE, + `Results from commit ${shortSha}, view the full [job summary↗️](${jobSummaryUrl}) for detailed results.` + ]; + + const existingComments = await github.paginate( + github.rest.issues.listComments, + { + owner, + repo, + issue_number: prNumber, + per_page: 100, + }, + ); + + const previous = existingComments.find((comment) => + comment.body?.includes(marker), + ); + + if(previous) { + bodySections.push(':recycle: This comment has been updated with latest results.'); + } + + const body = `${marker}\n${bodySections.join('\n\n')}\n${marker}`; + + if (previous) { + core.info(`Updating existing OSS summary comment (${previous.id}).`); + await github.rest.issues.updateComment({ + owner, + repo, + comment_id: previous.id, + body, + }); + } else { + core.info('Creating new OSS summary comment.'); + await github.rest.issues.createComment({ + owner, + repo, + issue_number: prNumber, + body, + }); + } diff --git a/.github/workflows/publish-github-release.yml b/.github/workflows/publish-github-release.yml new file mode 100644 index 0000000..3f32ba1 --- /dev/null +++ b/.github/workflows/publish-github-release.yml @@ -0,0 +1,146 @@ +# SPDX-License-Identifier: Apache-2.0 +# © Crown Copyright 2025. This work has been developed by the National Digital Twin Programme and is legally attributed to the Department for Business and Trade (UK) as the governing entity. + +# This workflow is triggered when a pull request is merged into the main branch +# from a release/* or hotfix/* branch. It extracts the release version from the source branch, +# generates a Software Bill of Materials (SBOM) using the GitHub API, +# creates a Git tag with the version, and publishes a GitHub release including the SBOM file. + +name: Generate SBOM, Tag and Publish GitHub Release + +on: + pull_request: + types: + - closed + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + versioning: + if: | + github.event.pull_request.merged == true && + (startsWith(github.head_ref, 'release/') || startsWith(github.head_ref, 'hotfix/')) + permissions: + contents: read + + name: Extract Release Version + runs-on: ubuntu-latest + outputs: + version: ${{ steps.extract_version.outputs.VERSION }} + steps: + - name: Extract Version from Source Branch Name + id: extract_version + env: + HEAD_REF: ${{ github.head_ref }} + run: | + SOURCE_BRANCH="$HEAD_REF" + VERSION=$(echo "$SOURCE_BRANCH" | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+') + + if [ -z "$VERSION" ]; then + echo "Error: No semantic release version found in source branch: $SOURCE_BRANCH" + exit 1 + fi + + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + + - name: Validate Version Format (Semantic Versioning) + env: + VERSION: ${{ env.VERSION }} + run: | + if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Error: Invalid version format found. Expected semantic version in release or hotfix branch name (e.g., release/0.9.0 or hotfix/0.9.1)" + exit 1 + fi + + - name: Print Tag Version + id: print_tag + env: + EXTRACTED_VERSION: ${{ steps.extract_version.outputs.version }} + run: | + echo "Identified release semantic version: $EXTRACTED_VERSION" + + generate-sbom: + permissions: + contents: read + + name: Generate SPDX SBOM + runs-on: ubuntu-latest + needs: [versioning] + steps: + - name: Checkout Code + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + + - name: Generate SPDX SBOM + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + run: | + # Call GitHub API to generate SBOM + api_response=$(curl -sSL \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $GITHUB_TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "$GITHUB_API_URL/repos/$REPO/dependency-graph/sbom") + + # Extract nested "sbom" object into a valid SPDX file + echo "$api_response" | jq '.sbom' > sbom.spdx.json + + - name: Upload SBOM Artifact + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: sbom + path: sbom.spdx.json + + create-git-tag: + permissions: + contents: write + + name: Create Git Tag + needs: [versioning, generate-sbom] + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + fetch-depth: 0 + + - name: Create Git Tag + uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 # v1.7.2 + with: + tag: "v${{ needs.versioning.outputs.version }}" + message: "Release v${{ needs.versioning.outputs.version }}" + force_push_tag: true + # Tag the HEAD commit from the merged release branch not the merge commit to + # ensure the tag points to the correct source code state for the release. + # This ensures that the release tag is also visible on any branch which does + # not contain the merge commit such as develop. + commit_sha: ${{ github.event.pull_request.head.sha }} + + create-git-release: + permissions: + contents: write + + name: Create GitHub Release + needs: [versioning, generate-sbom, create-git-tag] + runs-on: ubuntu-latest + steps: + - name: Download SBOM Artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: sbom + + - name: Create GitHub Release + uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1 + with: + tag_name: "v${{ needs.versioning.outputs.version }}" + name: "Release v${{ needs.versioning.outputs.version }}" + body: "Automated release for version ${{ needs.versioning.outputs.version }}. For details of fixes, new features and changes in this release, please see [CHANGELOG.md](${{ github.server_url }}/${{ github.repository }}/blob/main/CHANGELOG.md)." + draft: false + prerelease: false + files: | + sbom.spdx.json diff --git a/ACKNOWLEDGEMENTS.md b/ACKNOWLEDGEMENTS.md new file mode 100644 index 0000000..14f269c --- /dev/null +++ b/ACKNOWLEDGEMENTS.md @@ -0,0 +1,40 @@ +# Acknowledgements + +**Repository:** `node-lib` +**Description:** `Recognises suppliers, partner organisations, and other contributors to the repository's development.` + +The National Digital Twin Programme (NDTP) would like to acknowledge the contributions of various organisations and individuals who have supported the development of this repository. + +## Organisational contributions + +Over time, the following organisations have provided technical expertise, development support, and domain knowledge that have contributed to the evolution of this project: + +i.e. +- [Supplier A] +- [Supplier B] +- [Supplier C] +- [Supplier D] +(etc.) + + + +We are grateful for the collaboration that has helped shape this repository. + +## Individual contributions + +For a list of individual contributors who have made direct commits to this repository, see GitHub’s auto-generated contributor insights: [Contributors](https://github.com/National-Node-Net/node-lib/graphs/contributors). + +--- + +**Note:** This acknowledgment does not confer any legal rights, ownership, or imply ongoing involvement by any of the named organisations or individuals. All contributions are made in accordance with the repository’s licensing terms. + +© Crown Copyright 2025. This work has been developed by the National Digital Twin Programme and is legally attributed to the Department for Business and Trade (UK) as the governing entity. + +Licensed under the NDTP InnerSource Licence – Version 1.0. + +For full licensing terms, see [LICENSE.md](LICENSE.md). + diff --git a/CHANGELOG.md b/CHANGELOG.md index 1eda2e6..4e791ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +Licensed under the NDTP InnerSource Licence – Version 1.0. For full licensing terms, see [LICENSE.md](LICENSE.md). + +## [3.1.2] - 2026-07-16 + +### Changed + +- Alignment of GitHub actions to new organisation. + + ## [3.1.1](https://github.com/telicent-oss/telicent-lib/compare/v3.1.0...v3.1.1) (2024-10-28) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..00be292 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,83 @@ +# Code of Conduct + +**Repository:** `node-lib` +**Description:** `Defines expected behaviors, rules, and the enforcement process to ensure professional engagement.` + +## Introduction + +The National Digital Twin Programme (NDTP) is committed to fostering an open, inclusive, and professional environment in all its repositories. +This Code of Conduct outlines the expectations for behaviour when engaging with NDTP repositories, including issue reporting, documentation feedback, +and discussions with repository maintainers. + +By participating in this repository, you agree to follow this Code of Conduct. + +--- + +## Expected Behaviour + +All contributors, maintainers, and public users are expected to: + +- **Be respectful and professional** – Treat others with courtesy and professionalism. +- **Communicate constructively** – Offer feedback that is clear, helpful, and focused on improving the repository. +- **Engage in a welcoming manner** – Encourage participation and provide a positive experience for all users. +- **Provide relevant and clear information** – When submitting issues or feedback, be specific and include details that help maintainers understand the request. + +--- + +## Unacceptable Behaviour + +The following behaviour will not be tolerated: + +- **Harassment, discrimination, or personal attacks** – Any form of offensive behaviour towards individuals or groups. +- **Trolling, disruptive comments, or inflammatory language** – Intentionally provoking arguments or making non-constructive comments. +- **Excessive demands or unrealistic expectations of maintainers** – This includes repeated requests for prioritisation outside of programme priorities. +- **Spamming or promotional content** – Off-topic discussions unrelated to the repository's purpose. +- **Disclosing sensitive information** – Sharing security vulnerabilities or confidential details outside of the responsible disclosure process. + +--- + +## Reporting Concerns + +If you believe someone is violating this Code of Conduct, please report it by following these steps: + +1. **For general issues** – Raise a concern with the repository maintainers by emailing ndtp@businessandtrade.gov.uk. + +2. **For security-related concerns** – Follow the responsible disclosure process outlined in [SECURITY.md](./SECURITY.md). + +3. **For incidents requiring escalation** – NDTP reserves the right to take appropriate action, including restricting access to contributors who violate this policy. + +All reports will be reviewed confidentially, and NDTP will take appropriate action to address the issue. + +--- + +## Enforcement + +Violations of this Code of Conduct may result in: + +- A formal warning +- Temporary suspension from participation +- Permanent exclusion from engaging with NDTP repositories + +Decisions on enforcement are made at NDTP’s discretion. + +--- + +## Scope + +This Code of Conduct applies to all interactions in NDTP repositories, including but not limited to: + +- Issue tracking and reporting +- Documentation suggestions and feedback +- Discussions with maintainers +- Any other interactions in public NDTP projects + +--- + +**Maintained by the National Digital Twin Programme (NDTP).** + +© Crown Copyright 2025. This work has been developed by the National Digital Twin Programme and is legally attributed to the Department for Business and Trade (UK) as the governing entity. + +Licensed under the NDTP InnerSource Licence – Version 1.0. + +For full licensing terms, see [LICENSE.md](LICENSE.md). + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d1f054a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,123 @@ +# Contribution Guidelines + +**Repository:** `node-lib` +**Description:** `Guidelines for issue reporting, documentation suggestions, and NDTP’s controlled contribution model.` + +Thank you for your interest in this repository. + +The National Digital Twin Programme (NDTP) develops and maintains this repository in collaboration with suppliers and partner organisations, including other parts of government and their suppliers. + +NDTP follows a **Cathedral open-source governance model** where code may be made **publicly available** under open-source licences, and collaboration is invited from **approved partners**. Contributions from the general public are not currently accepted, but **feedback, issue reporting, and documentation suggestions are encouraged**. + +If you want to see which suppliers and organisations have contributed to this repository in the past, refer to [ACKNOWLEDGEMENTS.md](./ACKNOWLEDGEMENTS.md) and the GitHub contributor insights page at [Contributors](https://github.com/National-Node-Net/node-lib/graphs/contributors). + +--- + +## How You Can Contribute + +Public users and NDTP partners are encouraged to engage in the following ways: + +- **Reporting bugs and issues** – If you find a problem, please open a GitHub issue. +- **Suggesting documentation improvements** – Propose clarifications or additions to the existing documentation. +- **Providing structured feedback** – If you have suggestions for improvements, let us know via GitHub Issues. + +While we review all input, NDTP prioritises development based on programme goals, supplier development cycles, and strategic objectives. + +NDTP does not currently accept **public pull requests (PRs) or direct code contributions** to this repository. Contributions are limited to **approved suppliers and partner organisations** under formal agreements. + +For details on repository maintainers and how to contact them, refer to [MAINTAINERS.md](./MAINTAINERS.md). + +--- + +## Reporting Issues + +If you encounter a bug, error, or inconsistency, please follow these steps: + +1. Check for an existing issue under [Issues](../../issues). +2. Open a new issue if no one has reported it yet. Use one of the provided issue templates. +3. Provide a clear, detailed description of the issue, including steps to reproduce it if applicable. +4. Label the issue appropriately (bug, documentation, enhancement, etc.). + +For security-related issues, do not submit a public issue. Instead, follow our [Responsible Disclosure process](./SECURITY.md). + +--- + +## Documentation Feedback + +If you find an error in the documentation, need more clarity, or have suggestions for additional documentation, you can: + +1. Open a GitHub issue under the `documentation` label. +2. Describe the improvement you are suggesting, including references to existing documentation where applicable. +3. Submit structured feedback – specific examples help us make updates faster. + +We prioritise documentation updates based on user impact and alignment with programme goals. + +--- + +## NDTP's Approach to Open-Source Development + +- **Development is led by approved suppliers and partners** who have been engaged through a formal process. +- **We welcome feedback and ideas**, but implementation is subject to programme priorities. + +To see what we’re working on, check out our [Project Roadmap](../../projects). If no roadmap is currently available, please note that it is being actively developed and will be published in due course. + +--- + +## Branching Strategy + +This repository follows a **GitFlow-based branching model** to manage development efficiently. Key conventions include: + +- **Main Branch (`main`)**: The stable, production-ready branch. Only tested and approved changes are merged here. +- **Develop Branch (`develop`)**: The integration branch where features and fixes are merged before reaching `main`. +- **Feature Branches (`feature/*`)**: Used for new developments. Named based on functionality, e.g., `feature/new-auth-method`. +- **Bugfix Branches (`bugfix/*`)**: Address minor issues in `develop` before release. +- **Release Branches (`release/*`)**: Used to prepare a new stable release, ensuring final testing and versioning updates. +- **Hotfix Branches (`hotfix/*`)**: Critical fixes applied directly to `main` and merged back into `develop`. + +For more details, refer to [GitFlow Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow). + +--- + +## Pull Request Policy + +To maintain high-quality contributions, NDTP enforces the following **minimum pull request (PR) requirements** for approved contributors: + +- **All PRs must be reviewed by at least one maintainer** before merging. +- **PRs should reference a corresponding issue** where applicable. +- **Code changes must include relevant tests** to ensure stability. +- **Commit messages should follow best practices**, including referencing issue numbers when relevant. +- **Documentation updates should accompany PRs that impact functionality.** +- **PRs should use "squash and merge" as the preferred merge strategy**, ensuring a clean history. +- **Feature and bugfix branches should be deleted after merge** to keep the repository tidy. +- **Force pushing to the `main` branch is strictly prohibited** to protect repository integrity. +- **CI builds must pass before merging** to enforce basic validation checks. + +--- + +## Contribution Licensing + +By submitting feedback, documentation suggestions, or issue reports, you acknowledge that any resulting changes will be licensed under the same open-source terms as this repository: + +- Code contributions (if ever accepted) will be licensed under Apache 2.0. +- Documentation updates will be licensed under OGL v3.0. + +For supplier-contracted development, NDTP ensures that all contributions align with Crown Copyright and public sector open-source standards. + +--- + +## Repository Maintainers + +For details on who maintains this repository and how to contact them, refer to [MAINTAINERS.md](./MAINTAINERS.md). + +NDTP repository maintainers review reported issues, evaluate documentation suggestions, and oversee ongoing development. + +--- + +**Maintained by the National Digital Twin Programme (NDTP).** + +© Crown Copyright 2025. This work has been developed by the National Digital Twin Programme and is legally attributed to the Department for Business and Trade (UK) as the governing entity. + +Licensed under the NDTP InnerSource Licence – Version 1.0. + +For full licensing terms, see [LICENSE.md](LICENSE.md). + diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..7120b21 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,96 @@ +# NDTP InnerSource License + +**Repository:** `node-lib` +**Description:** `Defines the licensing terms for the source code in this repository.` + +--- + +## Version + +**NDTP InnerSource License – Version 1.0** +**Issued by:** National Digital Twin Programme (NDTP) +**Effective Date:** 9 July 2025 + +--- + +## Copyright + +© Crown Copyright 2025. +This work has been developed by the **National Digital Twin Programme (NDTP)** and is legally attributed to the **Department for Business and Trade (UK)** as the governing entity. + +This repository is **not open source**. +Its contents are licensed under the terms of this **NDTP InnerSource License**, unless and until it is formally published under an approved open source licence by the NDTP Management Team. + +--- + +## 1. Purpose + +This repository supports InnerSource development practices within the NDTP. It enables collaborative development by internal teams and authorised suppliers, in a controlled and non-public environment. + +--- + +## 2. Licensing Status + +This work is **not licensed under an open source licence**. +It must not be published, distributed, sublicensed, or shared externally without the **explicit, written approval** of the NDTP Management Team. + +> The NDTP InnerSource Licence permits internal collaboration only. No part of this repository may be used or disclosed beyond the authorised delivery context. + +--- + +## 3. Intellectual Property + +All rights, including intellectual property rights in this code and associated materials, are owned by the NDTP. + +Where contributions are made by suppliers or delivery partners, those contributions are accepted on the basis that **full intellectual property rights** belong to the Crown under the terms of their contract. + +--- + +## 4. Permitted Use + +You may: + +- View, use, and modify the code as required to fulfil your responsibilities under the NDTP. +- Collaborate within authorised NDTP teams and with approved suppliers under existing contracts. + +You may not: + +- Share, publish, or release this repository publicly. +- Fork, clone, or redistribute this code outside approved NDTP channels. +- Apply any license other than the NDTP InnerSource License to this repository or its contents, unless instructed by the NDTP Management Team. + +--- + +## 5. Future Publication + +At the discretion of the NDTP Management Team, this repository may later be designated for release under an approved open source licence. + +Any such designation must follow NDTP's internal governance processes. + +> Until such designation is explicitly made and executed, this repository remains **confidential and proprietary**. + +--- + +## 6. Enforcement + +Any unauthorised disclosure, publication, or redistribution of this repository or its contents may: + +- Constitute a breach of contract +- Trigger formal investigation +- Result in legal, disciplinary, or commercial action, including revocation of access rights + +All actions will be escalated to the NDTP Management Team for appropriate handling. + +--- + +## Contact + +For all enquiries regarding licensing, publication status, or contributor rights, please contact: + +**NDTP Management Team** +Department for Business and Trade (UK) +NDTP@BUSINESSANDTRADE.GOV.UK + +--- + +**End of NDTP InnerSource Licence – Version 1.0** diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 0000000..c38b3b7 --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,116 @@ +# Maintainers + +**Repository:** `node-lib` +**Description:** `Lists maintainers responsible for reviewing issues, security, and documentation updates.` + +## Introduction + +This repository is maintained by the **National Digital Twin Programme (NDTP)** in collaboration with contracted suppliers and partner organisations. + +Maintainers are responsible for reviewing issues, evaluating documentation suggestions, and overseeing +supplier-led development. + +If you need to report a problem, suggest improvements, or seek guidance on using this repository, please refer to the contacts listed below. + +--- + +## Responsibilities of Maintainers + +Maintainers are responsible for: + +- Reviewing and responding to **GitHub Issues**. +- Assessing **documentation updates and corrections**. +- Overseeing **code updates** developed by NDTP-approved suppliers. +- Ensuring compliance with **NDTP’s licensing and security policies**. + +NDTP does not accept public code contributions, but we welcome **bug reports and documentation feedback**. + +--- + +## Current Maintainers + +| Name | Organisation | Role | Contact | +|-------------------|------------------------|--------------------|------------------------| +| [Maintainer Name] | [NDTP / Supplier Name] | Lead Maintainer | [email@example.org] | +| [Maintainer Name] | [NDTP / Supplier Name] | Security Contact | [security@example.org] | +| [Maintainer Name] | [NDTP / Supplier Name] | Documentation Lead | [docs@example.org] | + +For general issues, please **open a GitHub issue** rather than contacting maintainers directly. + +--- + +## Escalation Contacts + +If you need to escalate an issue that has not been addressed within a reasonable time: + +1. **Security vulnerabilities** – Follow the responsible disclosure process in [SECURITY.md](./SECURITY.md). +2. **Governance and policy queries** – Contact NDTP at **ndtp@businessandtrade.gov.uk**. +3. **Urgent operational issues** – If an issue affects critical systems, contact the **Lead Maintainer** listed above. + +--- + +## Updating this File + +Maintainer details may change over time. If you are an NDTP-approved maintainer and need to update this file, please submit a request through the designated NDTP repository administrator. + +--- + +**Maintained by the National Digital Twin Programme (NDTP).** + +© Crown Copyright 2025. This work has been developed by the National Digital Twin Programme and is legally attributed to the Department for Business and Trade (UK) as the governing entity. + +Licensed under the NDTP InnerSource Licence – Version 1.0. + +For full licensing terms, see [LICENSE.md](LICENSE.md). + + diff --git a/README.md b/README.md index 246f163..381825b 100644 --- a/README.md +++ b/README.md @@ -19,4 +19,11 @@ pip install node-lib ## Usage -For documentation on how to use node-lib, please see the [documentation index](https://github.com/National-Digital-Twin/node-lib/blob/main/docs/index.md). +For documentation on how to use node-lib, please see the [documentation index](https://github.com/National-Node-Net/node-lib/blob/main/docs/index.md). + +## Licensing + +This repository, including all source code, documentation, configuration files, and related materials, is licensed under the: + +**NDTP InnerSource Licence – Version 1.0** +See [LICENSE.md](LICENSE.md) for the full licence text. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..b3ab6e9 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,73 @@ +# Security Policy + +**Repository:** `node-lib` +**Description:** `Details the responsible disclosure process for security vulnerabilities.` + +## Responsible Disclosure + +The National Digital Twin Programme (NDTP) follows a **Coordinated Vulnerability Disclosure (CVD)** process to ensure security risks are addressed responsibly. + +By reporting security vulnerabilities through the responsible channels, you agree to: +- Not disclose details of the vulnerability publicly until NDTP has had a reasonable opportunity to fix it. +- Provide NDTP with adequate time to assess and mitigate the risk. +- Act in good faith and follow ethical security research principles. + +NDTP reserves the right to take necessary action against unauthorised or harmful security testing activities. + +--- + +## Reporting Security Issues + +NDTP takes security seriously and encourages responsible reporting of vulnerabilities. + +If you believe you have found a security vulnerability in this repository, **please do not report it publicly**. Instead, follow the steps below to disclose the issue responsibly. + +### **How to Report a Security Issue** + +1. **Do not open a public issue on GitHub.** Instead, report security concerns via email to **ndtp@businessandtrade.gov.uk**. +2. **Provide detailed information about the vulnerability**, including: + - A clear description of the issue. + - Steps to reproduce the vulnerability. + - Potential impact or risk level. + - Any suggested mitigation strategies. +3. **Allow time for assessment and response.** NDTP will review the report and respond within **10 working days** to acknowledge receipt. +4. **Cooperate with NDTP to validate and address the issue.** + +Once a resolution has been identified, NDTP may choose to: + - **Release a patch** as part of the next scheduled update. + - **Issue a security advisory** if the issue is critical. + - **Provide acknowledgments** where appropriate (subject to NDTP’s disclosure policy). + +--- + +## Scope + +This security policy applies to: +- All NDTP repositories released as open source. +- Code, configuration files, and infrastructure deployed as part of NDTP’s **Integration Architecture (IA)**. +- **Third-party dependencies** included within NDTP repositories. If you identify a vulnerability in a third-party component that NDTP relies on (e.g., outdated libraries or known security flaws in dependencies), we encourage you to report it. + +Out of scope: +- Issues related to third-party services or software **not used within NDTP repositories**. +- Vulnerabilities in user environments that are unrelated to this repository. +- Unsolicited security testing or penetration testing without NDTP’s explicit permission. + +--- + +## Security Best Practices + +To help maintain security across NDTP repositories, we follow these principles: +- Dependencies are **scanned and updated regularly** (e.g., using automated tools like Dependabot). +- Sensitive credentials **must not be included** in public repositories. +- Security patches are applied in a timely manner, with priority given to critical vulnerabilities. + +--- + +**Maintained by the National Digital Twin Programme (NDTP).** + +© Crown Copyright 2025. This work has been developed by the National Digital Twin Programme and is legally attributed to the Department for Business and Trade (UK) as the governing entity. + +Licensed under the NDTP InnerSource Licence – Version 1.0. + +For full licensing terms, see [LICENSE.md](LICENSE.md). + diff --git a/docs/index.md b/docs/index.md index a0fcc4c..27daeba 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,18 +4,18 @@ Actions provide automation and progress monitoring of data processing tasks. A component within Integration Architecture Node will typically be implemented using one or more of the subclasses of `Action`. -[Actions](https://github.com/National-Digital-Twin/node-lib/blob/main/docs/actions.md) | [Adapters](https://github.com/National-Digital-Twin/node-lib/blob/main/docs/adapters.md) | [Mappers](https://github.com/National-Digital-Twin/node-lib/blob/main/docs/mappers.md) | [Projectors](https://github.com/National-Digital-Twin/node-lib/blob/main/docs/projectors.md) +[Actions](https://github.com/National-Node-Net/node-lib/blob/main/docs/actions.md) | [Adapters](https://github.com/National-Node-Net/node-lib/blob/main/docs/adapters.md) | [Mappers](https://github.com/National-Node-Net/node-lib/blob/main/docs/mappers.md) | [Projectors](https://github.com/National-Node-Net/node-lib/blob/main/docs/projectors.md) ## Record Handling A `DataSource` provides input from a source (e.g. a Kafka consumer), whilst a `DataSink` handles the output (e.g. a Kafka producer). `RecordUtils` manipulates headers. -[DataSource](https://github.com/National-Digital-Twin/node-lib/blob/main/docs/data-sources.md) | [DataSink](https://github.com/National-Digital-Twin/node-lib/blob/main/docs/data-sinks.md) | [RecordUtils](https://github.com/National-Digital-Twin/node-lib/blob/main/docs/record-utils.md) +[DataSource](https://github.com/National-Node-Net/node-lib/blob/main/docs/data-sources.md) | [DataSink](https://github.com/National-Node-Net/node-lib/blob/main/docs/data-sinks.md) | [RecordUtils](https://github.com/National-Node-Net/node-lib/blob/main/docs/record-utils.md) ## Utilities and Helpers node-lib provides a number of features out of the box to support development, configuration, error handling and audit logging. -[Configuration](https://github.com/National-Digital-Twin/node-lib/blob/main/docs/configuration.md) | [Logging](https://github.com/National-Digital-Twin/node-lib/blob/main/docs/logging.md) | [Error Handling](https://github.com/National-Digital-Twin/node-lib/blob/main/docs/error-handling.md) | [Provenance and Audit](https://github.com/National-Digital-Twin/node-lib/blob/main/docs/provenance.md) | [Telemetry](https://github.com/National-Digital-Twin/node-lib/blob/main/docs/telemetry.md) | [SecurityLabel modules](https://github.com/National-Digital-Twin/node-lib/blob/main/docs/security-label-modules.md) +[Configuration](https://github.com/National-Node-Net/node-lib/blob/main/docs/configuration.md) | [Logging](https://github.com/National-Node-Net/node-lib/blob/main/docs/logging.md) | [Error Handling](https://github.com/National-Node-Net/node-lib/blob/main/docs/error-handling.md) | [Provenance and Audit](https://github.com/National-Node-Net/node-lib/blob/main/docs/provenance.md) | [Telemetry](https://github.com/National-Node-Net/node-lib/blob/main/docs/telemetry.md) | [SecurityLabel modules](https://github.com/National-Node-Net/node-lib/blob/main/docs/security-label-modules.md) diff --git a/docs/security-label-modules.md b/docs/security-label-modules.md index 4c63a77..374b80a 100644 --- a/docs/security-label-modules.md +++ b/docs/security-label-modules.md @@ -1,6 +1,6 @@ # SecurityLabel Modules in node-lib -node-lib can be leveraged alongside the [label-builder](https://github.com/National-Digital-Twin/label-builder) to +node-lib can be leveraged alongside the [label-builder](https://github.com/National-Node-Net/label-builder) to facilitate the validation of data headers against a predefined model that encapsulates a security policy framework. While there is no fully operational implementation of policy-based access control (PBAC) at this time, the library allows for the validation of data headers against a chosen model to ensure that all required fields are populated and that the @@ -60,5 +60,5 @@ headers = [('policyInformation', {'DH': data_header_model.model_dump()}), record = RecordUtils.add_headers(record, headers) ``` -Please refer to the documentation of [label-builder](https://github.com/National-Digital-Twin/label-builder) +Please refer to the documentation of [label-builder](https://github.com/National-Node-Net/label-builder) for further information and full use case examples. diff --git a/pyproject.toml b/pyproject.toml index 49890f1..47a58ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,7 +90,7 @@ exclude = [ line-length = 120 [project.urls] -Repository = "https://github.com/National-Digital-Twin/node-lib" +Repository = "https://github.com/National-Node-Net/node-lib" [tool.distutils.bdist_wheel] universal = true