mirror of
https://github.com/esiur/esiur-js.git
synced 2026-03-18 15:30:38 +00:00
IAuth
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
// AuthenticationMethod
|
||||
export default
|
||||
{
|
||||
None: 0,
|
||||
Certificate: 1,
|
||||
Credentials: 2,
|
||||
Token: 3
|
||||
Credentials: 1,
|
||||
Token: 2,
|
||||
Certificate: 3
|
||||
};
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
19
src/Security/Membership/AuthorizationResults.js
Normal file
19
src/Security/Membership/AuthorizationResults.js
Normal 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user