Skip to content

feat: optional gh_token to install private-org deps in CI - #56

Open
JarbasAl wants to merge 1 commit into
devfrom
feat/private-dep-auth
Open

feat: optional gh_token to install private-org deps in CI#56
JarbasAl wants to merge 1 commit into
devfrom
feat/private-dep-auth

Conversation

@JarbasAl

@JarbasAl JarbasAl commented Jun 26, 2026

Copy link
Copy Markdown
Member

🤖 Auto-generated by Claude Sonnet 5 via Claude Code — NOT human-reviewed. Verify before acting.

Adds an optional gh_token secret to the reusable build-tests and coverage workflows. When a caller passes it, git is configured (insteadOf) to authenticate clones of a private-org dependency during pre_install_pip. No-op when unset, so all existing callers are unaffected.

Use case: a public repo whose CI installs an unpublished/private sibling package from a branch ref.

Token-scoping model: the insteadOf rewrite targets only https://github.com/<repository_owner>/, derived from github.repository_owner, not all of github.com. That means only fetches under the calling repo's own org get the token attached — a malicious build backend belonging to some unrelated dependency in the same pre_install_pip list cannot trigger the rewrite and read the token via git config. The always() cleanup step still runs to remove the config entry at the end of the job as defense in depth, but it is no longer the only thing standing between the token and an unrelated dependency's build code. Both workflows also fail fast (::error:: + exit 1) if gh_token is set on a pull_request_target-triggered run, since that trigger is the classic "pwn request" shape: secrets are available while building fork-controlled code. The header comment and the secret's description: state this explicitly so a caller wiring this up sees the warning before using it.

The license-check.yml whitelist additions (httpx, psycopg2-binary) that were bundled into the original version of this PR have been dropped. They are unrelated to the token feature, and they are not superseded by dev's #98 (which fixed a different bug — the FAIL_LICENSES/EXCLUDE_LICENSES env-var read, already merged). The whitelist additions still have merit and should go out as their own PR against license-check.yml, which is itself a reusable workflow and would carry the same canary obligation independently.

This PR falls under the downstream-canary rule for reusable-workflow changes: it should not merge until a canary run exercises the touched workflow (build-tests.yml or coverage.yml) from a downstream repo pointed at this branch — a real or throwaway private-org dependency, confirming the authenticated clone succeeds and the token is gone from ~/.gitconfig after the job, and separately confirming the pull_request_target guard actually fails the job when triggered that way. No canary has been run as part of this rework.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The build and coverage workflows add optional GitHub dependency authentication with cleanup, while the license whitelist and documentation add package exceptions and expanded requirement matching.

Changes

Private dependency Git authentication

Layer / File(s) Summary
Git authentication flow
.github/workflows/build-tests.yml, .github/workflows/coverage.yml
Both workflows accept an optional gh_token, temporarily rewrite GitHub clone URLs for pre_install_pip, and remove the rewrite even when dependency installation fails.

License whitelist updates

Layer / File(s) Summary
License exclusion matching
.github/workflows/license-check.yml, docs/license-whitelist.md
The whitelist adds httpx and psycopg2-binary, accepts additional package-name separators, and matches resolved requirements with versions, markers, URLs, or end-of-string suffixes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding an optional gh_token for installing private organization dependencies in CI.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/private-dep-auth

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build-tests.yml:
- Around line 91-102: The git authentication step in the workflow is leaving a
global token rewrite behind in `~/.gitconfig`, which can expose `GH_DEP_TOKEN`
to later steps. Update the `Authenticate git for private dependencies` step so
the `git config --global url."https://x-access-token:...".insteadOf` setting is
only applied for the `pre_install_pip` phase, or add a following cleanup step
with `always()` to remove that global config immediately after. Keep the fix
localized around the existing `Authenticate git for private dependencies` step.

In @.github/workflows/coverage.yml:
- Around line 128-139: The git authentication rewrite in the private
dependencies step leaves a global `insteadOf` rule behind, which can leak into
later operations such as the Pages deploy push. Update the workflow around the
Authenticate git for private dependencies step to add an immediate cleanup using
the same git config key so the token rewrite is removed right after pre-install;
use the existing authenticate step name and the git config
`url."https://x-access-token:${GH_DEP_TOKEN}`@github.com/`".insteadOf` setting as
the identifiers to locate and reverse.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d7e401b9-73c3-45c2-b219-c287ae0735dd

