@solid/community-server
Version:
Community Solid Server: an open and modular implementation of the Solid specifications
23 lines • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnsecureConstantCredentialsExtractor = void 0;
const global_logger_factory_1 = require("global-logger-factory");
const CredentialsExtractor_1 = require("./CredentialsExtractor");
/**
* Credentials extractor that authenticates a constant agent
* (useful for development or debugging purposes).
*/
class UnsecureConstantCredentialsExtractor extends CredentialsExtractor_1.CredentialsExtractor {
credentials;
logger = (0, global_logger_factory_1.getLoggerFor)(this);
constructor(agent) {
super();
this.credentials = { agent: typeof agent === 'string' ? { webId: agent } : agent };
}
async handle() {
this.logger.info(`Agent unsecurely claims to be ${this.credentials.agent.webId}`);
return this.credentials;
}
}
exports.UnsecureConstantCredentialsExtractor = UnsecureConstantCredentialsExtractor;
//# sourceMappingURL=UnsecureConstantCredentialsExtractor.js.map