globe-and-citizen / Celebrity-Fanalyzer

Celebrities Over Analyzed
https://celebrityfanalyzer.com
GNU General Public License v2.0
5 stars 12 forks source link

Add a Mock Layer8 #520

Closed stravid87 closed 1 week ago

stravid87 commented 4 weeks ago

Description The Layer8 Interceptor has become a performance bottleneck such that testing other optimizations is difficult because of it's operation. The purpose of this issue is to create a mock for layer8 that can still access the functionality of statsAPI but without the E2E encryption that it provides.

Acceptance Criteria

  1. An mock NPM module that takes the place of the Layer8_interceptor and Layer8_middlware so that, once reintroduced, the real Interceptor and Middleware can be easily slotted back in.
  2. The mock should expose all the same functionality as Layer8 currently:
    export interface Layer8 {
    testWASM(arg: any): Promise<any>,
    persistenceCheck(): Promise<any>,
    initEncryptedTunnel(config: Layer8Config): Promise<boolean>,
    static(url: string): Promise<string>,
    fetch(input: RequestInfo | URL, init?: RequestInit | undefined): Promise<Response>
    }
stravid87 commented 2 weeks ago

UPDATE only functions necessary Init, fetch (test, persistence & static unnecessary)

marclupanc commented 1 week ago

Implemented in #524