Merge ~cjwatson/lp-signing:db-grants into lp-signing:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 1f4569e8df55efa937da1e2445eeac53791b5c3f
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/lp-signing:db-grants
Merge into: lp-signing:master
Diff against target: 87 lines (+22/-8)
6 files modified
Makefile.db (+3/-3)
lp_signing/config.py (+1/-1)
lp_signing/database/tests/test_enumcol.py (+2/-2)
lp_signing/tests/test_webapp.py (+1/-1)
migrations/patch-0-1-1-std.sql (+14/-0)
service.conf (+1/-1)
Reviewer Review Type Date Requested Status
Tom Wardill (community) Approve
Review via email: mp+382581@code.launchpad.net

Commit message

Grant the application access to database tables

Description of the change

Otherwise it can't do very much.

To post a comment you must log in.
Revision history for this message
Tom Wardill (twom) :
review: Approve
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
~cjwatson/lp-signing:db-grants updated
1f4569e... by Colin Watson

Fix local DB name in config and tests

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/Makefile.db b/Makefile.db
index dd8d4c7..980a815 100644
--- a/Makefile.db
+++ b/Makefile.db
@@ -1,7 +1,7 @@
1PGNAME = lp_signing1PGNAME = lp-signing
2PGHOST = $(shell pwd)/dev-db/localhost2PGHOST = $(shell pwd)/dev-db/localhost
3PGUSER = lp_signing3PGUSER = lp-signing
4PGUSER_ADMIN = lp_signing_admin4PGUSER_ADMIN = lp-signing_admin
5DATA_DIR = $(PGHOST)/data5DATA_DIR = $(PGHOST)/data
6LOG_FILE = $(PGHOST)/postgresql.log6LOG_FILE = $(PGHOST)/postgresql.log
7CONF_FILE = $(PGHOST)/postgresql.conf7CONF_FILE = $(PGHOST)/postgresql.conf
diff --git a/lp_signing/config.py b/lp_signing/config.py
index 2c4036b..be8403a 100644
--- a/lp_signing/config.py
+++ b/lp_signing/config.py
@@ -21,7 +21,7 @@ _test_db_path = str(ROOT / "dev-db" / "localhost")
2121
22DEFAULT_TEST_CONFIG = {22DEFAULT_TEST_CONFIG = {
23 "database": {23 "database": {
24 "master_url": f"postgres://{quote(_test_db_path, safe='')}/lp_signing",24 "master_url": f"postgres://{quote(_test_db_path, safe='')}/lp-signing",
25 "standby_urls": "[]",25 "standby_urls": "[]",
26 },26 },
27 "auth": {27 "auth": {
diff --git a/lp_signing/database/tests/test_enumcol.py b/lp_signing/database/tests/test_enumcol.py
index ac65e30..ea5ba1f 100644
--- a/lp_signing/database/tests/test_enumcol.py
+++ b/lp_signing/database/tests/test_enumcol.py
@@ -69,8 +69,8 @@ class TestDBEnum(TestCase):
69 foo integer DEFAULT 1 NOT NULL69 foo integer DEFAULT 1 NOT NULL
70 );70 );
71 """)71 """)
72 store.execute("GRANT ALL ON TABLE FooTest TO lp_signing;")72 store.execute('GRANT ALL ON TABLE FooTest TO "lp-signing";')
73 store.execute("GRANT ALL ON footest_id_seq TO lp_signing;")73 store.execute('GRANT ALL ON footest_id_seq TO "lp-signing";')
74 self.addCleanup(store.execute, "DROP TABLE FooTest;")74 self.addCleanup(store.execute, "DROP TABLE FooTest;")
7575
76 def test_enumerated_type_must_be_DBEnumeratedType(self):76 def test_enumerated_type_must_be_DBEnumeratedType(self):
diff --git a/lp_signing/tests/test_webapp.py b/lp_signing/tests/test_webapp.py
index b555463..9857263 100644
--- a/lp_signing/tests/test_webapp.py
+++ b/lp_signing/tests/test_webapp.py
@@ -53,7 +53,7 @@ class TestConfiguration(TestCase):
53 MatchesStructure.byEquality(53 MatchesStructure.byEquality(
54 scheme="postgres",54 scheme="postgres",
55 hostname=quote(str(root / "dev-db" / "localhost"), safe=""),55 hostname=quote(str(root / "dev-db" / "localhost"), safe=""),
56 path="/lp_signing"))56 path="/lp-signing"))
5757
58 def test_binds_no_standbys(self):58 def test_binds_no_standbys(self):
59 fixture = self.useFixture(AppFixture())59 fixture = self.useFixture(AppFixture())
diff --git a/migrations/patch-0-1-1-std.sql b/migrations/patch-0-1-1-std.sql
60new file mode 10064460new file mode 100644
index 0000000..6d0b462
--- /dev/null
+++ b/migrations/patch-0-1-1-std.sql
@@ -0,0 +1,14 @@
1GRANT SELECT, INSERT, UPDATE, DELETE ON nonce TO "lp-signing";
2GRANT USAGE ON nonce_id_seq TO "lp-signing";
3
4GRANT SELECT, INSERT, UPDATE, DELETE ON client TO "lp-signing";
5GRANT USAGE ON client_id_seq TO "lp-signing";
6
7GRANT SELECT, INSERT, UPDATE, DELETE ON clientpublickey TO "lp-signing";
8GRANT USAGE ON clientpublickey_id_seq TO "lp-signing";
9
10GRANT SELECT, INSERT, UPDATE, DELETE ON key TO "lp-signing";
11GRANT USAGE ON key_id_seq TO "lp-signing";
12
13GRANT SELECT, INSERT, UPDATE, DELETE ON keyauthorization TO "lp-signing";
14GRANT USAGE ON keyauthorization_id_seq TO "lp-signing";
diff --git a/service.conf b/service.conf
index ea0de24..8751c72 100644
--- a/service.conf
+++ b/service.conf
@@ -1,5 +1,5 @@
1[database]1[database]
2master_url: postgres://%(QUOTED_TEST_DB_PATH)s/lp_signing2master_url: postgres://%(QUOTED_TEST_DB_PATH)s/lp-signing
3standby_urls: []3standby_urls: []
44
5[auth]5[auth]

Subscribers

People subscribed via source and target branches