phlo-postgres 0.3.1__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/PKG-INFO +1 -1
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/README.md +2 -2
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/pyproject.toml +1 -1
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres/__init__.py +1 -1
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres/cli.py +7 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres/service.yaml +2 -2
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres.egg-info/PKG-INFO +1 -1
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/setup.cfg +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres/authorization.py +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres/cli_plugin.py +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres/exporter_service.yaml +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres/plugin.py +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres/publish_target.py +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres/resource.py +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres/settings.py +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres/volume_setup.yaml +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres.egg-info/SOURCES.txt +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres.egg-info/dependency_links.txt +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres.egg-info/entry_points.txt +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres.egg-info/requires.txt +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/src/phlo_postgres.egg-info/top_level.txt +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/tests/test_authorization.py +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/tests/test_integration_postgres.py +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/tests/test_postgres_cli.py +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/tests/test_postgres_plugin.py +0 -0
- {phlo_postgres-0.3.1 → phlo_postgres-0.3.2}/tests/test_resource.py +0 -0
|
@@ -18,7 +18,7 @@ phlo plugin install postgres
|
|
|
18
18
|
|
|
19
19
|
| Variable | Default | Description |
|
|
20
20
|
| ------------------------ | -------- | ---------------------- |
|
|
21
|
-
| `POSTGRES_PORT` | `
|
|
21
|
+
| `POSTGRES_PORT` | `10000` | PostgreSQL host port |
|
|
22
22
|
| `POSTGRES_USER` | `phlo` | Database username |
|
|
23
23
|
| `POSTGRES_PASSWORD` | `phlo` | Database password |
|
|
24
24
|
| `POSTGRES_DB` | `phlo` | Database name |
|
|
@@ -57,7 +57,7 @@ phlo services start --service postgres,postgres-exporter
|
|
|
57
57
|
|
|
58
58
|
## Endpoints
|
|
59
59
|
|
|
60
|
-
- **PostgreSQL**: `localhost:
|
|
60
|
+
- **PostgreSQL**: `localhost:10000`
|
|
61
61
|
- **Exporter Metrics**: `http://localhost:9187/metrics`
|
|
62
62
|
|
|
63
63
|
## Entry Points
|
|
@@ -23,6 +23,7 @@ from subprocess import TimeoutExpired
|
|
|
23
23
|
|
|
24
24
|
import click
|
|
25
25
|
|
|
26
|
+
from phlo.cli.authorization_wrappers import enforce_surface_mutation_authorization
|
|
26
27
|
from phlo.cli.commands.services.utils import (
|
|
27
28
|
ensure_compose_project,
|
|
28
29
|
require_container_backend as _require_selected_container_backend,
|
|
@@ -37,6 +38,7 @@ from phlo.cli.output import (
|
|
|
37
38
|
file_read_error,
|
|
38
39
|
)
|
|
39
40
|
from phlo.cli.output import missing_query_error
|
|
41
|
+
from phlo_postgres.authorization import get_postgres_cli_adapter
|
|
40
42
|
from phlo_postgres.settings import get_settings
|
|
41
43
|
|
|
42
44
|
|
|
@@ -190,6 +192,7 @@ def postgres_group(ctx: click.Context, postgres_args: tuple[str, ...]) -> None:
|
|
|
190
192
|
return
|
|
191
193
|
|
|
192
194
|
_require_container_backend()
|
|
195
|
+
enforce_surface_mutation_authorization("postgres", get_postgres_cli_adapter)
|
|
193
196
|
user, database = _postgres_identity(user=None, database=None)
|
|
194
197
|
cmd = _postgres_exec_base(tty=True)
|
|
195
198
|
cmd.extend(["psql", "-U", user, "-d", database])
|
|
@@ -237,6 +240,7 @@ def postgres_query(
|
|
|
237
240
|
|
|
238
241
|
"""
|
|
239
242
|
_require_container_backend()
|
|
243
|
+
enforce_surface_mutation_authorization("postgres.query", get_postgres_cli_adapter)
|
|
240
244
|
sql = _read_sql(query=query, file=query_file)
|
|
241
245
|
resolved_user, resolved_db = _postgres_identity(user=user, database=database)
|
|
242
246
|
cmd = _postgres_exec_base(tty=False)
|
|
@@ -301,6 +305,7 @@ def postgres_dump(
|
|
|
301
305
|
|
|
302
306
|
"""
|
|
303
307
|
_require_container_backend()
|
|
308
|
+
enforce_surface_mutation_authorization("postgres.dump", get_postgres_cli_adapter)
|
|
304
309
|
resolved_user, resolved_db = _postgres_identity(user=user, database=database)
|
|
305
310
|
cmd = _postgres_exec_base(tty=False)
|
|
306
311
|
cmd.extend(["pg_dump", "-U", resolved_user, resolved_db])
|
|
@@ -376,6 +381,7 @@ def postgres_restore(
|
|
|
376
381
|
|
|
377
382
|
"""
|
|
378
383
|
_require_container_backend()
|
|
384
|
+
enforce_surface_mutation_authorization("postgres.restore", get_postgres_cli_adapter)
|
|
379
385
|
resolved_user, resolved_db = _postgres_identity(user=user, database=database)
|
|
380
386
|
cmd = _postgres_exec_base(tty=False)
|
|
381
387
|
cmd.extend(["psql", "-U", resolved_user, "-d", resolved_db, "-v", "ON_ERROR_STOP=1"])
|
|
@@ -440,6 +446,7 @@ def postgres_vacuum(
|
|
|
440
446
|
|
|
441
447
|
"""
|
|
442
448
|
_require_container_backend()
|
|
449
|
+
enforce_surface_mutation_authorization("postgres.vacuum", get_postgres_cli_adapter)
|
|
443
450
|
resolved_user, resolved_db = _postgres_identity(user=user, database=database)
|
|
444
451
|
cmd = _postgres_exec_base(tty=False)
|
|
445
452
|
cmd.extend(["vacuumdb", "-U", resolved_user])
|
|
@@ -24,7 +24,7 @@ compose:
|
|
|
24
24
|
# SSL/TLS
|
|
25
25
|
POSTGRES_SSL_MODE: ${POSTGRES_SSL_MODE:-prefer}
|
|
26
26
|
ports:
|
|
27
|
-
- "${POSTGRES_PORT:-
|
|
27
|
+
- "${POSTGRES_PORT:-10000}:5432"
|
|
28
28
|
volumes:
|
|
29
29
|
- postgres-data:/var/lib/postgresql/data
|
|
30
30
|
healthcheck:
|
|
@@ -45,7 +45,7 @@ env_vars:
|
|
|
45
45
|
default: phlo
|
|
46
46
|
description: PostgreSQL database name
|
|
47
47
|
POSTGRES_PORT:
|
|
48
|
-
default:
|
|
48
|
+
default: 10000
|
|
49
49
|
description: PostgreSQL host port
|
|
50
50
|
# SSL/TLS
|
|
51
51
|
POSTGRES_SSL_MODE:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|