Reserve(DateTime?StartTime = null, TimeSpan?Duration = null, ChargingReservation_Id?ReservationId = null, eMobilityProvider_Id?ProviderId = null, RemoteAuthentication RemoteAuthentication = null, ChargingProduct ChargingProduct = null, IEnumerable <Auth_Token> AuthTokens = null, IEnumerable <eMobilityAccount_Id> eMAIds = null, IEnumerable <UInt32> PINs = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) => Reserve(ChargingLocation.FromEVSEId(Id), ChargingReservationLevel.EVSE, StartTime, Duration, ReservationId, ProviderId, RemoteAuthentication, ChargingProduct, AuthTokens, eMAIds, PINs, Timestamp, CancellationToken, EventTrackingId, RequestTimeout);
RemoteStop(ChargingSession_Id SessionId, ReservationHandling?ReservationHandling = null, eMobilityProvider_Id?ProviderId = null, RemoteAuthentication RemoteAuthentication = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) { if (_ANetworkChargingStation == null) { return(RemoteStopResult.OutOfService(SessionId)); } return(await _ANetworkChargingStation. RemoteStop(SessionId, ReservationHandling, ProviderId, RemoteAuthentication, Timestamp, CancellationToken, EventTrackingId, RequestTimeout)); }
RemoteStart(ChargingLocation ChargingLocation, ChargingProduct ChargingProduct = null, ChargingReservation_Id?ReservationId = null, ChargingSession_Id?SessionId = null, eMobilityProvider_Id?ProviderId = null, RemoteAuthentication RemoteAuthentication = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) { if (_ANetworkChargingStation == null) { return(RemoteStartResult.OutOfService); } return(await _ANetworkChargingStation. RemoteStart(ChargingLocation.FromEVSEId(Id), ChargingProduct, ReservationId, SessionId, ProviderId, RemoteAuthentication, Timestamp, CancellationToken, EventTrackingId, RequestTimeout)); }
public override void updateRecord(RemoteAuthentication remoteAuth) { // create necessary records if (serverContext.userManager.findByUid(remoteAuth.user.uuid) == null) { serverContext.userManager.register(remoteAuth.user); } }
public RemoteAuthenticationManageModel(RemoteAuthentication remoteAuthentication) : this() { Id = remoteAuthentication.Id; Name = remoteAuthentication.Name; ServiceUrl = remoteAuthentication.ServiceUrl; AuthorizeCode = remoteAuthentication.AuthorizeCode; RecordOrder = remoteAuthentication.RecordOrder; }
public void NpcapDeviceListNullAuthTest() { using (new RemotePcapServer(NullAuthArgs)) { var auth = new RemoteAuthentication(AuthenticationTypes.Null, null, null); CollectionAssert.IsNotEmpty(NpcapDeviceList.Devices(IPAddress.Loopback, 2002, auth)); CollectionAssert.IsNotEmpty(NpcapDeviceList.Devices(IPAddress.Loopback, 2002, null)); } }
public void NpcapDeviceListNullAuthTest() { using (new RemotePcapServer(NullAuthArgs)) { var auth = new RemoteAuthentication(AuthenticationTypes.Null, null, null); var loopback = new IPEndPoint(IPAddress.Loopback, 2002); CollectionAssert.IsNotEmpty(PcapInterface.GetAllPcapInterfaces(loopback, auth)); CollectionAssert.IsNotEmpty(PcapInterface.GetAllPcapInterfaces(loopback, null)); } }
public void PcapInterfaceNullAuthTest( [ValueSource(nameof(NullAuthCredentials))] RemoteAuthentication credentials ) { using (new RemotePcapServer(NullAuthArgs)) { var list = PcapInterface.GetAllPcapInterfaces(LoopbackSource, credentials); CollectionAssert.IsNotEmpty(list); } }
public virtual string issueSession(RemoteAuthentication identity) { // get a session token var sessionId = getSessionToken(identity.user.uuid); // store identity in a session var sess = serverContext.sessions.create(sessionId, sessionValidity); sess.jar.Register <RemoteAuthentication>(identity); return(sessionId); }
RemoteStop(ChargingSession_Id SessionId, ReservationHandling?ReservationHandling = null, eMobilityProvider_Id?ProviderId = null, RemoteAuthentication RemoteAuthentication = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) { return(Task.FromResult(RemoteStopResult.OutOfService(SessionId))); }
RemoteStart(ChargingLocation ChargingLocation, ChargingProduct ChargingProduct = null, ChargingReservation_Id?ReservationId = null, ChargingSession_Id?SessionId = null, eMobilityProvider_Id?ProviderId = null, RemoteAuthentication RemoteAuthentication = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) { return(Task.FromResult(RemoteStartResult.OutOfService)); }
public void PwdAuthTest() { try { if (!TestUser.Create()) { Assert.Inconclusive("Please rerun the test as administrator."); } var goodCred = new RemoteAuthentication(AuthenticationTypes.Password, TestUser.Username, TestUser.Password); var badCred = new RemoteAuthentication(AuthenticationTypes.Password, "foo", "bar"); using (new RemotePcapServer(PwdAuthArgs)) { var pcapIfs = PcapInterface.GetAllPcapInterfaces("rpcap://localhost/", goodCred); var loopback = new IPEndPoint(IPAddress.Loopback, 2002); // using rpcap with LibPcapLiveDevice should be possible using var device = new LibPcapLiveDevice(pcapIfs[0]); // repassing the auth to Open() should be optional device.Open(); Assert.IsTrue(device.Opened); device.Close(); Assert.Throws <PcapException>( () => device.Open(StrictConfig(new DeviceConfiguration { Mode = DeviceModes.NoCaptureRemote, // Setting Immediate increase code coverage // Does not affect overall function of the test // Immediate would be translated to DeviceModes.MaxResponsiveness Immediate = true, ReadTimeout = 1, Credentials = badCred })), "Credentials provided to Open() method takes precedence" ); Assert.Throws <PcapException>( () => PcapInterface.GetAllPcapInterfaces("rpcap://localhost/", badCred) ); } } finally { TestUser.Delete(); } }
public static RemoteAuthentication ToWWCP(this User_Id UserId) { if (UserId.Format == UserIdFormats.eMA || UserId.Format == UserIdFormats.eMI3 || UserId.Format == UserIdFormats.EVCO || UserId.Format == UserIdFormats.EMP_SPEC) { return(RemoteAuthentication.FromRemoteIdentification(eMobilityAccount_Id.Parse(UserId.ToString()))); } if (UserId.Format == UserIdFormats.RFID_UID) { return(RemoteAuthentication.FromAuthToken(Auth_Token.Parse(UserId.ToString()))); } return(null); }
public void PwdAuthTest() { try { if (!TestUser.Create()) { Assert.Inconclusive("Please rerun the test as administrator."); } var goodCred = new RemoteAuthentication(AuthenticationTypes.Password, TestUser.Username, TestUser.Password); var badCred = new RemoteAuthentication(AuthenticationTypes.Password, "foo", "bar"); using (new RemotePcapServer(PwdAuthArgs)) { var pcapIfs = PcapInterface.GetAllPcapInterfaces("rpcap://localhost/", goodCred); var npcapDevices = NpcapDeviceList.Devices(IPAddress.Loopback, NpcapDeviceList.RpcapdDefaultPort, goodCred); CollectionAssert.IsNotEmpty(npcapDevices); var devices = new PcapDevice[] { // using NpcapDevice npcapDevices[0], // using rpcap with LibPcapLiveDevice should be possible new LibPcapLiveDevice(pcapIfs[0]) }; foreach (var device in devices) { // repassing the auth to Open() should be optional device.Open(); Assert.IsTrue(device.Opened); device.Close(); } Assert.Throws <PcapException>( () => npcapDevices[0].Open(OpenFlags.NoCaptureRemote, 1, badCred), "Credentials provided to Open() method takes precedence" ); Assert.Throws <PcapException>( () => PcapInterface.GetAllPcapInterfaces("rpcap://localhost/", badCred) ); } } finally { TestUser.Delete(); } }
Reserve(ChargingLocation ChargingLocation, ChargingReservationLevel ReservationLevel = ChargingReservationLevel.EVSE, DateTime?StartTime = null, TimeSpan?Duration = null, ChargingReservation_Id?ReservationId = null, eMobilityProvider_Id?ProviderId = null, RemoteAuthentication RemoteAuthentication = null, ChargingProduct ChargingProduct = null, IEnumerable <Auth_Token> AuthTokens = null, IEnumerable <eMobilityAccount_Id> eMAIds = null, IEnumerable <UInt32> PINs = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) { return(Task.FromResult(ReservationResult.OutOfService)); }
Reserve(ChargingLocation ChargingLocation, ChargingReservationLevel ReservationLevel = ChargingReservationLevel.EVSE, DateTime?StartTime = null, TimeSpan?Duration = null, ChargingReservation_Id?ReservationId = null, eMobilityProvider_Id?ProviderId = null, RemoteAuthentication RemoteAuthentication = null, ChargingProduct ChargingProduct = null, IEnumerable <Auth_Token> AuthTokens = null, IEnumerable <eMobilityAccount_Id> eMAIds = null, IEnumerable <UInt32> PINs = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) { if (_ANetworkChargingStation == null) { return(ReservationResult.OutOfService); } return(await _ANetworkChargingStation. Reserve(ChargingLocation, ReservationLevel, StartTime, Duration, ReservationId, ProviderId, RemoteAuthentication, ChargingProduct, AuthTokens, eMAIds, PINs, Timestamp, CancellationToken, EventTrackingId, RequestTimeout)); }
RemoteStart(ChargingProduct ChargingProduct = null, ChargingReservation_Id?ReservationId = null, ChargingSession_Id?SessionId = null, eMobilityProvider_Id?ProviderId = null, RemoteAuthentication RemoteAuthentication = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) => RemoteStart(ChargingLocation.FromEVSEId(Id), ChargingProduct, ReservationId, SessionId, ProviderId, RemoteAuthentication, Timestamp, CancellationToken, EventTrackingId, RequestTimeout);
public Task <ReservationResult> Reserve(ChargingLocation ChargingLocation, ChargingReservationLevel ReservationLevel = ChargingReservationLevel.EVSE, DateTime?StartTime = null, TimeSpan?Duration = null, ChargingReservation_Id?ReservationId = null, eMobilityProvider_Id?ProviderId = null, RemoteAuthentication RemoteAuthentication = null, ChargingProduct ChargingProduct = null, IEnumerable <Auth_Token> AuthTokens = null, IEnumerable <eMobilityAccount_Id> eMAIds = null, IEnumerable <uint> PINs = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) { throw new NotImplementedException(); }
internal ResponseModel Delete(RemoteAuthentication remoteAuthentication) { return(_remoteAuthenticationRepository.Delete(remoteAuthentication)); }
internal ResponseModel Insert(RemoteAuthentication remoteAuthentication) { return(_remoteAuthenticationRepository.Insert(remoteAuthentication)); }
public Task <RemoteStopResult> RemoteStop(ChargingSession_Id SessionId, ReservationHandling?ReservationHandling = null, eMobilityProvider_Id?ProviderId = null, RemoteAuthentication RemoteAuthentication = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) { throw new NotImplementedException(); }
public virtual void updateRecord(RemoteAuthentication remoteAuth) { }
public GateUser(RemoteAuthentication auth, string session) { this.auth = auth; this.session = session; }