initialize generic rms-software repository
Add the reusable RMS core application (server, web UI, plugins, tests, tools) with generic defaults, GPL licensing, and maintainer context documentation so deployments can consume this repo as software source independent of station-specific overlays.
This commit is contained in:
32
plugins/rms.auth.otp_email/index.js
Normal file
32
plugins/rms.auth.otp_email/index.js
Normal file
@@ -0,0 +1,32 @@
|
||||
async function createPlugin(ctx) {
|
||||
return {
|
||||
async execute(action, input) {
|
||||
if (action !== "send_challenge") {
|
||||
throw new Error(`Unknown action: ${action}`);
|
||||
}
|
||||
const payload = input && input.payload ? input.payload : {};
|
||||
const recipient = input && input.recipient ? String(input.recipient) : "";
|
||||
if (!recipient) {
|
||||
throw new Error("recipient missing");
|
||||
}
|
||||
const entry = {
|
||||
at: new Date().toISOString(),
|
||||
via: "rms.auth.otp_email",
|
||||
to: recipient,
|
||||
from: String(ctx.getSetting("from", ctx.env.SMTP_FROM || "noreply@arcg.at")),
|
||||
subject: String(payload.subject || "ARCG OTP"),
|
||||
text: String(payload.text || ""),
|
||||
html: String(payload.html || "")
|
||||
};
|
||||
await ctx.appendMailOutbox(entry);
|
||||
return { ok: true, delivered: true, transport: "otp-email-plugin" };
|
||||
},
|
||||
async health() {
|
||||
return { ok: true };
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
createPlugin
|
||||
};
|
||||
20
plugins/rms.auth.otp_email/manifest.json
Normal file
20
plugins/rms.auth.otp_email/manifest.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"id": "rms.auth.otp_email",
|
||||
"name": "OTP per E-Mail",
|
||||
"version": "1.0.0",
|
||||
"apiVersion": "1.0",
|
||||
"capabilities": [],
|
||||
"authMethod": {
|
||||
"id": "otp-email",
|
||||
"type": "otp",
|
||||
"label": "OTP (E-Mail)"
|
||||
},
|
||||
"settingsSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"from": { "type": "string" }
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"uiControls": []
|
||||
}
|
||||
Reference in New Issue
Block a user