📥 Commits

Reviewing files that changed from the base of the PR and between f7bff0c and 52516ef.

📒 Files selected for processing (2)
  • .github/workflows/build-tests.yml
  • .github/workflows/coverage.yml

Comment thread .github/workflows/build-tests.yml
Comment thread .github/workflows/coverage.yml
@JarbasAl
JarbasAl force-pushed the feat/private-dep-auth branch from 52516ef to c0e558d Compare July 4, 2026 01:46
@JarbasAl
JarbasAl marked this pull request as draft July 4, 2026 01:49
@JarbasAl
JarbasAl force-pushed the feat/private-dep-auth branch from c0e558d to 7c2e579 Compare July 9, 2026 11:46
@JarbasAl
JarbasAl marked this pull request as ready for review July 9, 2026 14:07
@JarbasAl
JarbasAl force-pushed the feat/private-dep-auth branch from 16a500b to a8bd1e6 Compare July 30, 2026 23:07

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/license-check.yml (1)

237-245: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not pass the PCRE through pip-licenses --filter-strings.

--filter-strings is a Unicode-cleanup flag, not package exclusion or regex matching. The unquoted expansion also splits the regex at embedded spaces, which makes the JSON extraction fail and the fallback write []. Run pip-licenses without that option and filter the JSON in Python before computing totals.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/license-check.yml around lines 237 - 245, Update the
license-check workflow around the pip-licenses invocation to remove
--filter-strings and avoid passing the PCRE through EXCLUDE_ARGS. Capture the
complete pip-licenses JSON, then apply the exclusion pattern in the existing
Python processing step before calculating totals, preserving valid JSON output
and fallback behavior.
.github/workflows/build-tests.yml (1)

84-84: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Disable credential persistence on the main checkout.

The first actions/checkout step runs in a job with later untrusted shell steps (pip install and dependency-auth setup). Since persist-credentials defaults to true, the ambient GITHUB_TOKEN remains configured for local Git operations for those later steps.

🔒 Proposed fix
       - uses: actions/checkout@v7
+        with:
+          persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-tests.yml at line 84, Update the main
actions/checkout step to disable credential persistence by setting
persist-credentials to false, ensuring later untrusted shell steps cannot access
the ambient GITHUB_TOKEN through local Git configuration.

Source: Linters/SAST tools

🧹 Nitpick comments (3)
.github/workflows/build-tests.yml (2)

109-138: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated Authenticate/Cleanup git-auth logic across both reusable workflows. The exact same token rewrite/cleanup pattern is copy-pasted in both files, and the prior review already had to flag the missing-cleanup gap twice (once per file) for the same underlying logic — a sign this should live in one place.

  • .github/workflows/build-tests.yml#L109-L138: extract the Authenticate/Cleanup steps into a shared composite action (e.g. _gh_automations/actions/git-auth) parameterized by the token, and call it here.
  • .github/workflows/coverage.yml#L141-L171: call the same composite action instead of duplicating the block.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-tests.yml around lines 109 - 138, Extract the
duplicated git authentication and cleanup steps into a shared composite action
at _gh_automations/actions/git-auth, parameterized by the GitHub token and
preserving cleanup after dependency installation. Replace the existing blocks in
.github/workflows/build-tests.yml lines 109-138 and
.github/workflows/coverage.yml lines 141-171 with calls to that action, passing
each workflow’s token input; both sites require direct changes.

109-119: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cleanup correctly addresses the prior review's cleanup gap.

The always()-gated cleanup step right after Pre-install pip requirements resolves the previously-flagged issue of the global insteadOf rewrite leaking into later steps. This exact block is duplicated near-identically in coverage.yml; see consolidated comment for a DRY suggestion.

Also applies to: 127-138

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-tests.yml around lines 109 - 119, The Git
authentication setup is duplicated in build-tests.yml and coverage.yml.
Consolidate the shared authentication logic into a reusable workflow component
or shared action, then replace both inline blocks with that shared
implementation while preserving the existing conditional and GH_DEP_TOKEN
behavior.
.github/workflows/coverage.yml (1)

141-151: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cleanup correctly addresses the prior review's cleanup gap, including the Pages deploy path.

The always()-gated cleanup and its comment explicitly calling out the Pages git push risk shows the concern from the prior review was well understood. This block is duplicated near-identically in build-tests.yml; see consolidated comment for a DRY suggestion.

Also applies to: 159-171

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/coverage.yml around lines 141 - 151, Consolidate the
duplicated “Authenticate git for private dependencies” setup shared by the
coverage and build-tests workflows into one reusable workflow step or action.
Preserve the pre_install_pip condition, GH_DEP_TOKEN secret, git URL rewrite,
and informational message while having both workflows invoke the shared
implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build-tests.yml:
- Around line 121-125: Update the “Pre-install pip requirements” step in
.github/workflows/build-tests.yml lines 121-125 and
.github/workflows/coverage.yml lines 153-157 by passing inputs.pre_install_pip
through a PRE_INSTALL_PIP step environment variable, then invoke uv pip install
with "$PRE_INSTALL_PIP" instead of interpolating the input directly in the shell
command.

In `@docs/license-whitelist.md`:
- Line 38: Correct the psycopg2-binary whitelist rationale to reflect that the
OpenSSL exception does not remove the remaining LGPL obligations, or remove the
whitelist entry if it is not approved. Apply the same policy decision to the
inline license list in .github/workflows/license-check.yml lines 190-199 and the
regex branch in docs/license-whitelist.md lines 47-55; update each site
consistently, with no other direct changes required.

---

Outside diff comments:
In @.github/workflows/build-tests.yml:
- Line 84: Update the main actions/checkout step to disable credential
persistence by setting persist-credentials to false, ensuring later untrusted
shell steps cannot access the ambient GITHUB_TOKEN through local Git
configuration.

In @.github/workflows/license-check.yml:
- Around line 237-245: Update the license-check workflow around the pip-licenses
invocation to remove --filter-strings and avoid passing the PCRE through
EXCLUDE_ARGS. Capture the complete pip-licenses JSON, then apply the exclusion
pattern in the existing Python processing step before calculating totals,
preserving valid JSON output and fallback behavior.

---

Nitpick comments:
In @.github/workflows/build-tests.yml:
- Around line 109-138: Extract the duplicated git authentication and cleanup
steps into a shared composite action at _gh_automations/actions/git-auth,
parameterized by the GitHub token and preserving cleanup after dependency
installation. Replace the existing blocks in .github/workflows/build-tests.yml
lines 109-138 and .github/workflows/coverage.yml lines 141-171 with calls to
that action, passing each workflow’s token input; both sites require direct
changes.
- Around line 109-119: The Git authentication setup is duplicated in
build-tests.yml and coverage.yml. Consolidate the shared authentication logic
into a reusable workflow component or shared action, then replace both inline
blocks with that shared implementation while preserving the existing conditional
and GH_DEP_TOKEN behavior.

In @.github/workflows/coverage.yml:
- Around line 141-151: Consolidate the duplicated “Authenticate git for private
dependencies” setup shared by the coverage and build-tests workflows into one
reusable workflow step or action. Preserve the pre_install_pip condition,
GH_DEP_TOKEN secret, git URL rewrite, and informational message while having
both workflows invoke the shared implementation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 34ec3b38-d21c-430d-9a1f-9b018b6fce5f

📥 Commits

Reviewing files that changed from the base of the PR and between 52516ef and a8bd1e6.

📒 Files selected for processing (4)
  • .github/workflows/build-tests.yml
  • .github/workflows/coverage.yml
  • .github/workflows/license-check.yml
  • docs/license-whitelist.md

