Skip to content

Release Python SDK v17.0.0#762

Merged
maksimu merged 14 commits intomasterfrom
release/sdk/python/core/v17.0.0
Sep 4, 2025
Merged

Release Python SDK v17.0.0#762
maksimu merged 14 commits intomasterfrom
release/sdk/python/core/v17.0.0

Conversation

@idimov-keeper
Copy link
Collaborator

@idimov-keeper idimov-keeper commented Jul 11, 2025

  • Bump up version to 17.0.0
  • KSM-566 - Added parsing for KSM tokens with prefix
  • KSM-628 - Added GraphSync links
  • KSM-631 - Added links2Remove parameter for files removal
  • KSM-635 - HTTPError should include response object
  • Fixed test for new hard-coded client version

* KSM 566 KSM Python SDK: Add parsing for ksm tokens with prefix (#679)

* Bump up version to 16.6.7

* KSM-566 Added parsing for KSM tokens with prefix

* Fixed test for new harcoded client version
* KSM-628 Added GraphSync links

* Adjusted requestLinks in payload
idimov-keeper and others added 4 commits August 20, 2025 14:37
Added 533 changelog
Adding missing revision attribute to Record mock. It is consumed via kwarg for maximum compatibility
@stas-schaller stas-schaller requested a review from maksimu August 28, 2025 02:35
@socket-security
Copy link

socket-security bot commented Aug 29, 2025

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

* Merge Python SDK and Helper publishing pipelines with SBOM generation

- Combined SDK and Helper publishing into single workflow
- Added proper SBOM generation for both packages with all dependencies
- Fixed version detection to use setup.py versions (17.0.0 for SDK, 1.0.6 for Helper)
- Enhanced SBOM workflow to scan Python virtual environments for complete dependency detection
- Commented out old Helper workflow with migration notice

* Update .github/workflows/reusable.sbom.workflow.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment on lines +8 to +32
runs-on: ubuntu-latest
outputs:
sdk-version: ${{ steps.extract-sdk-version.outputs.version }}
helper-version: ${{ steps.extract-helper-version.outputs.version }}
steps:
- uses: actions/checkout@v3

- name: Extract SDK version
id: extract-sdk-version
working-directory: ./sdk/python/core
run: |
VERSION=$(python3 setup.py --version 2>/dev/null || grep -Po 'version\s*=\s*["\x27]\K[^\x27"]*' setup.py)
echo "SDK Version: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Extract Helper version
id: extract-helper-version
working-directory: ./sdk/python/helper
run: |
VERSION=$(python3 setup.py --version 2>/dev/null || grep -Po 'version\s*=\s*["\x27]\K[^\x27"]*' setup.py)
echo "Helper Version: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT

# Generate and upload SBOM for SDK
generate-sdk-sbom:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 7 months ago

To resolve the issue, you should explicitly declare the permissions: block at the root of the workflow. This will apply to all jobs unless they override it themselves. The minimal required permission for most jobs that only need to check out code is contents: read. Unless a job requires more (e.g., to create releases or modify issues/pull-requests), contents: read is sufficient and safe.

How to fix:

  • At the very top level of .github/workflows/publish.pypi.sdk.yml (below the name: field, and usually above or below the on: field), add:
    permissions:
      contents: read
  • If later you discover some jobs need more, you can add a more specific permissions: block under that job.

What to change:

  • Only edit the workflow YAML as described, no additional methods, imports, or definitions are needed.

Suggested changeset 1
.github/workflows/publish.pypi.sdk.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/publish.pypi.sdk.yml b/.github/workflows/publish.pypi.sdk.yml
--- a/.github/workflows/publish.pypi.sdk.yml
+++ b/.github/workflows/publish.pypi.sdk.yml
@@ -1,4 +1,6 @@
 name: Publish to PyPI (Python SDK & Helper)
+permissions:
+  contents: read
 on:
   workflow_dispatch:
 
EOF
@@ -1,4 +1,6 @@
name: Publish to PyPI (Python SDK & Helper)
permissions:
contents: read
on:
workflow_dispatch:

Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +33 to +46
needs: get-versions
uses: ./.github/workflows/reusable.sbom.workflow.yml
with:
working-directory: ./sdk/python/core
project-name: keeper-secrets-manager-python
project-type: python
project-version: ${{ needs.get-versions.outputs.sdk-version }}
sbom-format: spdx-json
additional-labels: ksm,sdk,python,security
secrets:
MANIFEST_TOKEN: ${{ secrets.MANIFEST_TOKEN }}

# Generate and upload SBOM for Helper
generate-helper-sbom:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI 7 months ago

To address the issue, we should add a permissions: block at the workflow root (so it applies to all jobs) with the minimum permissions required for these jobs. Given the actions performed, many jobs likely only require contents: read (for reading source code), while only those jobs that need to push, create releases, etc. would require elevated write permissions. Since the provided block does not show jobs requiring write actions, a minimal permissions: is sufficient. The fix is to insert, after the name: and on: blocks (before jobs:), a permissions: block such as:

permissions:
  contents: read

This limits GITHUB_TOKEN to read-only access to repository contents (source code, etc.), following least privilege principles. If additional permissions are later needed by specific jobs, they can override this at the job level.

Steps:

  • Insert a permissions: block after the name: and on: blocks, before jobs:.
  • Use the minimal set (contents: read).

Suggested changeset 1
.github/workflows/publish.pypi.sdk.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/publish.pypi.sdk.yml b/.github/workflows/publish.pypi.sdk.yml
--- a/.github/workflows/publish.pypi.sdk.yml
+++ b/.github/workflows/publish.pypi.sdk.yml
@@ -2,6 +2,9 @@
 on:
   workflow_dispatch:
 
+permissions:
+  contents: read
+
 jobs:
   # Extract versions for both SDK and Helper
   get-versions:
EOF
@@ -2,6 +2,9 @@
on:
workflow_dispatch:

permissions:
contents: read

jobs:
# Extract versions for both SDK and Helper
get-versions:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +47 to +60
needs: get-versions
uses: ./.github/workflows/reusable.sbom.workflow.yml
with:
working-directory: ./sdk/python/helper
project-name: keeper-secrets-manager-helper
project-type: python
project-version: ${{ needs.get-versions.outputs.helper-version }}
sbom-format: spdx-json
additional-labels: ksm,helper,python,security
secrets:
MANIFEST_TOKEN: ${{ secrets.MANIFEST_TOKEN }}

# Publish SDK to PyPI
publish-sdk:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI 7 months ago

To fix this problem, the workflow file should have an explicit permissions key defined, either at the top (workflow-level, applies to all jobs unless they override) or on each job as required. Since most of these jobs are using basic tasks and do not appear to push or create content or releases, the minimum necessary is usually contents: read. This setting adheres to the principle of least privilege for most CI workflows.
How to fix:

  • Add the following block at the top (for root-level, applies to all jobs):
    permissions:
      contents: read
  • Insert this block after the workflow name and on: section (i.e., before jobs:).

Implementation steps:

  • Edit .github/workflows/publish.pypi.sdk.yml.
  • Insert the above lines between lines 3 and 5 (after the last on: line, before jobs:).
  • No other changes are required unless further restrictions are desired for individual jobs.

Suggested changeset 1
.github/workflows/publish.pypi.sdk.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/publish.pypi.sdk.yml b/.github/workflows/publish.pypi.sdk.yml
--- a/.github/workflows/publish.pypi.sdk.yml
+++ b/.github/workflows/publish.pypi.sdk.yml
@@ -2,6 +2,9 @@
 on:
   workflow_dispatch:
 
+permissions:
+  contents: read
+
 jobs:
   # Extract versions for both SDK and Helper
   get-versions:
EOF
@@ -2,6 +2,9 @@
on:
workflow_dispatch:

permissions:
contents: read

jobs:
# Extract versions for both SDK and Helper
get-versions:
Copilot is powered by AI and may make mistakes. Always verify output.
maksimu
maksimu previously approved these changes Sep 3, 2025
@maksimu maksimu merged commit a77304b into master Sep 4, 2025
38 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants