Unable to use Peer auth
- Dominant language
- JavaScript
- Stars
- 68
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Description
I want to have db-migrate authenticate by socket / peer auth, but this doesn't seem possible without hacking an env var.
```js
const dbMigrateConfig = {
default: 'local',
local: {
driver: 'pg',
database: 'mydatabase',
host: '/var/run/postgres',
native: true
}
};
```
'#ENOENT /var/run/postgres'
```
process.env['DBTEST'] = 'postgres:///${mydatabase}?host=/var/run/postgresql&native=true';
const dbMigrateConfig = {
default: 'local',
local: {
ENV: "DBTEST"
}
};
```
`success`.
Any chance the normal connection settings could allow connection via a socket?
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/42211975-unable-to-use-peer-auth?utm_campaign=plugin&utm_content=tracker%2F14258523&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F14258523&utm_medium=issues&utm_source=github).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the pg driver's normal connection-settings path and compare it with the ENV connection-string path shown in the issue. Verify how the database, host socket path, and native settings are passed, then confirm that the normal configuration can authenticate through a PostgreSQL peer socket without an environment variable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, postgresql
- Domain
- database
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100