patch: refactor auth handling. seperate each auth method into their own module.

This commit is contained in:
Matthew Toro 2026-04-05 18:04:53 -04:00
parent 7d8163539c
commit a257d7899e
12 changed files with 186 additions and 157 deletions

View file

@ -0,0 +1,36 @@
#include "stdafx.h"
#include "OfflineAuthModule.h"
const wchar_t *KeypairOfflineAuthModule::schemeName() { return L"mcconsoles:keypair_offline"; }
vector<wstring> KeypairOfflineAuthModule::supportedVariations()
{
return {L"rsa2048", L"ed25519"};
}
vector<pair<wstring, wstring>> KeypairOfflineAuthModule::getSettings(const wstring &variation)
{
return {{L"key_type", variation}};
}
bool KeypairOfflineAuthModule::onAuthData(const vector<pair<wstring, wstring>> &fields, wstring &outUid, wstring &outUsername)
{
return extractIdentity(fields, outUid, outUsername);
}
const wchar_t *OfflineAuthModule::schemeName() { return L"mcconsoles:offline"; }
vector<wstring> OfflineAuthModule::supportedVariations()
{
return {};
}
vector<pair<wstring, wstring>> OfflineAuthModule::getSettings(const wstring &variation)
{
return {};
}
bool OfflineAuthModule::onAuthData(const vector<pair<wstring, wstring>> &fields, wstring &outUid, wstring &outUsername)
{
return extractIdentity(fields, outUid, outUsername);
}