mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
17 lines
540 B
TypeScript
17 lines
540 B
TypeScript
import { HttpRequest } from '../server/HttpRequest';
|
|
import { Credentials } from './Credentials';
|
|
import { CredentialsExtractor } from './CredentialsExtractor';
|
|
|
|
/**
|
|
* Credentials extractor which simply interprets the contents of the Authorization header as a webID.
|
|
*/
|
|
export class UnsecureWebIdExtractor extends CredentialsExtractor {
|
|
public async canHandle(): Promise<void> {
|
|
// Supports all requests
|
|
}
|
|
|
|
public async handle(input: HttpRequest): Promise<Credentials> {
|
|
return { webID: input.headers.authorization };
|
|
}
|
|
}
|