mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
Displays the current authentication mechanism in the admin panel (#981)
* Adds authentication mechanism to admin panel Adds field to the "Security settings" admin display, showing the currently configured authentication mechanism. * Adds 14px margin to admin panel names
This commit is contained in:
@@ -58,6 +58,7 @@ export class BootProbes {
|
||||
this._probes.push(_bootProbe);
|
||||
this._probes.push(_hostHeaderProbe);
|
||||
this._probes.push(_sandboxingProbe);
|
||||
this._probes.push(_authenticationProbe);
|
||||
this._probeById = new Map(this._probes.map(p => [p.id, p]));
|
||||
}
|
||||
}
|
||||
@@ -202,3 +203,17 @@ const _sandboxingProbe: Probe = {
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
const _authenticationProbe: Probe = {
|
||||
id: 'authentication',
|
||||
name: 'Authentication system',
|
||||
apply: async(server, req) => {
|
||||
const loginSystemId = server.getInfo('loginMiddlewareComment');
|
||||
return {
|
||||
success: loginSystemId != undefined,
|
||||
details: {
|
||||
loginSystemId,
|
||||
}
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1426,6 +1426,11 @@ export class FlexServer implements GristServer {
|
||||
return this._sandboxInfo;
|
||||
}
|
||||
|
||||
public getInfo(key: string): any {
|
||||
const infoPair = this.info.find(([keyToCheck]) => key === keyToCheck);
|
||||
return infoPair?.[1];
|
||||
}
|
||||
|
||||
public disableExternalStorage() {
|
||||
if (this.deps.has('doc')) {
|
||||
throw new Error('disableExternalStorage called too late');
|
||||
|
||||
@@ -67,6 +67,7 @@ export interface GristServer {
|
||||
getBundledWidgets(): ICustomWidget[];
|
||||
hasBoot(): boolean;
|
||||
getSandboxInfo(): SandboxInfo|undefined;
|
||||
getInfo(key: string): any;
|
||||
}
|
||||
|
||||
export interface GristLoginSystem {
|
||||
@@ -159,6 +160,7 @@ export function createDummyGristServer(): GristServer {
|
||||
getBundledWidgets() { return []; },
|
||||
hasBoot() { return false; },
|
||||
getSandboxInfo() { return undefined; },
|
||||
getInfo(key: string) { return undefined; }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user