import { HttpClient, HttpEvent, HttpHandlerFn, HttpRequest } from '@angular/common/http'; import { Router } from '@angular/router'; import { Observable } from 'rxjs'; import type { NAuthClientConfig } from '@nauth-toolkit/client'; import { AuthService } from '../ngmodule/auth.service'; /** * Whether a request targets the nauth API this interceptor holds credentials for. * * Compares resolved origins and requires the request path to sit under the API's own * path. A substring test would treat `https://api.example.com.evil.com/collect` and * `https://evil.com/?u=https://api.example.com` as first-party and hand an attacker * the session cookie or bearer token, so the comparison must be structural. * * Fails closed: an unparseable URL is never treated as the API. * * @param requestUrl - The outgoing request's URL * @param baseUrl - The configured API base URL * @returns True only when the request provably targets the API */ export declare function isSameApiTarget(requestUrl: string, baseUrl: string): boolean; /** * Whether a request's resolved path ends at the given endpoint path. * * Matches on the parsed pathname so a query string can never satisfy the test, and on * a whole trailing segment so `/relogin` does not count as `/login`. * * @param requestUrl - The outgoing request's URL * @param endpointPath - The endpoint path to test, relative to the API base * @returns True when the request targets that endpoint */ export declare function isEndpointPath(requestUrl: string, endpointPath: string): boolean; export declare function createNAuthAuthHttpInterceptor(params: { config: NAuthClientConfig; http: HttpClient; authService: AuthService; router: Router; next: HttpHandlerFn; req: HttpRequest; }): Observable>;