This commit is contained in:
Bryan Ashby 2022-12-31 17:51:03 -07:00
parent a00a93859e
commit 38098b46f1
No known key found for this signature in database
GPG Key ID: C2C1B501E4EFD994
2 changed files with 9 additions and 4 deletions

View File

@ -27,8 +27,8 @@ const ModuleInfo = (exports.moduleInfo = {
}); });
exports.WellKnownLocations = { exports.WellKnownLocations = {
Rfc5785: '/.well-known', Rfc5785: '/.well-known', // https://www.rfc-editor.org/rfc/rfc5785
Internal: '/_enig', Internal: '/_enig', // location of most enigma provided routes
}; };
class Route { class Route {

View File

@ -11,11 +11,14 @@ const Log = require('../../../logger').log;
exports.moduleInfo = { exports.moduleInfo = {
name: 'WebFinger', name: 'WebFinger',
desc: 'A simple WebFinger Handler', desc: 'A simple WebFinger Handler.',
author: 'NuSkooler, CognitiveGears', author: 'NuSkooler, CognitiveGears',
packageName: 'codes.l33t.enigma.web.handler.finger', packageName: 'codes.l33t.enigma.web.handler.finger',
}; };
//
// WebFinger: https://www.rfc-editor.org/rfc/rfc7033
//
exports.getModule = class WebFingerServerModule extends WebHandlerModule { exports.getModule = class WebFingerServerModule extends WebHandlerModule {
constructor() { constructor() {
super(); super();
@ -44,8 +47,10 @@ exports.getModule = class WebFingerServerModule extends WebHandlerModule {
this.acceptedResourceRegExps = [ this.acceptedResourceRegExps = [
// acct:NAME@our.domain.tld // acct:NAME@our.domain.tld
// https://www.rfc-editor.org/rfc/rfc7565
new RegExp(`^acct:(.+)@${domain}$`), new RegExp(`^acct:(.+)@${domain}$`),
// profile URL // profile page
// https://webfinger.net/rel/profile-page/
new RegExp(`^${ws.buildUrl(WellKnownLocations.Internal + '/wf/@')}(.+)$`), new RegExp(`^${ws.buildUrl(WellKnownLocations.Internal + '/wf/@')}(.+)$`),
// self URL // self URL
new RegExp( new RegExp(