mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
parent
ad99e1fcea
commit
4ac9e92d06
@ -7,13 +7,12 @@ import { HttpRequest } from '../server/HttpRequest';
|
||||
*/
|
||||
export class SimpleCredentialsExtractor extends CredentialsExtractor {
|
||||
public async canHandle(): Promise<void> {
|
||||
return undefined;
|
||||
// Supports all requests
|
||||
}
|
||||
|
||||
public async handle(input: HttpRequest): Promise<Credentials> {
|
||||
if (input.headers.authorization) {
|
||||
return { webID: input.headers.authorization };
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,6 @@ export class SimpleAuthorizer extends Authorizer {
|
||||
}
|
||||
|
||||
public async handle(): Promise<void> {
|
||||
return undefined;
|
||||
// Allows all actions
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ export class AcceptPreferenceParser extends PreferenceParser {
|
||||
}
|
||||
|
||||
public async canHandle(): Promise<void> {
|
||||
return undefined;
|
||||
// Supports all HttpRequests
|
||||
}
|
||||
|
||||
public async handle(input: HttpRequest): Promise<RepresentationPreferences> {
|
||||
|
@ -32,7 +32,7 @@ export class SimpleBodyParser extends BodyParser {
|
||||
const contentType = input.headers['content-type'];
|
||||
|
||||
if (!contentType) {
|
||||
return undefined;
|
||||
return;
|
||||
}
|
||||
|
||||
const mediaType = contentType.split(';')[0];
|
||||
|
@ -7,7 +7,7 @@ import { PermissionsExtractor } from './PermissionsExtractor';
|
||||
*/
|
||||
export class SimplePermissionsExtractor extends PermissionsExtractor {
|
||||
public async canHandle(): Promise<void> {
|
||||
return undefined;
|
||||
// Supports all operations
|
||||
}
|
||||
|
||||
public async handle(input: Operation): Promise<PermissionSet> {
|
||||
|
@ -12,7 +12,7 @@ const handle = async(input: { request: HttpRequest; response: HttpResponse }): P
|
||||
|
||||
class SimpleHttpHandler extends HttpHandler {
|
||||
public async canHandle(): Promise<void> {
|
||||
return undefined;
|
||||
// Supports all HttpRequests
|
||||
}
|
||||
|
||||
public async handle(input: { request: HttpRequest; response: HttpResponse }): Promise<void> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user