UNPKG

@solid/community-server

Version:

Community Solid Server: an open and modular implementation of the Solid specifications

29 lines (28 loc) 1.31 kB
import type { PermissionReaderInput } from './PermissionReader'; import { PermissionReader } from './PermissionReader'; import type { AccessMap, MultiPermissionMap } from './permissions/Permissions'; /** * Redirects requests to specific PermissionReaders based on their identifier. * The keys are regular expression strings. * The regular expressions should all start with a slash * and will be evaluated relative to the base URL. * * Will error if no match is found. */ export declare class PathBasedReader extends PermissionReader { protected readonly logger: import("global-logger-factory").Logger<unknown>; protected readonly baseUrl: string; private readonly paths; protected readonly defaultReader?: PermissionReader; constructor(baseUrl: string, paths: Record<string, PermissionReader>, defaultReader?: PermissionReader); canHandle(input: PermissionReaderInput): Promise<void>; handle(input: PermissionReaderInput): Promise<MultiPermissionMap>; /** * Returns for each reader the matching part of the access map. */ protected matchReaders(accessMap: AccessMap): Map<PermissionReader, AccessMap>; /** * Find the PermissionReader corresponding to the given path. */ protected findReader(path: string): PermissionReader | undefined; }