Skip to content

feat: [SP-2400] - Create crypto sub command #117

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Upcoming changes...

## [1.24.0] - 2025-05-06
### Added
- Add `crypto` subcommand to retrieve cryptographic algorithms for the given components
- Add `crypto hints` subcommand to retrieve cryptographic hints for the given components
- Add `crypto versions-in-range` subcommand to retrieve cryptographic versions in range for the given components

## [1.23.0] - 2025-04-24
### Added
- Add `--origin` flag to `component provenance` subcommand to retrieve provenance using contributors origin
Expand Down Expand Up @@ -515,4 +521,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[1.20.6]: https://github.com/scanoss/scanoss.py/compare/v1.20.5...v1.20.6
[1.21.0]: https://github.com/scanoss/scanoss.py/compare/v1.20.6...v1.21.0
[1.22.0]: https://github.com/scanoss/scanoss.py/compare/v1.21.0...v1.22.0
[1.23.0]: https://github.com/scanoss/scanoss.py/compare/v1.22.0...v1.23.0
[1.23.0]: https://github.com/scanoss/scanoss.py/compare/v1.22.0...v1.23.0
[1.24.0]: https://github.com/scanoss/scanoss.py/compare/v1.23.0...v1.24.0
85 changes: 85 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,91 @@ Scans Docker container images for dependencies, extracting and analyzing compone
* - --ca-cert <file>
- Alternative certificate PEM file

-----------------
Crypto: crypto, cr
-----------------

Provides subcommands to retrieve cryptographic information for components.

.. code-block:: bash

scanoss-py crypto <subcommand>

Subcommands:
~~~~~~~~~~~~

**algorithms (alg)**
Retrieve cryptographic algorithms for the given components.

.. code-block:: bash

scanoss-py crypto algorithms --purl <purl_string>

.. list-table::
:widths: 20 30
:header-rows: 1

* - Argument
- Description
* - --with-range
- Returns the list of versions in the specified range that contains cryptographic algorithms. (Replaces the previous --range option)

**hints**
Retrieve encryption hints for the given components.

.. code-block:: bash

scanoss-py crypto hints --purl <purl_string>

.. list-table::
:widths: 20 30
:header-rows: 1

* - Argument
- Description
* - --with-range
- Returns the list of versions in the specified range that contains encryption hints.

**versions-in-range (vr)**
Given a list of PURLs and version ranges, get a list of versions that do/don't contain crypto algorithms.

.. code-block:: bash

scanoss-py crypto versions-in-range --purl <purl_string_with_range>

Common Crypto Arguments:
~~~~~~~~~~~~~~~~~~~~~~~~
The following arguments are common to the ``algorithms``, ``hints``, and ``versions-in-range`` subcommands:

.. list-table::
:widths: 20 30
:header-rows: 1

* - Argument
- Description
* - --purl <PURL>, -p <PURL>
- Package URL (PURL) to process. Can be specified multiple times.
* - --input <file>, -i <file>
- Input file name containing PURLs.
* - --output <file name>, -o <file name>
- Output result file name (optional - default STDOUT).
* - --timeout <seconds>, -M <seconds>
- Timeout (in seconds) for API communication (optional - default 600).
* - --key <KEY>, -k <KEY>
- SCANOSS API Key token (optional - not required for default OSSKB URL).
* - --api2url <API2URL>
- SCANOSS gRPC API 2.0 URL (optional - default: https://api.osskb.org).
* - --grpc-proxy <GRPC_PROXY>
- GRPC Proxy URL to use for connections.
* - --ca-cert <CA_CERT>
- Alternative certificate PEM file.
* - --debug, -d
- Enable debug messages.
* - --trace, -t
- Enable trace messages, including API posts.
* - --quiet, -q
- Enable quiet mode.

-----------------
Component:
-----------------
Expand Down
2 changes: 1 addition & 1 deletion src/scanoss/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
THE SOFTWARE.
"""

__version__ = '1.23.0'
__version__ = '1.24.0'
Loading