/**
* Base AuthProvider Class
*
* All authentication providers extend this base class.
* Each provider implements a different authentication method:
* - WebIdentityProvider: Browser-based ANProto keypairs
* - KeetIdentityProvider: BIP39 mnemonic-based identities
* - SSHKeyProvider: SSH public key authentication
* - BearerTokenProvider: Token-based authentication
*/
export class AuthProvider {
constructor(registry) {
this.registry = registry
this.name = 'base'
}
/**
* Extract credentials from HTTP request
* @param {Object} req - HTTP request object
* @returns {Promise<any>} Credentials or null
*/
async extractCredentials(req) {
return null
}
/**
* Authenticate credentials and return identity information
* @param {any} credentials - Credentials extracted from request
* @returns {Promise<Object>} { identityId, method, verified, credentials }
*/
async authenticate(credentials) {
throw new Error('authenticate() must be implemented by subclass')
}
/**
* Get provider name
* @returns {string}
*/
getName() {
return this.name
}
}