mirror of
https://github.com/esiur/esiur-dart.git
synced 2026-04-03 17:58:21 +00:00
IAuth
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
|
||||
enum AuthenticationMethod
|
||||
{
|
||||
None,
|
||||
Certificate,
|
||||
Credentials,
|
||||
Token,
|
||||
None,
|
||||
Credentials,
|
||||
Token,
|
||||
Certificate
|
||||
}
|
||||
@@ -21,32 +21,28 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
import '../../Data/DC.dart';
|
||||
import 'Authentication.dart';
|
||||
import '../../Data/IntType.dart';
|
||||
import '../../Data/KeyList.dart';
|
||||
import 'AuthenticationMethod.dart';
|
||||
import 'AuthenticationType.dart';
|
||||
|
||||
class Session
|
||||
{
|
||||
Authentication get localAuthentication => _localAuth;
|
||||
Authentication get remoteAuthentication => _remoteAuth;
|
||||
|
||||
// public Source Source { get; }
|
||||
DC? id;
|
||||
|
||||
//DateTime get creation => _creation;
|
||||
|
||||
//public DateTime Modification { get; }
|
||||
DateTime creation = DateTime.now();
|
||||
DateTime modification = DateTime.now();
|
||||
|
||||
final KeyList<String, dynamic> variables = new KeyList<String, dynamic>();
|
||||
|
||||
//KeyList<string, object> Variables { get; }
|
||||
//IStore Store { get; }
|
||||
Map<UInt8, dynamic> localHeaders = Map<UInt8, dynamic>();
|
||||
Map<UInt8, dynamic> remoteHeaders = Map<UInt8, dynamic>();
|
||||
|
||||
//string id;
|
||||
Authentication _localAuth, _remoteAuth;
|
||||
|
||||
AuthenticationMethod localMethod = AuthenticationMethod.None;
|
||||
AuthenticationMethod remoteMethod = AuthenticationMethod.None;
|
||||
|
||||
Session(this._localAuth, this._remoteAuth)
|
||||
{
|
||||
|
||||
}
|
||||
AuthenticationType authenticationType = AuthenticationType.Host ;
|
||||
|
||||
String? authorizedAccount;
|
||||
}
|
||||
|
||||
18
lib/src/Security/Membership/AuthorizationResults.dart
Normal file
18
lib/src/Security/Membership/AuthorizationResults.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import '../../Net/Packets/IIPAuthPacketIAuthDestination.dart';
|
||||
import '../../Net/Packets/IIPAuthPacketIAuthFormat.dart';
|
||||
import 'AuthorizationResultsResponse.dart';
|
||||
|
||||
class AuthorizationResults
|
||||
{
|
||||
AuthorizationResultsResponse response = AuthorizationResultsResponse.Failed;
|
||||
int destination = IIPAuthPacketIAuthDestination.Self;
|
||||
int requiredFormat = IIPAuthPacketIAuthFormat.None ;
|
||||
String clue = "";
|
||||
|
||||
int timeout = 0; // 0 means no timeout
|
||||
int reference = 0;
|
||||
|
||||
DateTime issue = DateTime.now();
|
||||
|
||||
//bool expired => timeout == 0 ? false : (DateTime.UtcNow - Issue).TotalSeconds > Timeout;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
enum AuthorizationResultsResponse
|
||||
{
|
||||
Success,
|
||||
Failed,
|
||||
Expired,
|
||||
ServiceUnavailable,
|
||||
IAuthPlain,
|
||||
IAuthHashed,
|
||||
IAuthEncrypted
|
||||
}
|
||||
26
lib/src/Security/Membership/IMembership.dart
Normal file
26
lib/src/Security/Membership/IMembership.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
import '../../Core/AsyncReply.dart';
|
||||
import '../../Data/DC.dart';
|
||||
import '../../Net/Packets/IIPAuthPacketHashAlgorithm.dart';
|
||||
import '../Authority/Session.dart';
|
||||
import 'AuthorizationResults.dart';
|
||||
|
||||
abstract class IMembership
|
||||
{
|
||||
//public event ResourceEventHandler<AuthorizationIndication> Authorization;
|
||||
|
||||
AsyncReply<String?> userExists(String username, String domain);
|
||||
AsyncReply<String?> tokenExists(int tokenIndex, String domain);
|
||||
|
||||
AsyncReply<DC?> getPassword(String username, String domain);
|
||||
AsyncReply<DC?> getToken(String tokenIndex, String domain);
|
||||
AsyncReply<AuthorizationResults> authorize(Session session);
|
||||
AsyncReply<AuthorizationResults> authorizePlain(Session session, int reference, value);
|
||||
AsyncReply<AuthorizationResults> authorizeHashed(Session session, int reference, int algorithm, DC value);
|
||||
AsyncReply<AuthorizationResults> authorizeEncrypted(Session session, int reference, int algorithm, DC value);
|
||||
|
||||
AsyncReply<bool> login(Session session);
|
||||
AsyncReply<bool> logout(Session session);
|
||||
bool get guestsAllowed;
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user