Skip to content

fix: Remediate 2026-08-09 audit findings - #38

Open
soulevilx wants to merge 4 commits into
developfrom
fix/audit-260809-remediation
Open

fix: Remediate 2026-08-09 audit findings#38
soulevilx wants to merge 4 commits into
developfrom
fix/audit-260809-remediation

Conversation

@soulevilx

Copy link
Copy Markdown
Contributor

Summary

Ships the pending transport refactor (JooClientTransportClientTransport, HttpTransport enum, CircuitOpenException, connect timeout, upload content_type guessing) together with fixes from the accompanying audit (audit_260809.md):

  • Bump jooservices/dto to 1.6.0 and jooservices/exceptions to 1.0.0; add psr/log as an explicit direct dependency instead of relying on it transitively.
  • Close real coverage gaps: all 8 guessContentType() branches, FavoriteService::getListPages(), PeopleService::getPhotosPages(), and the PeopleService::getInfo('') guard (coverage 95.03% → 96.63%, giving real margin above the CI's 95% gate).
  • Replace the disabled Gitleaks placeholder in secret-scanning.yml with a working TruffleHog OSS scan (no license required, unlike Gitleaks for org-owned repos).
  • Fix the self-contradictory v2-roadmap.md, which still claimed the circuit breaker/rate limiter were "not wired yet" after they shipped in v2.0.0.
  • De-duplicate the pagination pattern shared by FavoriteService and PeopleService into AbstractRawService::paginatePhotoListMethod().
  • FlickrConfig now rejects connectTimeoutSeconds > timeoutSeconds; FlickrFactory::make() accepts an optional logger; mark a few single-dependency constructor properties readonly.
  • Port ci-triage/release-readiness Claude commands adapted from the jooservices/dto sibling for AI-contributor tooling parity.

Full findings and evidence: audit_260809.md.

Test plan

  • composer ci (lint matrix, static analysis, registry/API-index verification, coverage, consumer smoke test) passes locally
  • Coverage 96.63%, clear of the 95% CI gate
  • composer audit clean, no vulnerability advisories
  • CI green on this PR

🤖 Generated with Claude Code

Transport refactor (JooClientTransport -> ClientTransport, HttpTransport
enum, CircuitOpenException, connect timeout, upload content_type
guessing) plus fixes from the accompanying audit:

- Bump jooservices/dto to 1.6.0 and jooservices/exceptions to 1.0.0;
  add psr/log as an explicit direct dependency instead of relying on
  it transitively.
- Close real coverage gaps: all 8 guessContentType() branches,
  FavoriteService::getListPages(), PeopleService::getPhotosPages(),
  and the PeopleService::getInfo('') guard (95.03% -> 96.63%).
- Replace the disabled Gitleaks placeholder in secret-scanning.yml
  with a working TruffleHog OSS scan (no license required, unlike
  Gitleaks for org-owned repos).
- Fix the self-contradictory v2-roadmap.md, which still claimed the
  circuit breaker/rate limiter were "not wired yet" after they shipped
  in v2.0.0.
- De-duplicate the pagination pattern shared by FavoriteService and
  PeopleService into AbstractRawService::paginatePhotoListMethod().
- FlickrConfig now rejects connectTimeoutSeconds > timeoutSeconds;
  FlickrFactory::make() accepts an optional logger; mark a few
  single-dependency constructor properties readonly.
- Port ci-triage/release-readiness Claude commands adapted from the
  jooservices/dto sibling for AI-contributor tooling parity.

See audit_260809.md for the full findings this addresses.
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 94b4390f-44d6-4c59-a96d-5520fd3c8f5f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests dependencies ci/cd source labels Aug 9, 2026
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov-commenter

codecov-commenter commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.04%. Comparing base (0d720ba) to head (b4380ec).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop      #38      +/-   ##
=============================================
+ Coverage      95.95%   97.04%   +1.08%     
- Complexity       765      776      +11     
=============================================
  Files            124      124              
  Lines           2052     2096      +44     
=============================================
+ Hits            1969     2034      +65     
+ Misses            83       62      -21     
Flag Coverage Δ
unittests 97.04% <100.00%> (+1.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Bring flickr's GitHub Actions in line with sibling packages
(dto, exceptions, client), which already run both scans.
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

9 similar comments
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-advanced-security github-advanced-security AI 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.

Phpmd (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Comment thread .claude/commands/ci-triage.md Fixed
Comment thread .claude/commands/release-readiness.md Fixed

@github-advanced-security github-advanced-security AI 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.

Markdownlint (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

…dacy)

Add the Dependency Review job (security -> dependency-review, PR-only,
non-blocking) and Codacy coverage upload step that all sibling
packages already run, so flickr's CI shape matches the rest of the
jooservices ecosystem: security -> dependency-review/lint -> tests.
@codacy-production

codacy-production Bot commented Aug 9, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🟢 Coverage 100.00% diff coverage

Metric Results
Coverage variation Report missing for 0d720ba1
Diff coverage 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (0d720ba) Report Missing Report Missing Report Missing
Head commit (b4380ec) 1638 1582 96.58%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#38) 112 112 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Copilot AI 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.

Pull request overview

This PR remediates the 2026-08-09 audit findings by shipping the pending transport refactor and tightening reliability/security posture across config validation, pagination helpers, upload multipart handling, docs, dependencies, and CI workflows. It keeps the SDK’s architecture intact (factory → services → raw API → transport) while improving transport configurability and test coverage around previously uncovered branches.

Changes:

  • Introduces ClientTransport (replacing JooClientTransport) with HttpTransport selection, connect timeout support, optional PSR-3 logging/configure hook, and circuit/rate-limit exception mapping.
  • Adds upload multipart content_type guessing and de-duplicates photo-list pagination wiring into AbstractRawService::paginatePhotoListMethod(), with new unit tests and fakes.
  • Updates dependencies (jooservices/*, psr/log) and strengthens CI/security tooling (TruffleHog secret scanning, optional Codacy/Fortify scans, dependency review), plus documentation/changelog updates.

Reviewed changes

Copilot reviewed 39 out of 40 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/Unit/PaginationHelpersTest.php New tests for shared pagination behavior in FavoriteService / PeopleService and PeopleService::getInfo() guard.
tests/Unit/MultipartRequestBuilderTest.php New tests covering multipart build/close behavior and content_type guessing branches.
tests/Unit/JooClientTransportTest.php Removes obsolete unit tests for renamed transport.
tests/Unit/ConfigAndDtoTest.php Adds config validation tests for connect-timeout constraints.
tests/Unit/ClientTransportTest.php New unit tests for ClientTransport config wiring and exception mapping.
tests/Unit/ClientAndParserTest.php Updates upload and transport tests to use ClientTransport and assert multipart content type.
tests/Fakes/FakePagedPhotoListRawApiService.php Adds a fake raw service to support pagination tests with photos.photo response shape.
tests/Fakes/FakeHttpClient.php Extends fake client with head() to match expanded client surface.
src/Testing/MethodAwareFlickrFakeTransport.php Marks injected transport readonly for immutability.
src/Testing/FlickrFake.php Switches fake factory wiring from JooClientTransport to ClientTransport.
src/Services/PeopleService.php Refactors getPhotosPages() to use shared pagination helper.
src/Services/FavoriteService.php Refactors getListPages() to use shared pagination helper.
src/Services/AbstractRawService.php Adds paginatePhotoListMethod() shared helper for photos.photo paginated endpoints.
src/FlickrFactory.php Adds optional PSR-3 logger parameter and forwards it to default transport creation.
src/Exceptions/TransportException.php Makes TransportException extensible (non-final) to support specialized subclasses.
src/Exceptions/CircuitOpenException.php New Flickr-domain exception for circuit-open transport short-circuits.
src/Enums/HttpTransport.php New enum selecting HTTP backend for ClientTransport.
src/Config/FlickrConfig.php Adds connectTimeoutSeconds + httpTransport and centralizes validations, including connect>timeout rejection.
src/Client/MultipartRequestBuilder.php Adds extension-based content_type guessing and updates multipart shape docs.
src/Client/JooClientTransport.php Removes old transport implementation (replaced by ClientTransport).
src/Client/ClientTransport.php New transport adapter with connect timeout, transport backend selection, logger/configure hooks, and exception mapping.
src/Cache/Psr16Cache.php Marks cache dependency readonly.
README.md Documents optional httpTransport and connect timeout settings in the quick-start snippet.
docs/05-maintenance/04-v1-to-v2-migration.md Notes current jooservices/client requirement (^2.4).
docs/05-maintenance/03-v2-roadmap.md Marks roadmap as delivered and corrects stale transport/circuit wiring notes.
docs/04-development/08-ai-contributor-workflow.md Updates transport path reference to ClientTransport.
docs/04-development/07-ci-cd.md Updates secret scanning workflow description (TruffleHog).
docs/01-getting-started/02-configuration.md Adds/updates documentation for timeouts, transport backend, host-scoped circuit breaker, logging, and stores.
composer.lock Locks updated dependency versions (client/dto/exceptions and related transitive updates).
composer.json Bumps jooservices/client to ^2.4, jooservices/exceptions to ^1.0, adds direct psr/log.
CHANGELOG.md Adds Unreleased entries documenting transport/config/upload/pagination/CI changes.
audit_260809.md Adds the audit report referenced by the PR description.
ai/skills/README.md Points contributors to new .claude/commands/ tooling.
AGENTS.md Updates architecture map transport naming (ClientTransport).
.github/workflows/secret-scanning.yml Replaces placeholder with real TruffleHog OSS scanning across PR/push/history.
.github/workflows/fortify.yml Adds optional Fortify AST workflow (skips cleanly when secrets absent).
.github/workflows/codacy.yml Adds Codacy Analysis CLI workflow with SARIF upload.
.github/workflows/ci.yml Adds dependency review job and optional Codacy coverage upload.
.claude/commands/release-readiness.md Adds Claude Code command for release readiness checks aligned with repo workflow.
.claude/commands/ci-triage.md Adds Claude Code command for structured CI failure triage aligned with repo workflow.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread README.md
Comment on lines 37 to +39
'retryTimes' => 2,
// Optional: 'httpTransport' => HttpTransport::Curl, // requires ext-curl
// Optional: 'connectTimeoutSeconds' => 5,
@unlink($path);
}

$photo = $multipart[array_search('photo', array_column($multipart, 'name'), true)];
@unlink($path);
}

$photo = $multipart[array_search('photo', array_column($multipart, 'name'), true)];
@unlink($path);
}

$photo = $multipart[array_search('photo', array_column($multipart, 'name'), true)];
$this->assertContains('title', $names);
$this->assertContains('is_public', $names);

$title = $multipart[array_search('title', $names, true)];
file_put_contents($path, 'bytes');

$multipart = $this->builder->build($path, []);
$photo = $multipart[array_search('photo', array_column($multipart, 'name'), true)];
$this->assertContains('photo', $names);
$this->assertContains('oauth_signature', $names);
$this->assertContains('is_friend', $names);
$this->assertSame('image/jpeg', $photo['content_type'] ?? null);
@soulevilx soulevilx changed the title fix: remediate 2026-08-09 audit findings fix: Remediate 2026-08-09 audit findings Aug 10, 2026
- Add missing `use JOOservices\Flickr\Enums\HttpTransport;` import to the
  README config snippet (Copilot review: uncommenting the httpTransport
  line as-shown would not resolve).
- Harden multipart part lookups in tests: `array_search(..., true)` returns
  false on a missing part, and `$multipart[false]` silently reads index 0
  instead of failing (Copilot review, 6 call sites). Added a shared
  `TestCase::findMultipartPart()` helper that asserts the part exists
  before indexing.
- Add `.codacy.yml`, matching the config already present in the sibling
  dto/exceptions/client packages, to scope PHPMD/PHPCS to `src/`, disable
  Agentlinter noise on agent docs, and exclude `.claude/**` — remark-lint
  was misreading the `argument-hint: [placeholder]` Claude Code
  slash-command convention in `.claude/commands/*.md` frontmatter as an
  undefined markdown reference link.
soulevilx added a commit that referenced this pull request Aug 10, 2026
- Add missing `use JOOservices\Flickr\Enums\HttpTransport;` import to the
  README config snippet (Copilot review: uncommenting the httpTransport
  line as-shown would not resolve).
- Harden multipart part lookups in tests: `array_search(..., true)` returns
  false on a missing part, and `$multipart[false]` silently reads index 0
  instead of failing (Copilot review, 6 call sites). Added a shared
  `TestCase::findMultipartPart()` helper that asserts the part exists
  before indexing.
- Add `.codacy.yml`, matching the config already present in the sibling
  dto/exceptions/client packages, to scope PHPMD/PHPCS to `src/`, disable
  Agentlinter noise on agent docs, and exclude `.claude/**` — remark-lint
  was misreading the `argument-hint: [placeholder]` Claude Code
  slash-command convention in `.claude/commands/*.md` frontmatter as an
  undefined markdown reference link.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@soulevilx
soulevilx force-pushed the fix/audit-260809-remediation branch from 7468f07 to b4380ec Compare August 10, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd dependencies documentation Improvements or additions to documentation source tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants