namespace _zeitbild.auth { /** let _subject : ( null | lib_plankton.auth.type_auth ) = null; */ /** */ export function init( ) : Promise { /* switch (_zeitbild.conf.get().auth.kind) { case "internal": { _subject = lib_plankton.auth.internal.implementation_auth( { // "password_image_chest": password_image_chest, // "check_password": (image, input) => Promise.resolve(image === get_password_image(input)), } ); } case "oidc": { _subject = lib_plankton.auth.oidc.implementation_auth( { "url_authorization": _zeitbild.conf.get().auth.data.url_authorization, "url_token": _zeitbild.conf.get().auth.data.url_token, "url_userinfo": _zeitbild.conf.get().auth.data.url_userinfo, "client_id": _zeitbild.conf.get().auth.data.client_id, "client_secret": _zeitbild.conf.get().auth.data.client_secret, "url_redirect": "/session/begin", "scopes": [ "openid", "profile", "email", ], "login_url_mode": "open", } ); } default: { // do nothing break; } } */ return Promise.resolve(undefined); } /** export function prepare( ) : Promise<{kind : string; data : any;}> { return ( _subject.prepare() .then( (data) => ({ "kind": _zeitbild.conf.get().auth.kind, "data": data, }) ) ); } */ /** export function execute( input : any ) : Promise { return _subject.execute(input); } */ /** export function control( input : any ) : Promise { return _subject.control(input); } */ }