Skip to content
jc-rs
GitHub

pgpass

--pgpassv1.0.0

PostgreSQL password file parser

fileslurpable
$ cat input.txt | jc-rs --pgpass

A real pair

From the reference corpus (generic/pgpass.json). The left pane is the input the fixture ships; the right pane is the corpus's expected JSON. CI compares jc-rs with it field by field under the published differential. Hover a value to see where it came from.

pgpassgeneric
dbserver:443:db1:dbuser:pwd123
dbserver2:8888:inventory:joeuser:abc123
ax1234:1234:tables:dbadmin:password1

dbserver3:8888:inventory:joeuser:abc123
# comment

localhost:5555:table\\1:user\:w\:colon:password123
    # anther comment
hostname:*:database:username:password
expected outputjson
Use the Left and Right arrow keys to highlight the matching value in the input.
[
  {
    "hostname": "dbserver",
    "port": "443",
    "database": "db1",
    "username": "dbuser",
    "password": "pwd123"
  },
  {
    "hostname": "dbserver2",
    "port": "8888",
    "database": "inventory",
    "username": "joeuser",
    "password": "abc123"
  },
  {
    "hostname": "ax1234",
    "port": "1234",
    "database": "tables",
    "username": "dbadmin",
    "password": "password1"
  },
  {
    "hostname": "dbserver3",
    "port": "8888",
    "database": "inventory",
    "username": "joeuser",
    "password": "abc123"
  },
  {
    "hostname": "localhost",
    "port": "5555",
    "database": "table\\1",
    "username": "user:w:colon",
    "password": "password123"
  },
  {
    "hostname": "hostname",
    "port": "*",
    "database": "database",
    "username": "username",
    "password": "password"
  }
]

Fixture coverage

1/1oracle-valid pairs match under the published structural JSON comparison

Magic syntax

not availableThis parser reads a file or a string rather than a command, so there is nothing for jc-rs to run. Pipe it in.

Source: crates/jc-rs-parsers/src/misc/pgpass.rs. jc-rs targets the schemas defined by the original Python tool. Fixture coverage above is the measured evidence for this parser; test the inputs your pipeline depends on. Compare