Comment on lines 121 to 125
- name: Pre-install pip requirements
if: ${{ inputs.pre_install_pip != '' }}
run: |
# shellcheck disable=SC2086
uv pip install ${{ inputs.pre_install_pip }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Files:"
git ls-files .github/workflows build-tests? coverage? 2>/dev/null || true
echo

for f in .github/workflows/build-tests.yml .github/workflows/coverage.yml; do
  if [ -f "$f" ]; then
    echo "===== $f ====="
    wc -l "$f"
    echo
    rg -n "pre_install_pip|gh_token|Authenticate|insteadOf|uv pip install|git config|git -C|clean|credential.helper|GH_TOKEN|TOKEN|GITHUB_TOKEN|permissions|pre-install" "$f" -C 3
    echo
  fi
done

echo "===== workflow snippets around affected steps ====="
python3 - <<'PY'
from pathlib import Path
for f in Path(".github/workflows").glob("*.yml"):
    text=f.read_text()
    if "pre_install_pip" in text or "gh_token" in text:
        lines=text.splitlines()
        for i,l in enumerate(lines,1):
            if "pre_install_pip" in l or "gh_token" in l or "Authenticate" in l or "insteadOf" in l or (f.name in ("build-tests.yml","coverage.yml") and i in range(80,180)):
                print(f"{f}:{i}:{l}")
PY

Repository: OpenVoiceOS/gh-automations

Length of output: 23736


🌐 Web query:

zizmor template-injection workflow template expression injected into run command shellcheck disable SC2086 GH_DEP_TOKEN

💡 Result:

Zizmor is a static analysis tool for GitHub Actions designed to identify security issues, including template injection vulnerabilities [1][2]. Template Injection in GitHub Actions Template injection occurs when GitHub Actions expression syntax—typically delimited by ${{... }}—is used directly within a run: command or other execution context [3]. Because these expressions are evaluated before the shell executes the command, attacker-controllable inputs (such as github.event.issue.title or github.event.pull_request.head.ref) can be used to inject arbitrary shell commands [3][4]. Zizmor Remediation Pattern To remediate template injection findings, zizmor recommends moving the template expansion out of the command string and into an environment variable [3]. This ensures that the shell handles the value as data rather than executable code [3]. For example, an unsafe workflow step: run: echo "Processing issue: ${{ github.event.issue.title }}" Should be rewritten as: run: echo "Processing issue: $ISSUE_TITLE" env: ISSUE_TITLE: ${{ github.event.issue.title }} ShellCheck and SC2086 The reference to SC2086 relates to ShellCheck's warning about double quoting variables to prevent word splitting and globbing [5]. While zizmor focuses on workflow-level template injection (where the injection happens before the shell sees the command), developers often encounter ShellCheck warnings like SC2086 when they follow the remediation advice of moving variables into env blocks. After moving a variable to an env block, you must ensure the resulting script uses proper quoting (e.g., "$ISSUE_TITLE") to satisfy ShellCheck [5][6]. Regarding "GH_DEP_TOKEN" There is no specific zizmor audit rule named "GH_DEP_TOKEN." It is likely that this refers to a common scenario where developers use a token (such as GITHUB_TOKEN or a custom repository secret) to authenticate during CI, and zizmor flags these if they are used insecurely or with excessive permissions [2]. When running zizmor, providing a GitHub API token (e.g., via --gh-token or the GH_TOKEN environment variable) enables online audits, which can help zizmor verify repository-level contexts [7][1].

Citations:


Pass pre_install_pip through an environment variable before running the install command.

These run: blocks interpolate ${{ inputs.pre_install_pip }} directly, so a crafted value can be injected as shell script after the insteadOf rewrite has been written to ~/.gitconfig. Add PRE_INSTALL_PIP to the step env and run uv pip install "$PRE_INSTALL_PIP" in both workflows.

  • .github/workflows/build-tests.yml#L121-L125
  • .github/workflows/coverage.yml#L153-L157
🧰 Tools
🪛 zizmor (1.28.0)

[error] 125-125: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)

📍 Affects 2 files
  • .github/workflows/build-tests.yml#L121-L125 (this comment)
  • .github/workflows/coverage.yml#L153-L157
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-tests.yml around lines 121 - 125, Update the
“Pre-install pip requirements” step in .github/workflows/build-tests.yml lines
121-125 and .github/workflows/coverage.yml lines 153-157 by passing
inputs.pre_install_pip through a PRE_INSTALL_PIP step environment variable, then
invoke uv pip install with "$PRE_INSTALL_PIP" instead of interpolating the input
directly in the shell command.

Source: Linters/SAST tools

