Skip to content

Commit

Permalink
Consolidate migrations, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
DJAndries committed Nov 1, 2024
1 parent 88fef4c commit 6092b64
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 31 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ View API documentation at http://localhost:8080/swagger/index.html.
| DATABASE_URL | Yes | PostgreSQL database connection URL |
| EMAIL_FROM_ADDRESS | Yes | Email address used as sender for verification emails |
| BASE_URL | Yes | Base URL of the service |
| JWT_KEY | Yes | Secret key for JWT signing |
| OPAQUE_SECRET_KEY | Yes | OPAQUE server secret key |
| OPAQUE_PUBLIC_KEY | Yes | OPAQUE server public key |
| PREMIUM_AUTH_REDIRECT_URL | Yes | Redirect URL for premium service authentication |
| AWS_ENDPOINT | No | Custom AWS endpoint for testing |
| LOG_PRETTY | No | Enable pretty logging format if set to 'true' |
| LOG_LEVEL | No | Logging level (default: info) |
| SERVE_SWAGGER | No | Serve Swagger UI if set to 'true' |
| PASSWORD_AUTH_ENABLED | No | Enable password authentication if set to 'true' |
| OPAQUE_SECRET_KEY | Yes | OPAQUE server secret key |
| OPAQUE_PUBLIC_KEY | Yes | OPAQUE server public key |
| OPAQUE_FAKE_RECORD | No | OPAQUE fake record for rate limiting |
| JWT_KEY | Yes | Secret key for JWT signing |
| PREMIUM_AUTH_REDIRECT_URL | Yes | Redirect URL for premium service authentication |
| OPAQUE_FAKE_RECORD | No | Use OPAQUE fake record to prevent client enumeration attacks |
6 changes: 6 additions & 0 deletions migrations/20241021231751_init.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DROP TABLE verifications;
DROP TABLE sessions;
DROP TABLE registration_states;
DROP TABLE ake_states;
DROP TABLE accounts;
DROP TABLE oprf_seeds;
22 changes: 22 additions & 0 deletions migrations/20241021231751_init.up.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
CREATE TABLE oprf_seeds (
id SERIAL PRIMARY KEY,
seed BYTEA NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE accounts (
id UUID PRIMARY KEY,
email TEXT NOT NULL,
oprf_seed_id INT REFERENCES oprf_seeds(id),
opaque_registration BYTEA,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE(email)
);

CREATE TABLE ake_states (
id UUID PRIMARY KEY,
account_id UUID REFERENCES accounts(id),
oprf_seed_id INT REFERENCES oprf_seeds(id),
state BYTEA NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE registration_states (
email TEXT PRIMARY KEY,
oprf_seed_id INT REFERENCES oprf_seeds(id),
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE sessions (
id UUID PRIMARY KEY,
account_id UUID NOT NULL REFERENCES accounts(id),
Expand Down
4 changes: 0 additions & 4 deletions migrations/20241025031241_opaque.down.sql

This file was deleted.

22 changes: 0 additions & 22 deletions migrations/20241025031241_opaque.up.sql

This file was deleted.

0 comments on commit 6092b64

Please sign in to comment.