backend/source/auth.ts

94 lines
1.6 KiB
TypeScript
Raw Normal View History

2024-09-18 18:17:25 +02:00
namespace _zeitbild.auth
{
/**
let _subject : (
null
|
lib_plankton.auth.type_auth<any, any>
) = null;
*/
/**
*/
export function init(
) : Promise<void>
{
/*
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<boolean>(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<void>(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<string>
{
return _subject.execute(input);
}
*/
/**
export function control(
input : any
) : Promise<void>
{
return _subject.control(input);
}
*/
}