Skip to content

feat(manager): affected packages API - #2519

Draft
jdobes wants to merge 1 commit into
RedHatInsights:masterfrom
jdobes:affected_packages_api
Draft

jdobes wants to merge 1 commit into
RedHatInsights:masterfrom
jdobes:affected_packages_api

Conversation

@jdobes

@jdobes jdobes commented Sep 15, 2026

Copy link
Copy Markdown
Member

RHINENG-28514

Secure Coding Practices Checklist GitHub Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

Summary by Sourcery

Introduce a feature-flagged API for reporting affected and fixed packages for a CVE on an individual system.

New Features:

  • Add a feature-flagged API endpoint for retrieving affected and fixed packages associated with a system CVE.
  • Expose package name and affected or fixed EVRA values in the system CVE package response.

Enhancements:

  • Extend vulnerability data models to represent affected and fixed package EVR and architecture details.

Documentation:

  • Document the system CVE affected-package endpoint and its response schema in the API specification.

Chores:

  • Add development configuration for the affected-packages feature flag.

@sourcery-ai

sourcery-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds the foundational, feature-flagged API contract and handler for system/CVE affected-package results, including authentication and authorization controls; the implementation currently returns an empty result because package retrieval is not yet wired in.

Sequence diagram for the feature-flagged affected packages API

sequenceDiagram
    participant Client
    participant GetSystemCvePackages
    participant RBAC
    participant RBACv2
    participant UNLEASH

    Client->>GetSystemCvePackages: GET /v1/systems/{inventory_id}/cves/{cve_id}
    GetSystemCvePackages->>RBAC: need_permissions(VULNERABILITY_RESULTS)
    GetSystemCvePackages->>RBACv2: enforce_workspace_permission(VULNERABILITY_RESULTS)
    GetSystemCvePackages->>UNLEASH: is_enabled(API_AFFECTED_PACKAGES_FEATURE)
    alt feature disabled
        GetSystemCvePackages-->>Client: 403 format_exception(...)
    else feature enabled
        GetSystemCvePackages-->>Client: 200 {data: [], meta: {}}
    end
Loading

Flow diagram for the affected packages API response

flowchart TD
    A[GET system CVE packages] --> B{Authorization succeeds}
    B -->|No| C[Reject request]
    B -->|Yes| D{API_AFFECTED_PACKAGES_FEATURE enabled}
    D -->|No| E[Return 403]
    D -->|Yes| F[Return empty data and meta]
Loading

File-Level Changes

Change Details Files
Introduces a feature-gated manager endpoint scaffold for retrieving packages affected by a CVE on a system.
  • Adds a new Unleash feature flag and development configuration entry.
  • Defines the endpoint, operation metadata, security requirements, parameters, and response schema in the API specification.
  • Adds a handler with existing RBAC and reportable-endpoint enforcement, returning 403 when disabled and an empty JSON:API-shaped result while package querying is pending.
common/feature_flags.py
develfeatureflags.json
manager.spec.yaml
manager/system_handler.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@jdobes
jdobes force-pushed the affected_packages_api branch from a5b9039 to c3ef72a Compare September 15, 2026 09:49
@jdobes jdobes changed the title feat(manager): base for the affected packages API feat(manager): affected packages API Sep 15, 2026
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