diff options
| author | ojacobson <ojacobson@noreply.codeberg.org> | 2025-10-28 20:12:08 +0100 |
|---|---|---|
| committer | ojacobson <ojacobson@noreply.codeberg.org> | 2025-10-28 20:12:08 +0100 |
| commit | f866e480447746ce4958e5475d3c9e407812231f (patch) | |
| tree | fc97b7aa36a20a5af58a692e814cbd9fea0348cc /.sqlx | |
| parent | 4a91792e023a5877f8ac9b8a352e99c4486d698f (diff) | |
| parent | 11f4f36a689b6447c9898a2840418e581cb3eb11 (diff) | |
Use PKCS8 PEM, not raw SEC1 bytes, to store VAPID keys.
The `web-push` crate's VAPID signing support requires a private key. The `p256` crate is more than capable of generating one, but the easiest way to get a key from a `p256::ecdsa::SigningKey` to a `web_push::PartialVapidSignature` is via PKCS #8 PEM, not via the bytes. Since we'll need it in that form anyways, store it that way, so that we don't have to decode it using `p256`, re-encode to PEM, then decode to `PartialVapidSignature`.
The migration in this commit invalidates existing VAPID keys. We could include support for re-encoding them on read, but there's little point: this code is still in flux anyways, and only development deployments exist. By the time this is final, the schema will have settled.
Merges pem-stored-vapid into push-notify.
Diffstat (limited to '.sqlx')
| -rw-r--r-- | .sqlx/query-be295f56960d083d1f4c760f6acfdfbf9898a1a407e8a562a181542834d05eb0.json (renamed from .sqlx/query-edd16f1507f3b40270d652c7c204a4b9a518af418cc7e7fce9a6f0a106a6d66e.json) | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/.sqlx/query-edd16f1507f3b40270d652c7c204a4b9a518af418cc7e7fce9a6f0a106a6d66e.json b/.sqlx/query-be295f56960d083d1f4c760f6acfdfbf9898a1a407e8a562a181542834d05eb0.json index 2481fa9..ccec274 100644 --- a/.sqlx/query-edd16f1507f3b40270d652c7c204a4b9a518af418cc7e7fce9a6f0a106a6d66e.json +++ b/.sqlx/query-be295f56960d083d1f4c760f6acfdfbf9898a1a407e8a562a181542834d05eb0.json @@ -1,6 +1,6 @@ { "db_name": "SQLite", - "query": "\n select\n key.changed_at as \"changed_at: DateTime\",\n key.changed_sequence as \"changed_sequence: Sequence\",\n signing.key as \"key: Vec<u8>\"\n from vapid_key as key\n join vapid_signing_key as signing\n ", + "query": "\n select\n key.changed_at as \"changed_at: DateTime\",\n key.changed_sequence as \"changed_sequence: Sequence\",\n signing.key\n from vapid_key as key\n join vapid_signing_key as signing\n ", "describe": { "columns": [ { @@ -14,9 +14,9 @@ "type_info": "Integer" }, { - "name": "key: Vec<u8>", + "name": "key", "ordinal": 2, - "type_info": "Blob" + "type_info": "Text" } ], "parameters": { @@ -28,5 +28,5 @@ false ] }, - "hash": "edd16f1507f3b40270d652c7c204a4b9a518af418cc7e7fce9a6f0a106a6d66e" + "hash": "be295f56960d083d1f4c760f6acfdfbf9898a1a407e8a562a181542834d05eb0" } |
