public override void SetUp() { base.SetUp(); _originalSettings = CloudConfigurationManager.AppSettings; _configRepository = ObjectFactory.GetInstance <IConfigRepository>(); _securityServices = ObjectFactory.GetInstance <ISecurityServices>(); }
public AuthenticationController(ISecurityServices securityServices, ITerminal terminal, IAuthorization authorization, IPlanDirectoryService planDirectoryService) { _security = securityServices; _terminal = terminal; _authorization = authorization; _planDirectoryService = planDirectoryService; }
public AuthenticationCallbackController() { _terminal = ObjectFactory.GetInstance <ITerminal>(); _activity = ObjectFactory.GetInstance <IActivity>(); _authorization = ObjectFactory.GetInstance <IAuthorization>(); _security = ObjectFactory.GetInstance <ISecurityServices>(); }
public UsersController() { _fr8Account = ObjectFactory.GetInstance <Fr8Account>(); _securityServices = ObjectFactory.GetInstance <ISecurityServices>(); _mappingEngine = ObjectFactory.GetInstance <IMappingEngine>(); _fr8Account = ObjectFactory.GetInstance <Fr8Account>(); }
public IHttpActionResult Login([FromUri] string username, [FromUri] string password) { if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password)) { Logger.GetLogger().Warn($"Username or password is not specified"); return(BadRequest("Username or password is not specified")); } Request.GetOwinContext().Authentication.SignOut(); using (IUnitOfWork uow = ObjectFactory.GetInstance <IUnitOfWork>()) { Fr8AccountDO dockyardAccountDO = uow.UserRepository.FindOne(x => x.UserName == username); if (dockyardAccountDO != null) { var passwordHasher = new PasswordHasher(); if (passwordHasher.VerifyHashedPassword(dockyardAccountDO.PasswordHash, password) == PasswordVerificationResult.Success) { ISecurityServices security = ObjectFactory.GetInstance <ISecurityServices>(); ClaimsIdentity identity = security.GetIdentity(uow, dockyardAccountDO); Request.GetOwinContext().Authentication.SignIn(new AuthenticationProperties { IsPersistent = true }, identity); return(Ok()); } } } Logger.GetLogger().Warn($"Loging failed for {username}"); return(StatusCode(HttpStatusCode.Forbidden)); }
public Activity(ICrateManager crateManager, IAuthorization authorizationToken, ISecurityServices security, IActivityTemplate activityTemplate, IPlanNode planNode, IUpstreamDataExtractionService upstreamDataExtractionService) { _crateManager = crateManager; _authorizationToken = authorizationToken; _security = security; _activityTemplate = activityTemplate; _planNode = planNode; _upstreamDataExtractionService = upstreamDataExtractionService; }
public Plan(IContainerService containerService, Fr8Account dockyardAccount, IActivity activity, ICrateManager crate, ISecurityServices security, IJobDispatcher dispatcher, IPusherNotifier pusher) { _containerService = containerService; _dockyardAccount = dockyardAccount; _activity = activity; _crate = crate; _security = security; _dispatcher = dispatcher; _pusherNotifier = pusher; }
public Terminal(IConfigRepository configRepository, ISecurityServices securityServices) { _securityServices = securityServices; IsATandTCacheDisabled = string.Equals(CloudConfigurationManager.GetSetting("DisableATandTCache"), "true", StringComparison.InvariantCultureIgnoreCase); var serverProtocol = configRepository.Get("ServerProtocol", String.Empty); var domainName = configRepository.Get("ServerDomainName", String.Empty); var domainPort = configRepository.Get <int?>("ServerPort", null); _serverUrl = $"{serverProtocol}{domainName}{(domainPort == null || domainPort.Value == 80 ? String.Empty : (":" + domainPort.Value))}/"; }
public PlansController(IPlan plan, ISecurityServices securityServices, ICrateManager crateManager, IPusherNotifier pusherNotifier, IActivityTemplate activityTemplate, IActivity activity, IPlanDirectoryService planDirectoryService) { _plan = plan; _security = securityServices; _crate = crateManager; _pusherNotifier = pusherNotifier; _activityTemplate = activityTemplate; _activity = activity; _planDirectoryService = planDirectoryService; }
public ManifestRegistryController( IManifestRegistryMonitor manifestRegistryMonitor, IFr8Account fr8Account, IRestfulServiceClient restfulServiceClient, IUnitOfWorkFactory uowFactory, IPusherNotifier pusher, ISecurityServices securityServices) { if (manifestRegistryMonitor == null) { throw new ArgumentNullException(nameof(manifestRegistryMonitor)); } _manifestRegistryMonitor = manifestRegistryMonitor; _fr8Account = fr8Account; _restfulServiceClient = restfulServiceClient; _uowFactory = uowFactory; _pusher = pusher; _securityServices = securityServices; }
public TerminalDiscoveryService( IActivityTemplate activityTemplateService, ITerminal terminal, IRestfulServiceClient restfulServiceClient, EventReporter eventReporter, IUnitOfWorkFactory unitOfWorkFactory, IConfigRepository configRepository, ISecurityServices securityService) { _activityTemplateService = activityTemplateService; _terminal = terminal; _restfulServiceClient = restfulServiceClient; _eventReporter = eventReporter; _unitOfWorkFactory = unitOfWorkFactory; _securityService = securityService; var serverProtocol = configRepository.Get("ServerProtocol", String.Empty); var domainName = configRepository.Get("ServerDomainName", String.Empty); var domainPort = configRepository.Get <int?>("ServerPort", null); _serverUrl = $"{serverProtocol}{domainName}{(domainPort == null || domainPort.Value == 80 ? String.Empty : (":" + domainPort.Value))}/"; }
public bool IsCurrentUserInAdminRole() { ISecurityServices _security = ObjectFactory.GetInstance <ISecurityServices>(); bool isAdmin = false; using (var uow = ObjectFactory.GetInstance <IUnitOfWork>()) { //get the current account var curAccount = _security.GetCurrentAccount(uow); //get the roles to check if the account has admin role var curAccountRoles = curAccount.Roles; //get the role id var adminRoleId = uow.AspNetRolesRepository.GetQuery().Single(r => r.Name == Roles.Admin).Id; //provide all facts if the user has admin role if (curAccountRoles.Any(x => x.RoleId == adminRoleId)) { isAdmin = true; } } return(isAdmin); }
public ContainersController() { _containerService = ObjectFactory.GetInstance <IContainerService>(); _security = ObjectFactory.GetInstance <ISecurityServices>(); }
public AuthorizeActivityInterceptor(ISecurityServices securityServices) { _securityServices = securityServices; }
public IncidentReporter(EventReporter eventReporter, ITerminal terminal, ISecurityServices securityService) { _eventReporter = eventReporter; _terminal = terminal; _sercurity = securityService; }
public Report() { _security = ObjectFactory.GetInstance <ISecurityServices>(); }
public PlanSecurityDecorator(IPlan target, ISecurityServices securityServices) { _securityServices = securityServices; _target = target; }
public NotificationsController(IPusherNotifier pusherNotifier, ISecurityServices security) : base(security) { _pusherNotifier = pusherNotifier; }
public TerminalServiceForTests(IConfigRepository configRepository, ISecurityServices securityServices) { _terminal = new Terminal(configRepository, securityServices); }
public Fr8BaseApiController(ISecurityServices security) { _security = security; }
public EventReporter(IActivityTemplate activityTemplate, ITerminal terminal) { _activityTemplate = activityTemplate; _terminal = terminal; _security = ObjectFactory.GetInstance <ISecurityServices>(); }
public Fact(ISecurityServices security) { _securityServices = security; }
public Subplan() { _activity = ObjectFactory.GetInstance <IActivity>(); _security = ObjectFactory.GetInstance <ISecurityServices>(); }
public SecurityController(ISecurityServices securityServices, IAppServices appServices) { _securityServices = securityServices; _appServices = appServices; }
public SecurityController(ISecurityServices service) => this.service = service;
public UserManagerController(ISecurityServices securityServices, IUserServices userServices) { _securityServices = securityServices; _userServices = userServices; }
public PageDefinitionsController() { _pageDefinition = ObjectFactory.GetInstance <IPageDefinition>(); _securityServices = ObjectFactory.GetInstance <ISecurityServices>(); _webServicesPageGenerator = ObjectFactory.GetInstance <IWebservicesPageGenerator>(); }
public FilesController(IFile fileService) { _fileService = fileService; _security = ObjectFactory.GetInstance <ISecurityServices>(); _tagService = ObjectFactory.GetInstance <ITag>(); }
public ReportsController(IReport report, ISecurityServices securityService, IUnitOfWorkFactory uowFactory) { _report = report; _securityService = securityService; _uowFactory = uowFactory; }