2
0
mirror of https://github.com/esiur/esiur-js.git synced 2026-03-18 15:30:38 +00:00
This commit is contained in:
2024-06-22 04:09:50 +03:00
parent 84bf9fa539
commit c0e31662b7
19 changed files with 1657 additions and 1011 deletions

View File

@@ -1,7 +1,8 @@
// AuthenticationMethod
export default
{
None: 0,
Certificate: 1,
Credentials: 2,
Token: 3
Credentials: 1,
Token: 2,
Certificate: 3
};

View File

@@ -26,16 +26,27 @@
*/
"use strict";
import AuthenticationType from "./AuthenticationType.js";
import AuthenticationMethod from "./AuthenticationMethod.js";
import KeyList from "../../Data/KeyList.js";
export default class Session
{
constructor(localAuthentication, remoteAuthentication)
{
this.localAuthentication = localAuthentication;
this.remoteAuthentication = remoteAuthentication;
this.id = null;
this.creation = null;
this.modification = null;
}
id;
creation = Date();
modification = Date();
variables = new KeyList();
localHeaders = new Map();
remoteHeaders = new Map();
localMethod = AuthenticationMethod.None;
remoteMethod = AuthenticationMethod.None;
authenticationType = AuthenticationType.Host ;
authorizedAccount;
}

View File

@@ -0,0 +1,19 @@
//AuthorizationResults
export default class {
response;
destination;
requiredFormat;
clue;
timeout; // 0 means no timeout
reference;
issue = new Date();
get expired (){
this.timeout == 0 ? false : ((new Date() - this.issue) / 1000) > this.timeout;
}
}

View File

@@ -7,32 +7,44 @@ export default class IMembership extends IResource
return new AsyncReply(false);
}
getPassword(username, domain)
{
tokenExists(tokenIndex, domain) {
return new AsyncReply(false);
}
getPassword(username, domain) {
return new AsyncReply(null);
}
getToken(tokenIndex, domain) {
return new AsyncReply(null);
}
authorize(session){
return new AsyncReply(new AuthorizationResults());
}
authorizePlain(session, reference, value){
return new AsyncReply(new AuthorizationResults());
}
authorizeHashed(session, reference, algorithm, value) {
return new AsyncReply(new AuthorizationResults());
}
authorizeEncrypted(session, reference, algorithm, value) {
return new AsyncReply(new AuthorizationResults());
}
login(session) {
return new AsyncReply(true);
}
logout(session){
return new AsyncReply(true);
}
get guestsAllowed() {
return false;
}
getToken(tokenIndex, domain)
{
return new AsyncReply(null);
}
login(session)
{
}
logout(session)
{
}
tokenExists(tokenIndex, domain)
{
}
}