Comment thread docs/license-whitelist.md Outdated
| `httpx` | `BSD-3-Clause` | Error | Permissive (BSD-3-Clause). Its dev-prerelease builds (e.g. `httpx==1.0.dev3`), which resolve under `UV_PRERELEASE=allow`, ship without parseable license metadata, so the checker reports category `Error`. The stable license is permissive and Apache-2.0 compatible; the flag is a prerelease-metadata false positive. Used as an unmodified imported HTTP-client library. |
| `marisa-trie` | `MIT AND (BSD-2-Clause OR LGPL-2.1-or-later)` | WeakCopyleft | Dual-licensed. The checker flags the whole expression because of the LGPL-2.1-or-later option, but the license grants an explicit `BSD-2-Clause OR LGPL` choice — we elect the permissive BSD-2-Clause. We use `marisa-trie` as an unmodified, imported static-trie library (pulled transitively via `langcodes`/`language_data`, and thus by many OVOS repos that resolve language data) — no source is modified or redistributed, so the BSD-2-Clause terms govern and it is compatible with Apache 2.0 distribution. |
| `paho-mqtt` | `EPL-2.0 OR BSD-3-Clause` | WeakCopyleft | Dual-licensed. The license grants an explicit `EPL-2.0 OR BSD-3-Clause` choice — we elect the permissive BSD-3-Clause. The checker flags the whole expression because of the EPL-2.0 option. We use `paho-mqtt` as an unmodified, imported MQTT client library (a direct dependency of the `*2mqtt` bridges and other OVOS/TigreGotico MQTT integrations) — no source is modified or redistributed, so the BSD-3-Clause terms govern and it is compatible with Apache 2.0 distribution. |
| `psycopg2-binary` | `LGPL-3.0-or-later WITH exception` | WeakCopyleft | The PostgreSQL driver carries an LGPL license with a linking/binary exception. It is consumed as an unmodified imported library (we do not modify or redistribute its source), so the LGPL obligations are not triggered and it is safe under the donor policy. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== candidate files =="
git ls-files | grep -E '(^|/)(license-check\.ya?ml|license-whitelist\.md)$' || true

echo "== relevant snippets =="
for f in docs/license-whitelist.md .github/workflows/license-check.yml; do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    nl -ba "$f" | sed -n '30,55p;184,204p'
  fi
done

echo "== searches for psycopg2/licensing text =="
rg -n "psycopg2|LGPL|license|WeakCopyleft|exception|pilosus|license-check" docs .github -S || true

echo "== current git diff stat/context for docs license files =="
git diff -- docs/license-whitelist.md .github/workflows/license-check.yml | sed -n '1,220p'

Repository: OpenVoiceOS/gh-automations

Length of output: 347


🌐 Web query:

psycopg2 license psycopg2-binary LGPL 3 license exception OpenSSL binary exception

💡 Result:

The psycopg2 and psycopg2-binary packages are both licensed under the GNU Lesser General Public License (LGPL) version 3 or later [1][2][3]. This license includes a specific exception that explicitly permits linking the software with the OpenSSL library (or modified versions of OpenSSL that use the same license) and distributing the resulting linked combinations [1][2][4]. Key points regarding these licenses: - Licensing Terms: Both the source distribution (psycopg2) and the binary distribution (psycopg2-binary) are subject to these same terms [1][5][2]. - OpenSSL Exception: The license text provided by the project explicitly states that copyright holders give permission to link the program with OpenSSL, and you may, but are not required to, extend this exception to your own modified versions of the files [1][2]. - Practical Application: The LGPL, including this specific exception, is intended to allow the use of the library in proprietary software, provided the library code itself remains under the LGPL and its associated terms [6]. - Use of psycopg2-binary: While the license is the same, the documentation advises that the psycopg2-binary package is intended for development and testing; for production use, it is recommended to build the package from source [7][8]. For the most accurate and legally binding information, you should consult the official LICENSE file included in the source distribution of the package you are using [1][4].

Citations:


🌐 Web query:

LGPL 3 linking exception binary exception does usage as unmodified imported library create obligations

💡 Result:

Using an LGPLv3-licensed library as an unmodified imported library in your software creates specific compliance obligations if you distribute the resulting work, although it does not typically require you to open-source your own application code [1][2]. When you link your application to an LGPLv3 library (forming a "Combined Work"), you must comply with the requirements in Section 4 of the LGPLv3, which include [3][4]: 1. Providing Notice: You must give prominent notice with each copy of the Combined Work stating that the library is used in it and that the library and its use are covered by the LGPLv3 [3][4]. 2. Providing License Copies: You must accompany the Combined Work with a copy of the GNU GPLv3 and the LGPLv3 license documents [3][4]. 3. Copyright Notices: If your application displays copyright notices during execution, you must include the copyright notice for the library among them, along with a reference directing the user to the license documents [3][4]. 4. Source Code Provision or Alternative: You must satisfy one of the options in Section 4d [3][5]. A common method is to use a "suitable shared library mechanism" (Section 4d1), which allows users to replace the LGPL library with a modified, interface-compatible version [6][3]. If you use this approach, you are not required to distribute the source code of your own application [1][7]. Alternatively, you can provide the "Minimal Corresponding Source" for the library and the "Corresponding Application Code" (Section 4d0) to allow users to relink the application [3][5]. If a project includes a specific "LGPL 3 Linking Exception," this is a supplemental permission granted by the copyright holders [8]. This exception typically waives certain obligations—such as the requirement to provide "Minimal Corresponding Source" or specific "Installation Information"—making compliance easier for those who link to the library [8]. In summary, linking an unmodified LGPLv3 library does not force your proprietary application to become open source, provided you respect the library's license terms regarding attribution, the provision of the license texts, and the user's ability to replace or update the library component [1][7][2].

