Compare commits
No commits in common. "8163a12a684ab6b0fd439de8f0d0b6337dd442b4" and "243f1bb155475ca112996c7cad4471dd43842278" have entirely different histories.
8163a12a68
...
243f1bb155
5
lib/plankton/plankton.d.ts
vendored
5
lib/plankton/plankton.d.ts
vendored
|
|
@ -586,10 +586,6 @@ declare namespace lib_plankton.call {
|
||||||
* @author fenris
|
* @author fenris
|
||||||
*/
|
*/
|
||||||
export function timeout(procedure: (() => void), delay_in_seconds: float): int;
|
export function timeout(procedure: (() => void), delay_in_seconds: float): int;
|
||||||
/**
|
|
||||||
* @author fenris
|
|
||||||
*/
|
|
||||||
export function loop(procedure: (() => void), delay_in_seconds: float): int;
|
|
||||||
/**
|
/**
|
||||||
* Promise version of "setTimeout"
|
* Promise version of "setTimeout"
|
||||||
*
|
*
|
||||||
|
|
@ -4595,7 +4591,6 @@ declare namespace lib_plankton.auth.oidc {
|
||||||
*/
|
*/
|
||||||
type type_userinfo = {
|
type type_userinfo = {
|
||||||
name: (null | string);
|
name: (null | string);
|
||||||
label: (null | string);
|
|
||||||
email: (null | string);
|
email: (null | string);
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1331,14 +1331,6 @@ var lib_plankton;
|
||||||
/*window.*/ setTimeout(procedure, Math.floor(delay_in_seconds * 1000)));
|
/*window.*/ setTimeout(procedure, Math.floor(delay_in_seconds * 1000)));
|
||||||
}
|
}
|
||||||
call.timeout = timeout;
|
call.timeout = timeout;
|
||||||
/**
|
|
||||||
* @author fenris
|
|
||||||
*/
|
|
||||||
function loop(procedure, delay_in_seconds) {
|
|
||||||
return (
|
|
||||||
/*window.*/ setInterval(procedure, Math.floor(delay_in_seconds * 1000)));
|
|
||||||
}
|
|
||||||
call.loop = loop;
|
|
||||||
/**
|
/**
|
||||||
* Promise version of "setTimeout"
|
* Promise version of "setTimeout"
|
||||||
*
|
*
|
||||||
|
|
@ -16162,8 +16154,7 @@ var lib_plankton;
|
||||||
});
|
});
|
||||||
const data = lib_plankton.json.decode(http_response.body.toString());
|
const data = lib_plankton.json.decode(http_response.body.toString());
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
"name": (data["preferred_username"] ?? null),
|
"name": (data["name"] ?? null),
|
||||||
"label": (data["name"] ?? null),
|
|
||||||
"email": (data["email"] ?? null),
|
"email": (data["email"] ?? null),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,12 +52,10 @@ namespace _zeitbild.auth
|
||||||
key : string
|
key : string
|
||||||
) : string
|
) : string
|
||||||
{
|
{
|
||||||
if (_oidc_redict_uri_template_map === null)
|
if (_oidc_redict_uri_template_map === null) {
|
||||||
{
|
|
||||||
throw (new Error("apparently not initialized yet"));
|
throw (new Error("apparently not initialized yet"));
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
return _oidc_redict_uri_template_map.get(key);
|
return _oidc_redict_uri_template_map.get(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -69,8 +67,7 @@ namespace _zeitbild.auth
|
||||||
) : Promise<void>
|
) : Promise<void>
|
||||||
{
|
{
|
||||||
switch (_zeitbild.conf.get().authentication.kind) {
|
switch (_zeitbild.conf.get().authentication.kind) {
|
||||||
case "internal":
|
case "internal": {
|
||||||
{
|
|
||||||
_subject = lib_plankton.auth.internal.implementation_auth(
|
_subject = lib_plankton.auth.internal.implementation_auth(
|
||||||
{
|
{
|
||||||
"password_image_chest": {
|
"password_image_chest": {
|
||||||
|
|
@ -86,8 +83,7 @@ namespace _zeitbild.auth
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "oidc":
|
case "oidc": {
|
||||||
{
|
|
||||||
_subject_oidc = lib_plankton.auth.oidc.make(
|
_subject_oidc = lib_plankton.auth.oidc.make(
|
||||||
{
|
{
|
||||||
"url_authorization": _zeitbild.conf.get().authentication.data.url_authorization,
|
"url_authorization": _zeitbild.conf.get().authentication.data.url_authorization,
|
||||||
|
|
@ -112,8 +108,7 @@ namespace _zeitbild.auth
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default: {
|
||||||
{
|
|
||||||
// do nothing
|
// do nothing
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -128,16 +123,12 @@ namespace _zeitbild.auth
|
||||||
input : any
|
input : any
|
||||||
) : Promise<{kind : string; data : any;}>
|
) : Promise<{kind : string; data : any;}>
|
||||||
{
|
{
|
||||||
switch (_zeitbild.conf.get().authentication.kind)
|
switch (_zeitbild.conf.get().authentication.kind) {
|
||||||
{
|
case "oidc": {
|
||||||
case "oidc":
|
if ((_subject_oidc === null) || (_oidc_redict_uri_template_map === null)) {
|
||||||
{
|
|
||||||
if ((_subject_oidc === null) || (_oidc_redict_uri_template_map === null))
|
|
||||||
{
|
|
||||||
throw (new Error("not initialized yet"));
|
throw (new Error("not initialized yet"));
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
const stuff : {state : string; authorization_url : string;} = lib_plankton.auth.oidc.prepare_login(_subject_oidc);
|
const stuff : {state : string; authorization_url : string;} = lib_plankton.auth.oidc.prepare_login(_subject_oidc);
|
||||||
_oidc_redict_uri_template_map.set(
|
_oidc_redict_uri_template_map.set(
|
||||||
stuff.state,
|
stuff.state,
|
||||||
|
|
@ -155,14 +146,11 @@ namespace _zeitbild.auth
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default: {
|
||||||
{
|
if (_subject === null) {
|
||||||
if (_subject === null)
|
|
||||||
{
|
|
||||||
return Promise.reject(new Error("not initialized yet"));
|
return Promise.reject(new Error("not initialized yet"));
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
return (
|
return (
|
||||||
_subject.login_prepare()
|
_subject.login_prepare()
|
||||||
.then(
|
.then(
|
||||||
|
|
@ -195,12 +183,10 @@ namespace _zeitbild.auth
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
if ((_subject_oidc === null) || (_oidc_redict_uri_template_map === null))
|
if ((_subject_oidc === null) || (_oidc_redict_uri_template_map === null)) {
|
||||||
{
|
|
||||||
throw (new Error("not initialized yet"));
|
throw (new Error("not initialized yet"));
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
const state : string = data["state"];
|
const state : string = data["state"];
|
||||||
const result : {
|
const result : {
|
||||||
token : string;
|
token : string;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue