http2sqlite

command module
v0.0.0-...-bc952af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

README

http2sqlite

Slap HTTP requests straight into a local SQLite3 database. Fun for debugging!

GPLv3 licensed because if you wanted to pay for something more full-fledged you'd probably be using one of the SaaS services for this, lol.

Request filtering

To facilitate more targeted request logging, the Viper config variable filter supports a github.com/google/cel-go expression that returns a boolean.

For those not familiar with Viper, this means you can configure the CEL filter via any of:

  • execution args: --filter 'expression here'
  • config file: filter: 'expression here'
  • env var: FILTER='expression here'

Supported CEL variables are:

  • host - HTTP host header
  • path - absolute URL path, including the leading slash
  • method - HTTP method
  • header - map of HTTP headers
  • source_address - IP:port as a string

Due to CEL limitations, all n-dashes are converted to underscores. This is particularly noticable when filtering headers.

Example filters

Only save PATCH requests to localhost:4676.

method == "PATCH" && host == "localhost:4676"

Only save requests with a User-Agent of curl/*.

header.User_Agent.startsWith("curl/")
// alternatively, use RE2 regex
header.User_Agent.matches("^curl/.+")
matches(header.User_Agent, "^curl/.+")

Only save requests from a particular IP address.

source_address.startsWith("9.9.9.9")

For everything else that you can do with CEL, reference the language grammar.

Documentation

Overview

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Directories

Path Synopsis
ent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL