Kirill Zhuravlev 8e3daea3c5 фвв еуыеы
2024-11-10 02:00:32 +01:00
2024-11-09 18:52:18 +01:00
2024-11-03 23:59:00 +01:00
fmt
2024-11-09 19:11:32 +01:00
2024-11-08 21:34:37 +01:00
2024-11-10 02:00:32 +01:00
2024-11-03 22:47:35 +01:00
2024-11-08 19:22:08 +01:00
2024-11-07 00:07:21 +01:00
2024-11-04 21:48:30 +01:00
2024-11-04 21:48:30 +01:00
2024-11-09 18:53:27 +01:00
2024-11-03 23:59:00 +01:00
2024-11-07 23:43:21 +01:00
2024-11-07 23:43:21 +01:00
2024-11-03 22:47:35 +01:00
2024-11-03 23:38:57 +01:00
2024-11-08 23:23:03 +01:00
2024-11-07 00:08:33 +01:00

Database Gateway

This service provides a unified web interface for secure, controlled access to company databases. It enables employees to run queries on production databases while enforcing access control (ACL) policies. For example, team leads may have permissions to execute both SELECT and INSERT queries on certain tables, while other team members are restricted to read-only (SELECT) access. This approach ensures that database interactions are managed safely and that each users access is tailored to their role and responsibilities.

Quickstart with example setup

Run commands to get a local dbgw instance with 3 postgres.

git clone https://github.com/kazhuravlev/database-gateway.git
cd database-gateway/example
docker compose up --pull always --force-recreate -d
open 'http://127.0.0.1:8080'
# Username: test@example.com
# Password: password

You will see only 2 instances from 3 postgres instances (local-1, local-2,local-3) because ACL is applied to test user. ACLs stored in config.json.

pic1_instances.png

Choose local-1, put this query select id, name from clients and click Run pic2_run.png

Features

  • Supports any PostgreSQL wire-protocol database, including PostgreSQL and CockroachDB
  • Allows hardcoded user configuration via config file
  • Integrates with OpenID Connect for user authentication
  • Enforces access filtering through ACLs
  • Provides query result output in HTML format
  • Provides query result output in JSON format
  • Output query results in CSV format
  • MySQL support
  • Query history tracking
  • Unique links for query results (useful for debugging)
  • API for test automation

Interesting projects

Languages
Go 81.7%
CSS 12.2%
templ 4.9%
JavaScript 0.6%
Dockerfile 0.6%