Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASK:how to identify a component is directly or indirecty dependency? #108

Open
jackhj000 opened this issue Jun 27, 2023 · 3 comments
Open

Comments

@jackhj000
Copy link

Just according to the value of 'scope' (required, optional) in SBOM? is that accurate?thanks

if is_required and package_type not in config.OS_PKG_TYPES:
            package_usage = ":direct_hit: Direct usage"
            package_name_style = "[bold]"
        elif full_pkg in optional_pkgs or project_type_pkg in optional_pkgs:
            if package_type in config.OS_PKG_TYPES:
                package_usage = (
                    "[spring_green4]:notebook: Local install[/spring_green4]"
                )
                has_os_packages = True
            else:
                package_usage = (
                    "[spring_green4]:notebook: Indirect dependency[/spring_green4]"
                )
            package_name_style = "[italic]"
@prabhu
Copy link
Member

prabhu commented Jun 27, 2023

@jackhj000 This is correct. Currently, cdxgen and other tools use/misuse the scope attribute to represent direct dependency. However, with the recent 1.5 spec we can do this cleanly with evidence and dependencies (tree).

https://cyclonedx.org/docs/1.5/json/#components_items_evidence_identity

@jackhj000
Copy link
Author

thanks very much.

@prabhu
Copy link
Member

prabhu commented Jul 2, 2023

@jackhj000 We have added the dependency tree with 4.2.0. Please take a look and let us know if it suits your use case.

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

No branches or pull requests

2 participants