Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 1443 → Rev 1444

/trunk/changelog.json.php
3,6 → 3,17
"dummy": "<?php die('For security reasons, this file can only be accessed locally (without PHP).'.base64_decode('IgogICAgfQpdCg==')); /* @phpstan-ignore-line */ ?>"
},
{
"version": "2.0.1.10",
"date": "2023-12-25 23:20:00 +0100",
"author": "Daniel Marschall (ViaThinkSoft)",
"changes": [
"Login with two users simultanously is now possible again.",
"REST API Objects Endpoint: Added output field \"children\".",
"REST API Objects Endpoint: PUT and POST works again.",
"Updates are now also stored in a GitHub repo."
]
},
{
"version": "2.0.1.9",
"date": "2023-12-03 18:45:00 +0100",
"author": "Daniel Marschall (ViaThinkSoft)",
/trunk/includes/classes/OIDplusAuthContentStoreJWT.class.php
664,16 → 664,18
*/
public function loadJWT(string $jwt) {
\Firebase\JWT\JWT::$leeway = 60; // leeway in seconds
$cls_content = null;
if (OIDplus::getPkiStatus()) {
$pubKey = OIDplus::getSystemPublicKey();
$k = new \Firebase\JWT\Key($pubKey, 'RS256'); // RSA+SHA256 is hardcoded in getPkiStatus() generation
$this->content = (array) \Firebase\JWT\JWT::decode($jwt, $k);
$cls_content = \Firebase\JWT\JWT::decode($jwt, $k);
} else {
$key = OIDplus::authUtils()->makeSecret(['0be35e52-f4ef-11ed-b67e-3c4a92df8582']);
$key = hash_pbkdf2('sha512', $key, '', 10000, 32/*256bit*/, false);
$k = new \Firebase\JWT\Key($key, 'HS512'); // HMAC+SHA512 is hardcoded here
$this->content = (array) \Firebase\JWT\JWT::decode($jwt, $k);
$cls_content = \Firebase\JWT\JWT::decode($jwt, $k);
}
$this->content = json_decode(json_encode($cls_content), true); // convert stdClass to array
}
 
/**
/trunk/plugins/viathinksoft/adminPages/900_software_update/private/gen_serverside_git
147,7 → 147,9
 
$prev_commit = '-';
$prev_version = '2.0.0.0';
$latest_version = null;
foreach ($git_version_cache["version-first-commit"] as $version => $version_first_commit) {
$latest_version = $version;
$changescript_file = $output_dir.'/changescript_'.$version.'.txt';
if ($force || !file_exists($changescript_file) || !file_exists($changescript_file.'.gz')) {
echo "Generate changescript for version $version ($version_first_commit)\n";
182,3 → 184,10
$prev_commit = $version_first_commit;
$prev_version = $version;
}
 
// Step 3 (optional): Upload to GitHub (a different repository, just for deploying updates)
// How to setup a GitHub deployment key? See https://dylancastillo.co/how-to-use-github-deploy-keys/
 
shell_exec("cd ".escapeshellarg($output_dir)." && git add * 2>/dev/null");
shell_exec("cd ".escapeshellarg($output_dir)." && git commit -m ".escapeshellarg("Update $latest_version")." 2>/dev/null");
shell_exec("cd ".escapeshellarg($output_dir)." && git push 2>/dev/null");
/trunk/plugins/viathinksoft/adminPages/902_systemfile_check/checksums.json
Cannot display: file marked as a binary type.
svn:mime-type = application/json
/trunk/plugins/viathinksoft/publicPages/000_objects/OIDplusPagePublicObjects.class.php
128,6 → 128,12
}
}
 
$output['children'] = array();
$children = $obj->getChildren();
foreach ($children as $child) {
$output['children'][] = $child->nodeId(true);
}
 
http_response_code(200);
return $output;
}
159,7 → 165,7
// TODO: Problem: The superior RA cannot set title/description, so they cannot perform the PUT command!
$output = self::action_Update($params);
} else {
$params['parent'] = $obj->getParent();
$params['parent'] = $obj->getParent()->nodeId(true);
$params['id_fully_qualified'] = true;
$output = self::action_Insert($params);
}
185,7 → 191,7
$obj = OIDplusObject::parse($id);
if (!$obj) throw new OIDplusException(_L('%1 action failed because object "%2" cannot be parsed!', 'GET', $id), null, 400);
$params = $json_in;
$params['parent'] = $obj->getParent();
$params['parent'] = $obj->getParent()->nodeId(true);
$params['id_fully_qualified'] = true;
$params['id'] = $id;
$output = self::action_Insert($params);
281,7 → 287,7
if ($kind === 'html') {
$struct = [
_L('Receive') => [
'<b>GET</b> '.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'rest/v1/objects/<abbr title="'._L('e.g. %1', 'oid:2.999').'">[id]</abbr>',
'<b>GET</b> '.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'rest/v1/objects/<abbr title="'._L('e.g. %1', 'oid:2.999').'">[ns]:[id]</abbr>',
_L('Input parameters') => [
'<i>'._L('None').'</i>'
],
295,11 → 301,12
'asn1ids ('._L('for OID only').')',
'confidential',
'title',
'description'
'description',
'children'
]
],
_L('Re-Create') => [
'<b>PUT</b> '.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'rest/v1/objects/<abbr title="'._L('e.g. %1', 'oid:2.999').'">[id]</abbr>',
'<b>PUT</b> '.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'rest/v1/objects/<abbr title="'._L('e.g. %1', 'oid:2.999').'">[ns]:[id]</abbr>',
_L('Input parameters') => [
'ra_email ('._L('optional').')',
'comment ('._L('optional').')',
317,7 → 324,7
]
],
_L('Create') => [
'<b>POST</b> '.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'rest/v1/objects/<abbr title="'._L('e.g. %1', 'oid:2.999').'">[id]</abbr>',
'<b>POST</b> '.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'rest/v1/objects/<abbr title="'._L('e.g. %1', 'oid:2.999').'">[ns]:[id]</abbr>',
_L('Input parameters') => [
'ra_email ('._L('optional').')',
'comment ('._L('optional').')',
335,7 → 342,7
]
],
_L('Update') => [
'<b>PATCH</b> '.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'rest/v1/objects/<abbr title="'._L('e.g. %1', 'oid:2.999').'">[id]</abbr>',
'<b>PATCH</b> '.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'rest/v1/objects/<abbr title="'._L('e.g. %1', 'oid:2.999').'">[ns]:[id]</abbr>',
_L('Input parameters') => [
'ra_email ('._L('optional').')',
'comment ('._L('optional').')',
352,7 → 359,7
]
],
_L('Remove') => [
'<b>DELETE</b> '.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'rest/v1/objects/<abbr title="'._L('e.g. %1', 'oid:2.999').'">[id]</abbr>',
'<b>DELETE</b> '.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'rest/v1/objects/<abbr title="'._L('e.g. %1', 'oid:2.999').'">[ns]:[id]</abbr>',
_L('Input parameters') => [
'<i>'._L('None').'</i>'
],
/trunk/plugins/viathinksoft/publicPages/810_login_google/oauth.php
89,7 → 89,8
}
$verification_certs = json_decode($certs, true);
\Firebase\JWT\JWT::$leeway = 60; // leeway in seconds
$data = (array) \Firebase\JWT\JWT::decode($id_token, $verification_certs, array('ES256', 'ES384', 'RS256', 'RS384', 'RS512'));
$cls_data = \Firebase\JWT\JWT::decode($id_token, $verification_certs, array('ES256', 'ES384', 'RS256', 'RS384', 'RS512'));
$data = json_decode(json_encode($cls_data), true); // convert stdClass to array
if (!isset($data['iss']) || ($data['iss'] !== 'https://accounts.google.com')) {
throw new OIDplusException(_L('JWT token could not be decoded'));
}