mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
feat(api): ✨ Make Lysand a full OAuth2/OpenID Connect provider as well as still Mastodon compatible
This commit is contained in:
parent
f9f4a99cb9
commit
5cb48b2f3b
29 changed files with 8466 additions and 279 deletions
|
|
@ -19,7 +19,7 @@ export const objectToInboxRequest = async (
|
|||
|
||||
const privateKey = await crypto.subtle.importKey(
|
||||
"pkcs8",
|
||||
Uint8Array.from(atob(author.privateKey ?? ""), (c) => c.charCodeAt(0)),
|
||||
Buffer.from(author.privateKey ?? "", "base64"),
|
||||
"Ed25519",
|
||||
false,
|
||||
["sign"],
|
||||
|
|
|
|||
|
|
@ -729,22 +729,13 @@ export const generateUserKeys = async () => {
|
|||
"verify",
|
||||
]);
|
||||
|
||||
const privateKey = btoa(
|
||||
String.fromCharCode.apply(null, [
|
||||
...new Uint8Array(
|
||||
// jesus help me what do these letters mean
|
||||
await crypto.subtle.exportKey("pkcs8", keys.privateKey),
|
||||
),
|
||||
]),
|
||||
);
|
||||
const publicKey = btoa(
|
||||
String.fromCharCode(
|
||||
...new Uint8Array(
|
||||
// why is exporting a key so hard
|
||||
await crypto.subtle.exportKey("spki", keys.publicKey),
|
||||
),
|
||||
),
|
||||
);
|
||||
const privateKey = Buffer.from(
|
||||
await crypto.subtle.exportKey("pkcs8", keys.privateKey),
|
||||
).toString("base64");
|
||||
|
||||
const publicKey = Buffer.from(
|
||||
await crypto.subtle.exportKey("spki", keys.publicKey),
|
||||
).toString("base64");
|
||||
|
||||
// Add header, footer and newlines later on
|
||||
// These keys are base64 encrypted
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue