Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

contrast-route-duplicates

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contrast-route-duplicates

A command-line tool for analyzing duplicate route signatures in Contrast Security applications.

  • 0.1.6
  • PyPI
  • Socket score

Maintainers
1

contrast-route-duplicates

A command-line tool for analyzing duplicate route signatures in Contrast Security applications. This tool helps identify repeated route signatures across your application, which can be useful for identifying potential issues caused from merging duplicate applications.

Features

  • Fast, asynchronous API querying with concurrent requests
  • Progress tracking for large datasets
  • CSV export for detailed analysis
  • Summary statistics including duplicate counts and percentages
  • Configurable batch size and concurrency
  • Environment-based configuration
  • Rich terminal output with color-coded results

Installation

  1. Install:
pip install contrast-route-duplicates
  1. Create a .env file with your Contrast Security credentials:
CONTRAST_BASE_URL=https://app.contrastsecurity.com/Contrast
CONTRAST_ORG_UUID=your-org-uuid
CONTRAST_API_KEY=your-api-key
CONTRAST_AUTH=your-auth-header

Usage

Basic usage:

contrast_route_duplicates APP_ID

With all options:

contrast_route_duplicates APP_ID \
    --csv output.csv \
    --batch-size 200 \
    --concurrent-requests 20 \
    --verbose

Options

  • APP_ID: The Contrast Security application ID to analyze (required)
  • --csv: Output file path for detailed CSV results
  • --batch-size: Number of routes to fetch per request (default: 100)
  • --concurrent-requests: Maximum number of concurrent API requests (default: 10)
  • --verbose: Enable verbose logging

Output

The tool provides a summary of route signature analysis including:

  • Total number of routes
  • Number of unique signatures
  • Number of signatures with duplicates
  • Total number of duplicate routes
  • Percentage of routes that are duplicates

Example output:

Starting analysis...
Fetching routes: 100% ██████████ 1615/1615

Route Analysis Summary
┌──────────────────────────┬────────────┐
│ Total routes            │     1,615 │
│ Unique signatures       │       602 │
│ Signatures with duplics │       316 │
│ Total duplicate routes  │       708 │
│ Duplicate percentage    │     43.8% │
└──────────────────────────┴────────────┘

Detailed results have been written to: output.csv

CSV Output Format

The CSV output includes two columns:

  • Signature: The route signature
  • Count: Number of occurrences of that signature

Example:

Signature,Count
org.example.Controller.index(),3
org.example.UserService.getUser(),2

Environment Variables

VariableDescriptionExample
CONTRAST_BASE_URLContrast Security API URLhttps://app.contrastsecurity.com/Contrast
CONTRAST_ORG_UUIDOrganization UUID12345678-90ab-cdef-1234-567890abcdef
CONTRAST_API_KEYAPI Keyyour-api-key
CONTRAST_AUTHAuthorization headerbase64-encoded-credentials

Development

Requirements:

  • Python 3.8+
  • httpx
  • typer
  • rich
  • python-dotenv
  • tqdm

License

MIT License

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run the tests
  5. Submit a pull request

Support

For issues, questions, or contributions, please open an issue in the GitHub repository.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc