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

github.com/bravepickle/stubman

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/bravepickle/stubman

  • v0.0.0-20240109133515-7e740c0c5d4e
  • Source
  • Go
  • Socket score

Version published
Created
Source

stubman

HTTP stub service written in Golang. Quick way to handle HTTP responses when target server is not ready yet. Contains WEB GUI for editing stubs

Usage

Command usage

$ stubman -help

HTTP stub service.

Usage: stubman [options] [arg]

Options:
  -debug
    	Enable debug mode
  -f string
    	Path to config file in YAML format (default "./config.yaml")
  -help
    	Print command usage help

Arguments:
  config:init
    	initialize example config for running application. If file exists, then it will be reset to defaults
  db:init
    	initialize DB. If it exists, then DB will be reset
  db:import <file.sql>
    	import data from SQL file to DB. Second argument must be present with file path

Example:
  stubman config:init

Features

  • can work as stub service
  • uses (SQLite)[http://github.com/mattn/go-sqlite3] as DB storage for stubman
  • uses (YAML)[http://gopkg.in/yaml.v2] as config parser for stubman
  • has WEB GUI for Stubs CRUD operations

TODOs

  • logger customizations: output source, naming, disabling etc.
  • modes enable-disable
  • allow redirect to another paths requests in proxy mode
  • customize (change, add) request and response headers
  • responses logger (disabled by default)
  • separate file for error logging and access logs
  • uniquely identify each request with responses, errors and keep those IDs in logs. Uniqueness can be partial
  • cover with tests, benchmarks, profiling
  • flag to disable stubman in whole and GUI side only
  • proxy section: disable flag, 404 page by default
  • switch stubman GUI themes
  • login use, credentials in config
  • use SQLite as DB engine, add db:init command
  • import/export stub data in GUI
  • add to README examples how to setup configs for NGINX & Apache wit Midway App
  • add multiplexer hendler: send copy of request to another address asynchoneously, without waiting for response (use goroutines?). Test it output
  • add to config optional preconditions to start logging requests and responses, using RegEx
  • in Stubman add button to generate CURL request for given stub
  • log time taken for handling requests
  • support method ANY which skips matching
  • modify headers on save and keep as little as possible modifications on request handling
  • add flag to strip GET params before matching given endpoint
  • urldecode string before matching search pattern

Usage Examples

GUI Edit Page

GUI Edit Page

GUI Listing Page

GUI Listing Page

Stub Example Results Page

Stub Example Results Page

FAQs

Package last updated on 09 Jan 2024

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