Add logging and fallback for failing vpnless requests
Summary: If a requests fails due to lack of allow-listing or other incompatibilities, we will now fall back to VPN mode while logging an error that will hopefully end up at the plugin owner. For this, there's a new `vpnMode` option on every request that can also be used to enforce a particular type. There's a lot of verbose logging that's turned off by default but very handy when debugging. Also potentially useful for plugin authors that are looking into request issues. Reviewed By: lblasa Differential Revision: D49023365 fbshipit-source-id: 755393063e379587feda9ae13973877780a1d987
This commit is contained in:
committed by
Facebook GitHub Bot
parent
2ad789d14e
commit
777632b841
@@ -361,6 +361,7 @@ export type FlipperServerCommands = {
|
|||||||
timeout?: number;
|
timeout?: number;
|
||||||
internGraphUrl?: string;
|
internGraphUrl?: string;
|
||||||
headers?: Record<string, string | number | boolean>;
|
headers?: Record<string, string | number | boolean>;
|
||||||
|
vpnMode?: 'vpn' | 'vpnless';
|
||||||
},
|
},
|
||||||
) => Promise<GraphResponse>;
|
) => Promise<GraphResponse>;
|
||||||
'intern-graph-get': (
|
'intern-graph-get': (
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export async function internGraphPOSTAPIRequest(
|
|||||||
timeout?: number;
|
timeout?: number;
|
||||||
internGraphUrl?: string;
|
internGraphUrl?: string;
|
||||||
headers?: Record<string, string | number | boolean>;
|
headers?: Record<string, string | number | boolean>;
|
||||||
|
vpnMode?: 'vpn' | 'vpnless';
|
||||||
},
|
},
|
||||||
token: string,
|
token: string,
|
||||||
): Promise<GraphResponse> {
|
): Promise<GraphResponse> {
|
||||||
@@ -36,6 +37,7 @@ export async function internGraphGETAPIRequest(
|
|||||||
timeout?: number;
|
timeout?: number;
|
||||||
internGraphUrl?: string;
|
internGraphUrl?: string;
|
||||||
headers?: Record<string, string | number | boolean>;
|
headers?: Record<string, string | number | boolean>;
|
||||||
|
vpnMode?: 'vpn' | 'vpnless';
|
||||||
},
|
},
|
||||||
token: string,
|
token: string,
|
||||||
): Promise<GraphResponse> {
|
): Promise<GraphResponse> {
|
||||||
|
|||||||
Reference in New Issue
Block a user