Citations:


🌐 Web query:

psycopg2 LICENSE LGPL exception text "You may" "OpenSSL" "modified versions"

💡 Result:

Psycopg2 is licensed under the GNU Lesser General Public License (LGPL), version 3 or later [1][2]. Because the LGPL can be incompatible with the original OpenSSL license, the Psycopg2 copyright holders provide a specific "OpenSSL exception" that permits linking and distributing the library with OpenSSL [1][3]. The official text of this exception, as found in the Psycopg2 source files and documentation, is as follows: In addition, as a special exception, the copyright holders give permission to link this program with the OpenSSL library (or with modified versions of OpenSSL that use the same license as OpenSSL), and distribute linked combinations including the two. You must obey the GNU Lesser General Public License in all respects for all of the code used other than OpenSSL. If you modify file(s) with this exception, you may extend this exception to your version of the file(s), but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. If you delete this exception statement from all source files in the program, then also delete it here [1][4]. This exception ensures that users can legally link Psycopg2 with OpenSSL—a common requirement for secure PostgreSQL connections—without violating the terms of the LGPL [3]. Users who modify the code have the option to either keep or remove this exception [1][4].

Citations:


Correct the psycopg2-binary exception rationale before keeping it whitelisted.

The package license says the OpenSSL special exception permits distribution when linked with OpenSSL, but still requires compliance with LGPL for the rest of the code. The current “binary exception/no obligations” rationale is therefore inaccurate.

  • Update docs/license-whitelist.md#L38 to describe the actual obligations/approved treatment or remove the exception.
  • Apply the same policy decision to the inline list in .github/workflows/license-check.yml#L190-L199 and the regex branch in docs/license-whitelist.md#L47-L55.
    [lower_effort_and_high_reward]
📍 Affects 2 files
  • docs/license-whitelist.md#L38-L38 (this comment)
  • .github/workflows/license-check.yml#L190-L199
  • docs/license-whitelist.md#L47-L55
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/license-whitelist.md` at line 38, Correct the psycopg2-binary whitelist
rationale to reflect that the OpenSSL exception does not remove the remaining
LGPL obligations, or remove the whitelist entry if it is not approved. Apply the
same policy decision to the inline license list in
.github/workflows/license-check.yml lines 190-199 and the regex branch in
docs/license-whitelist.md lines 47-55; update each site consistently, with no
other direct changes required.

Adds an optional gh_token secret to the reusable build-tests and
coverage workflows so a caller can authenticate git clones of a
private-org dependency during pre_install_pip. No-op when unset;
existing callers are unaffected.

Security hardening on top of the original proposal:

- The insteadOf rewrite is scoped to the calling repository's own org
  (github.repository_owner) instead of all of github.com. A previous
  version rewrote every subsequent github.com fetch for the rest of
  the job, so any unrelated package pulled in by pre_install_pip could
  read the token out of ~/.gitconfig from its own build backend before
  the always() cleanup step ever ran. Scoping the rewrite means only
  fetches under the caller's own org get the token attached at all.
- Both workflows now fail fast if gh_token is set on a
  pull_request_target-triggered run, and the header comment plus the
  secret's description spell out why: pull_request_target is the
  classic "pwn request" shape (secrets available while building
  fork-controlled code), and a caller wiring gh_token into that trigger
  would hand a live token to attacker-controlled build code.

Dropped from this PR: the bundled license-check.yml whitelist changes
(httpx, psycopg2-binary) were unrelated to the token feature and are
not superseded by dev's #98 (which fixed a different bug, the
FAIL_LICENSES/EXCLUDE_LICENSES env-var read). They stand on their own
merits as a separate, reusable-workflow change subject to the same
canary requirement, and should ship as their own PR rather than riding
along here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@JarbasAl
JarbasAl force-pushed the feat/private-dep-auth branch from a8bd1e6 to f24849f Compare September 2, 2026 08:45
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.

1 participant