Exemple #1
0
 public Label(IDateProvider dateProvider,
              IIdentityProvider identitiyProvider,
              IStorageProvider storageProvider)
 {
     DateProvider     = dateProvider;
     IdentityProvider = identitiyProvider;
     StorageProvider  = storageProvider;
 }
        public BasicAuthenticationProvider(IIdentityProvider identityProvider)
        {
            if (identityProvider == null)
            {
                throw new ArgumentNullException("identityProvider");
            }

            _identityProvider = identityProvider;
        }
Exemple #3
0
 public Card(IDateProvider dateProvider, 
             IStorageProvider storageProvider, 
             IIdentityProvider identityProvider,
             IConfigurationProvider configurationProvider)
 {
     DateProvider          = dateProvider;
     StorageProvider       = storageProvider;
     IdentityProvider      = identityProvider;
     ConfigurationProvider = configurationProvider;
 }
		/// <summary>
		/// Constructor.
		/// </summary>
		public BaseControllerArgs(
			ILogContext logContext,
			IIdentityProvider identityProvider,
			IUserProvider userProvider,
			ITimeZoneProvider timeZoneProvider)
		{
			LogContext = logContext;
			IdentityProvider = identityProvider;
			UserProvider = userProvider;
			TimeZoneProvider = timeZoneProvider;
		}
Exemple #5
0
 public User(
     ID<IUserOrGroup, Guid> id,
     string name,
     bool builtIn,
     bool local,
     FileHandlerFactoryLocator fileHandlerFactoryLocator,
     string displayName,
     IIdentityProvider identityProvider)
     : base(id, name, builtIn, fileHandlerFactoryLocator, displayName)
 {
     _Local = local;
     _IdentityProvider = identityProvider;
 }
        public void SetUp()
        {
            _uncompressedId = "\\\\some\\smb\\path";
	        _compressedId = new ConvertPathsToSha1().IdentifierFor(_uncompressedId);

            var backing = new Dictionary<string, SonosIdentifier>
            {
                {_uncompressedId, new SonosIdentifier {Id = _compressedId, Path = "\\\\some\\smb\\path"}}
            };

	        _config = new ServerConfiguration {MusicShare = "\\\\a\\\\b"};
            _provider = new IdentityProvider(_config, backing);
        }
		/// <summary>
		/// Constructor.
		/// </summary>
		public UserController(
			BaseControllerArgs args,
			IIdentityProvider identityProvider,
			IUserService userService, 
			IClassroomService classroomService, 
			ISectionService sectionService,
			WebAppHost webAppHost) 
				: base(args)
		{
			_userService = userService;
			_identityProvider = identityProvider;
			_classroomService = classroomService;
			_sectionService = sectionService;
			_webAppHost = webAppHost;
		}
		/// <summary>
		/// Constructor.
		/// </summary>
		public UserService(
			DatabaseContext dbContext,
			IIdentityProvider identityProvider,
			IGitHubUserClient gitHubUserClient, 
			IGitHubOrganizationClient gitHubOrgClient,
			IGitHubTeamClient gitHubTeamClient,
			IEmailProvider emailProvider,
			ActivationToken activationToken)
		{
			_dbContext = dbContext;
			_identityProvider = identityProvider;
			_gitHubUserClient = gitHubUserClient;
			_gitHubOrgClient = gitHubOrgClient;
			_gitHubTeamClient = gitHubTeamClient;
			_emailProvider = emailProvider;
			_activationToken = activationToken;
		}
        internal XDAmazonListener(IIdentityProvider identityProvider, ISerializer serializer,
                                  ITopicRepository topicRepository,
                                  ISubscriberRepository subscriberRepository, ISubscriptionService subscriptionService)
        {
            Validate.That(identityProvider).IsNotNull();
            Validate.That(serializer).IsNotNull();
            Validate.That(topicRepository).IsNotNull();
            Validate.That(subscriberRepository).IsNotNull();
            Validate.That(subscriptionService).IsNotNull();

            useLongLiveQueues = (identityProvider.Scope == IdentityScope.Machine);
            uniqueInstanceId = identityProvider.GetUniqueId();
            this.serializer = serializer;
            this.topicRepository = topicRepository;
            this.subscriberRepository = subscriberRepository;
            this.subscriptionService = subscriptionService;
        }
        internal XDAmazonListener(IIdentityProvider identityProvider, ISerializer serializer,
            ITopicRepository topicRepository,
            ISubscriberRepository subscriberRepository, ISubscriptionService subscriptionService)
        {
            identityProvider.Requires("identityProvider").IsNotNull();
            serializer.Requires("serializer").IsNotNull();
            topicRepository.Requires("topicRepository").IsNotNull();
            subscriberRepository.Requires("subscriberRepository").IsNotNull();
            subscriptionService.Requires("subscriptionService").IsNotNull();

            useLongLiveQueues = identityProvider.Scope == IdentityScope.Machine;
            uniqueInstanceId = identityProvider.GetUniqueId();
            this.serializer = serializer;
            this.topicRepository = topicRepository;
            this.subscriberRepository = subscriberRepository;
            this.subscriptionService = subscriptionService;
        }
        private IXDListener CreateNetworkListener(IIdentityProvider provider)
        {
            var settings = AmazonAccountSettings.GetInstance();
            var amazonSnsFacade = new AmazonSnsFacade(settings);
            var amazonSqsFacade = new AmazonSqsFacade(settings);
            var queuePoller = new QueuePoller(amazonSqsFacade);

            var resourceCounter = new ResourceCounter();
            var respository = new TopicRepository(AmazonAccountSettings.GetInstance(), amazonSnsFacade);
            var subscriberRepository = new SubscriberRepository(settings, amazonSqsFacade);
            var subscriptionService = new SubscriptionService(
                resourceCounter,
                amazonSnsFacade,
                amazonSqsFacade,
                subscriberRepository,
                queuePoller);

            return new XDAmazonListener(provider, serializer, respository, subscriberRepository, subscriptionService);
        }
Exemple #12
0
		public SocialServer (IWatchListProvider provider, IIdentityProvider identityProvider)
			: base (MessageTypes.Reliable)
		{
			if (provider == null)
				throw new ArgumentNullException ("provider");
			if (identityProvider == null)
				throw new ArgumentNullException ("identityProvider");

			this.provider = provider;
			this.identityProvider = identityProvider;

			this.groups.GroupUpdated += OnGroupUpdated;

			this.RegisterMessageHandler<PersonMessage> (OnPersonMessage);
			this.RegisterMessageHandler<BuddyListMessage> (OnBuddyListMessage);
			this.RegisterMessageHandler<SearchMessage> (OnSearchMessage);
			this.RegisterMessageHandler<InviteToGroupMessage> (OnInviteToGroupMessage);
			this.RegisterMessageHandler<TextMessage> (OnTextMessage);
			this.RegisterMessageHandler<CreateGroupMessage> (OnCreateGroupMessage);
		}
 public CommentsController()
 {
     this.comments = new CommentsService(new GenericRepository<Comment>(new RealEstateSystemDbContext()));
     this.identityProvider = new AspNetIdentityProvider();
 }
 public TestCloudDnsProvider(CloudIdentity defaultIdentity, string defaultRegion, bool internalUrl, IIdentityProvider identityProvider)
     : base(defaultIdentity, defaultRegion, internalUrl, identityProvider)
 {
 }
Exemple #15
0
        /// <summary>
        /// Initializes a new instance of the LogoutResponse class based on
        /// the complimentary logout request.
        /// </summary>
        /// <param name="identityProvider">
        /// IdentityProvider of the LogoutResponse
        /// </param>
        /// <param name="serviceProvider">
        /// ServiceProvider of the LogoutResponse
        /// </param>
        /// <param name="logoutRequest">
        /// Logout request that requires this response
        /// </param>
        /// <param name="parameters">
        /// NameValueCollection of varying parameters for use in the 
        /// construction of the LogoutResponse.
        /// </param>
        /// <param name="saml2Utils">Utilities class</param>
        public LogoutResponse(
			IIdentityProvider identityProvider,
			IServiceProvider serviceProvider,
			LogoutRequest logoutRequest,
			NameValueCollection parameters,
            Saml2Utils saml2Utils)
        {
            if (identityProvider == null)
            {
                throw new Saml2Exception(Resources.LogoutResponseIdentityProviderIsNull);
            }
            else if (serviceProvider == null)
            {
                throw new Saml2Exception(Resources.LogoutResponseServiceProviderIsNull);
            }
            else if (logoutRequest == null)
            {
                throw new Saml2Exception(Resources.LogoutResponseLogoutRequestIsNull);
            }

            if (parameters == null)
            {
                parameters = new NameValueCollection();
            }

            string inResponseToValue = logoutRequest.Id;
            string issuerValue = serviceProvider.EntityId;

            string binding = parameters[Saml2Constants.Binding];
            if (string.IsNullOrEmpty(binding))
            {
                binding = Saml2Constants.HttpPostProtocolBinding;
            }

            string idpSvcResponseLocation = null;
            if (binding != Saml2Constants.HttpSoapProtocolBinding)
            {
                idpSvcResponseLocation = identityProvider.GetSingleLogoutServiceResponseLocation(binding);
            }

            xml = new XmlDocument();
            xml.PreserveWhitespace = true;

            nsMgr = new XmlNamespaceManager(xml.NameTable);
            nsMgr.AddNamespace("samlp", "urn:oasis:names:tc:SAML:2.0:protocol");
            nsMgr.AddNamespace("saml", "urn:oasis:names:tc:SAML:2.0:assertion");

            var rawXml = new StringBuilder();
            rawXml.Append("<samlp:LogoutResponse xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" ");
            rawXml.Append(" ID=\"" + saml2Utils.GenerateId() + "\" Version=\"2.0\" ");
            rawXml.Append(" IssueInstant=\"" + saml2Utils.GenerateIssueInstant() + "\" ");

            if (idpSvcResponseLocation != null)
            {
                rawXml.Append(" Destination=\"" + idpSvcResponseLocation + "\" ");
            }

            rawXml.Append(" InResponseTo=\"" + inResponseToValue + "\">");
            rawXml.Append(" <saml:Issuer xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\">" + issuerValue + "</saml:Issuer>");
            rawXml.Append(" <samlp:Status xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\">");
            rawXml.Append("   <samlp:StatusCode ");
            rawXml.Append("     xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" ");
            rawXml.Append("     Value=\"" + Saml2Constants.Success + "\">");
            rawXml.Append("   </samlp:StatusCode>");
            rawXml.Append(" </samlp:Status>");
            rawXml.Append("</samlp:LogoutResponse>");

            xml.LoadXml(rawXml.ToString());
        }
Exemple #16
0
 public MessageClient(IServiceHubProvider serviceHub, string targetService, IIdentityProvider identityProvider, bool useEvents) : this(serviceHub, targetService, useEvents)
 {
     this.identityProvider = identityProvider;
 }
 public GarmentCreditAdviceMonitoringService(IServiceProvider serviceProvider)
 {
     carepository      = serviceProvider.GetService <IGarmentShippingCreditAdviceRepository>();
     _identityProvider = serviceProvider.GetService <IIdentityProvider>();
 }
Exemple #18
0
 public UsersViewModel(IIdentityProvider identityProvider)
 {
     _identityProvider = identityProvider;
 }
Exemple #19
0
        private void SignUp(HttpContext context, CancellationToken cancel)
        {
            string url = this.ActivateUrl;

            if (!string.IsNullOrEmpty(url))
            {
                IQueryCollection qry = context.Request.Query;
                string           ty  = qry[type];
                if (knownType.Equals(ty))
                {
                    string u = qry[user];
                    if (!string.IsNullOrEmpty(u))
                    {
                        string p = qry[pass];
                        if (!string.IsNullOrEmpty(p))
                        {
                            if (ValidUserEmail(u))
                            {
                                IIdentityProvider idProv = IdentityManager.Instance.GetProvider(ctx);
                                if (!idProv.Exists(u))
                                {
                                    IAuthenticationProvider authProv = AuthenticationManager.Instance.GetProvider(ctx);
                                    UserIdentityBase        user     = idProv.CreateUser(u);
                                    user.UserState = UserState.Pending;
                                    idProv.Update(user);
                                    UserPasswordCredential cred = new UserPasswordCredential(u, p);
                                    if (authProv.AddCredential(user, cred))
                                    {
                                        Guid token = Authenticator.Instance.Reset(u, false); //create a reset token
                                        //notice we create a url with the token at the end, this COULD map to the REST api directly - but is expected instead not to
                                        //we instead expect this to be a simple page that makes the rest request and "looks pretty" to confirm and perhaps send the user then back to the signin page.
                                        if (url.EndsWith("?"))
                                        {
                                            url = url + token.ToString();
                                        }
                                        else
                                        {
                                            url = url + "?" + token.ToString();
                                        }

                                        if (SendEmail(u, url, false))
                                        {
                                            RestUtils.Push(context.Response, JsonOpStatus.Ok);
                                            return;
                                        }
                                        else
                                        {
                                            idProv.Delete(user.Uid);
                                            authProv.DeleteCredential(user, cred);
                                            RestUtils.Push(context.Response, JsonOpStatus.Failed, "\"Couldn't send email\"");
                                            return;
                                        }
                                    }
                                    else
                                    {
                                        idProv.Delete(user.Uid);
                                        authProv.DeleteCredential(user, cred);
                                        RestUtils.Push(context.Response, JsonOpStatus.Failed, "\"Couldn't set credential\"");
                                        return;
                                    }
                                }
                                else
                                {
                                    RestUtils.Push(context.Response, JsonOpStatus.Failed, "\"UserExists\"");
                                    return;
                                }
                            }
                            else
                            {
                                RestUtils.Push(context.Response, JsonOpStatus.Failed, "\"InvalidEmail\"");
                                return;
                            }
                        }
                    }
                }
            }
            RestUtils.Push(context.Response, JsonOpStatus.Failed);
        }
Exemple #20
0
        /// <summary>
        /// Initializes a new instance of the AuthnRequest class.
        /// </summary>
        /// <param name="identityProvider">
        /// IdentityProvider to receive the AuthnRequest
        /// </param>
        /// <param name="serviceProvider">
        /// ServiceProvider to issue the AuthnRequest
        /// </param>
        /// <param name="parameters">
        /// NameValueCollection of varying parameters for use in the
        /// construction of the AuthnRequest.
        /// </param>
        /// <param name="saml2Utils">Utilities class</param>
        public AuthnRequest(IIdentityProvider identityProvider, IServiceProvider serviceProvider, NameValueCollection parameters, Saml2Utils saml2Utils)
        {
            _xml = new XmlDocument();
            _xml.PreserveWhitespace = true;

            nsMgr = new XmlNamespaceManager(_xml.NameTable);
            nsMgr.AddNamespace("saml", "urn:oasis:names:tc:SAML:2.0:assertion");
            nsMgr.AddNamespace("samlp", "urn:oasis:names:tc:SAML:2.0:protocol");

            Id           = saml2Utils.GenerateId();
            IssueInstant = saml2Utils.GenerateIssueInstant();
            Issuer       = serviceProvider.EntityId;

            if (parameters != null)
            {
                AllowCreate = Saml2Utils.GetBoolean(parameters[Saml2Constants.AllowCreate]);
                AssertionConsumerServiceIndex = parameters[Saml2Constants.AssertionConsumerServiceIndex];
                Binding            = parameters[Saml2Constants.Binding];
                Consent            = parameters[Saml2Constants.Consent];
                Destination        = parameters[Saml2Constants.Destination];
                ForceAuthn         = Saml2Utils.GetBoolean(parameters[Saml2Constants.ForceAuthn]);
                IsPassive          = Saml2Utils.GetBoolean(parameters[Saml2Constants.IsPassive]);
                NameIDPolicyFormat = parameters[Saml2Constants.NameIDPolicyFormat];
            }

            if (string.IsNullOrEmpty(NameIDPolicyFormat))
            {
                NameIDPolicyFormat = Saml2Constants.NameIDPolicyFormatUnspecified;
            }

            string assertionConsumerSvcUrl = null;

            if (!String.IsNullOrEmpty(Binding))
            {
                if (!String.IsNullOrEmpty(AssertionConsumerServiceIndex))
                {
                    // find assertion consumer service location by binding and index.
                    assertionConsumerSvcUrl = serviceProvider.GetAssertionConsumerServiceLocation(Binding,
                                                                                                  AssertionConsumerServiceIndex);
                }
                else
                {
                    // find assertion consumer service location by binding only, using first found.
                    assertionConsumerSvcUrl = serviceProvider.GetAssertionConsumerServiceLocation(Binding);
                }
            }

            // neither index nor binding, throw exception
            if (String.IsNullOrEmpty(AssertionConsumerServiceIndex) && String.IsNullOrEmpty(assertionConsumerSvcUrl))
            {
                throw new Saml2Exception(Resources.AuthnRequestAssertionConsumerServiceNotDefined);
            }

            // If destination not specified, use SSO location by binding
            if (string.IsNullOrEmpty(Destination))
            {
                Destination
                    = identityProvider.GetSingleSignOnServiceLocation(parameters[Saml2Constants.RequestBinding]);

                if (string.IsNullOrEmpty(Destination))
                {
                    // default to HttpRedirect
                    Destination = identityProvider.GetSingleSignOnServiceLocation(Saml2Constants.HttpRedirectProtocolBinding);
                }
            }

            // Get RequestedAuthnContext if parameters are available...
            RequestedAuthnContext reqAuthnContext = GetRequestedAuthnContext(serviceProvider, parameters);

            // Generate the XML for the AuthnRequest...
            var rawXml = new StringBuilder();

            rawXml.Append("<samlp:AuthnRequest ");
            rawXml.Append(" xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\"");
            rawXml.Append(" ID=\"" + Id + "\"");
            rawXml.Append(" Version=\"2.0\"");
            rawXml.Append(" IssueInstant=\"" + IssueInstant + "\"");
            rawXml.Append(" IsPassive=\"" + IsPassive.ToString().ToLower() + "\"");
            rawXml.Append(" ForceAuthn=\"" + ForceAuthn.ToString().ToLower() + "\"");

            if (!String.IsNullOrEmpty(Consent))
            {
                rawXml.Append(" Consent=\"" + Consent + "\"");
            }

            if (!String.IsNullOrEmpty(Destination))
            {
                rawXml.Append(" Destination=\"" + Destination + "\"");
            }

            if (!String.IsNullOrEmpty(assertionConsumerSvcUrl))
            {
                rawXml.Append(" ProtocolBinding=\"" + Binding + "\"");
                rawXml.Append(" AssertionConsumerServiceURL=\"" + assertionConsumerSvcUrl + "\"");
            }
            else
            {
                rawXml.Append(" AssertionConsumerServiceIndex=\"" + AssertionConsumerServiceIndex + "\"");
            }

            rawXml.Append(">");
            rawXml.Append("<saml:Issuer xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\">" + serviceProvider.EntityId +
                          "</saml:Issuer>");

            rawXml.Append("<samlp:NameIDPolicy Format=\"" + NameIDPolicyFormat + "\" AllowCreate=\"" + AllowCreate.ToString().ToLower() + "\" />");

            if (reqAuthnContext != null)
            {
                rawXml.Append(reqAuthnContext.GenerateXmlString());
            }

            rawXml.Append("</samlp:AuthnRequest>");

            _xml.LoadXml(rawXml.ToString());
        }
Exemple #21
0
        /// <summary>
        /// Initializes a new instance of the LogoutRequest class.
        /// </summary>
        /// <param name="identityProvider">
        /// IdentityProvider of the LogoutRequest
        /// </param>
        /// <param name="serviceProvider">
        /// ServiceProvider of the LogoutRequest
        /// </param>
        /// <param name="parameters">
        /// NameValueCollection of varying parameters for use in the
        /// construction of the LogoutRequest.
        /// </param>
        /// <param name="saml2Utils">Utilities Class</param>
        public LogoutRequest(
            IIdentityProvider identityProvider,
            IServiceProvider serviceProvider,
            NameValueCollection parameters,
            Saml2Utils saml2Utils)
        {
            try
            {
                xml = new XmlDocument();
                xml.PreserveWhitespace = true;

                nsMgr = new XmlNamespaceManager(xml.NameTable);
                nsMgr.AddNamespace("ds", "http://www.w3.org/2000/09/xmldsig#");
                nsMgr.AddNamespace("saml", "urn:oasis:names:tc:SAML:2.0:assertion");
                nsMgr.AddNamespace("samlp", "urn:oasis:names:tc:SAML:2.0:protocol");

                string sessionIndex  = null;
                string subjectNameId = null;
                string binding       = null;
                string destination   = null;

                if (parameters != null)
                {
                    sessionIndex  = parameters[Saml2Constants.SessionIndex];
                    subjectNameId = parameters[Saml2Constants.SubjectNameId];
                    binding       = parameters[Saml2Constants.Binding];
                    destination   = parameters[Saml2Constants.Destination];
                }

                if (String.IsNullOrEmpty(sessionIndex))
                {
                    throw new Saml2Exception(Resources.LogoutRequestSessionIndexNotDefined);
                }
                if (String.IsNullOrEmpty(subjectNameId))
                {
                    throw new Saml2Exception(Resources.LogoutRequestSubjectNameIdNotDefined);
                }
                if (serviceProvider == null)
                {
                    throw new Saml2Exception(Resources.LogoutRequestServiceProviderIsNull);
                }
                if (identityProvider == null)
                {
                    throw new Saml2Exception(Resources.LogoutRequestIdentityProviderIsNull);
                }

                if (string.IsNullOrEmpty(destination))
                {
                    destination = identityProvider.GetSingleLogoutServiceLocation(binding);

                    if (string.IsNullOrEmpty(destination))
                    {
                        // default with HttpRedirect
                        destination = identityProvider.GetSingleLogoutServiceLocation(Saml2Constants.HttpRedirectProtocolBinding);
                    }
                }

                var rawXml = new StringBuilder();
                rawXml.Append("<samlp:LogoutRequest xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\"");
                rawXml.Append(" ID=\"" + saml2Utils.GenerateId() + "\"");
                rawXml.Append(" Version=\"2.0\"");
                rawXml.Append(" IssueInstant=\"" + saml2Utils.GenerateIssueInstant() + "\"");

                if (!String.IsNullOrEmpty(destination))
                {
                    rawXml.Append(" Destination=\"" + destination + "\"");
                }

                rawXml.Append(" >");
                rawXml.Append(" <saml:Issuer xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\">" + serviceProvider.EntityId +
                              "</saml:Issuer>");
                rawXml.Append(" <saml:NameID xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\"");
                //rawXml.Append("  Format=\"urn:oasis:names:tc:SAML:2.0:nameid-format:transient\"");
                //rawXml.Append("  NameQualifier=\"" + identityProvider.EntityId + "\">" + subjectNameId + "</saml:NameID> ");
                rawXml.Append("  >" + subjectNameId + "</saml:NameID> ");
                rawXml.Append(" <samlp:SessionIndex xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\">" + sessionIndex +
                              "</samlp:SessionIndex>");
                rawXml.Append("</samlp:LogoutRequest>");

                xml.LoadXml(rawXml.ToString());
            }
            catch (ArgumentNullException ane)
            {
                throw new Saml2Exception(Resources.LogoutRequestNullArgument, ane);
            }
            catch (XmlException xe)
            {
                throw new Saml2Exception(Resources.LogoutRequestXmlException, xe);
            }
        }
 public RestaurantsController(IRepository repo, IApplicationLog logger, IIdentityProvider identity)
     : base(repo, logger, identity)
 {
 }
Exemple #23
0
 public DyeingPrintingAreaMovementRepository(PackingInventoryDbContext dbContext, IServiceProvider serviceProvider)
 {
     _dbContext        = dbContext;
     _dbSet            = dbContext.Set <DyeingPrintingAreaMovementModel>();
     _identityProvider = serviceProvider.GetService <IIdentityProvider>();
 }
 public CriteriaRepository(PackingInventoryDbContext dbContext, IServiceProvider serviceProvider)
 {
     _dbContext        = dbContext;
     _criteriaDbSet    = dbContext.Set <CriteriaModel>();
     _identityProvider = serviceProvider.GetService <IIdentityProvider>();
 }
Exemple #25
0
 public GarmentCoverLetterMonitoringService(IServiceProvider serviceProvider)
 {
     clrepository      = serviceProvider.GetService <IGarmentCoverLetterRepository>();
     _identityProvider = serviceProvider.GetService <IIdentityProvider>();
 }
Exemple #26
0
 public GarmenOmzetMonthlyByBuyerController(IGarmentOmzetMonthlyByBuyerService service, IIdentityProvider identityProvider)
 {
     _service          = service;
     _identityProvider = identityProvider;
 }
Exemple #27
0
 public StockOpnameWarehouseController(IStockOpnameWarehouseService service, IIdentityProvider identityProvider, IValidateService validateService)
 {
     _service          = service;
     _identityProvider = identityProvider;
     ValidateService   = validateService;
 }
Exemple #28
0
 public SecurityStampValidator(IDbContextScopeFactory dbContextScopeFactory, IUserRepository userRepository, IClaimsIdentityFactory claimsIdentityFactory, IIdentityProvider identityProvider)
 {
     this.dbContextScopeFactory = dbContextScopeFactory;
     this.userRepository        = userRepository;
     this.claimsIdentityFactory = claimsIdentityFactory;
     this.identityProvider      = identityProvider;
 }
Exemple #29
0
 public GarmentAmendLetterOfCreditRepository(PackingInventoryDbContext dbContext, IServiceProvider serviceProvider)
 {
     _dbContext        = dbContext;
     _dbSet            = dbContext.Set <GarmentShippingAmendLetterOfCreditModel>();
     _identityProvider = serviceProvider.GetService <IIdentityProvider>();
 }
 public GarmentShippingPaymentDispositionRecapRepository(PackingInventoryDbContext dbContext, IServiceProvider serviceProvider)
 {
     _dbContext        = dbContext;
     _dbSet            = dbContext.Set <GarmentShippingPaymentDispositionRecapModel>();
     _identityProvider = serviceProvider.GetService <IIdentityProvider>();
 }
Exemple #31
0
 public HomeModule(ICommandDispatcher commandDispatcher,
                   IIdentityProvider identityProvider)
     : base(commandDispatcher, identityProvider)
 {
     Get("", args => $"Warden API is running on: {Context.Request.Url}");
 }
Exemple #32
0
        protected GarmentAmendLetterOfCreditController GetController(IGarmentAmendLetterOfCreditService service, IIdentityProvider identityProvider, IValidateService validateService)
        {
            var claimPrincipal = new Mock <ClaimsPrincipal>();
            var claims         = new Claim[]
            {
                new Claim("username", "unittestusername")
            };

            claimPrincipal.Setup(claim => claim.Claims).Returns(claims);

            var controller = new GarmentAmendLetterOfCreditController(service, identityProvider, validateService)
            {
                ControllerContext = new ControllerContext()
                {
                    HttpContext = new DefaultHttpContext()
                    {
                        User = claimPrincipal.Object
                    }
                }
            };

            controller.ControllerContext.HttpContext.Request.Headers["Authorization"]     = "Bearer unittesttoken";
            controller.ControllerContext.HttpContext.Request.Headers["x-timezone-offset"] = $"{It.IsAny<int>()}";
            controller.ControllerContext.HttpContext.Request.Path = new PathString("/v1/unit-test");

            return(controller);
        }
Exemple #33
0
 public RegisterViewModel(IIdentityProvider identityProvider)
     : base(identityProvider)
 {
 }
Exemple #34
0
 public GarmentCoverLetterRepository(PackingInventoryDbContext dbContext, IServiceProvider serviceProvider)
 {
     _dbContext        = dbContext;
     _dbSet            = dbContext.Set <GarmentShippingCoverLetterModel>();
     _identityProvider = serviceProvider.GetService <IIdentityProvider>();
 }
Exemple #35
0
 public User(IIdentityProvider <TKey> identityProvider, IPermissionManager permissionManager)
 {
     _identityProvider  = identityProvider;
     _permissionManager = permissionManager;
 }
 public GarmentCreditNoteMonitoringService(IServiceProvider serviceProvider)
 {
     repository        = serviceProvider.GetService <IGarmentShippingNoteRepository>();
     itemrepository    = serviceProvider.GetService <IGarmentShippingNoteItemRepository>();
     _identityProvider = serviceProvider.GetService <IIdentityProvider>();
 }
		public GablarskiSocialServer (IWatchListProvider provider, IIdentityProvider identityProvider)
			: base (provider, identityProvider)
		{
			this.RegisterMessageHandler<JoinVoiceMessage> (OnJoinVoiceMessage);
		}
Exemple #38
0
 public GarmenLocalSalesOmzetController(IGarmentLocalSalesOmzetService service, IIdentityProvider identityProvider)
 {
     _service          = service;
     _identityProvider = identityProvider;
 }
 public UsersController(IUsersService users, IIdentityProvider identityProvider)
 {
     this.users = users;
     this.identityProvider = identityProvider;
 }
		/// <summary>
		/// Constructor.
		/// </summary>
		public BaseController(BaseControllerArgs args)
		{
			LogContext = args.LogContext;
			TimeZoneProvider = args.TimeZoneProvider;
			_identityProvider = args.IdentityProvider;
			_userProvider = args.UserProvider;
		}
 public GarmentShippingInsuranceDispositionController(IGarmentShippingInsuranceDispositionService service, IIdentityProvider identityProvider, IValidateService validateService)
 {
     _service          = service;
     _identityProvider = identityProvider;
     _validateService  = validateService;
 }
 public ObjectStoreProvider(IIdentityProvider identityProvider, IRestService restService, IObjectStoreValidator objectStoreValidator)
     : this(null, identityProvider, restService, objectStoreValidator) { }
 public CommentsController(ICommentsService comments, IIdentityProvider identityProvider)
 {
     this.comments = comments;
     this.identityProvider = identityProvider;
 }
 public ObjectStoreProvider(IIdentityProvider identityProvider, IRestService restService, IObjectStoreValidator objectStoreValidator)
     : base(identityProvider, restService)
 {
     _objectStoreValidator = objectStoreValidator;
 }
Exemple #45
0
 /// <summary>
 /// Helper to allow built-in users to be declared in Spring
 /// </summary>
 /// <param name="id">
 /// A <see cref="System.String"/>
 /// </param>
 /// <param name="name">
 /// A <see cref="System.String"/>
 /// </param>
 /// <returns>
 /// A <see cref="User"/>
 /// </returns>
 public static User SpringContructor(string id, string name, FileHandlerFactoryLocator fileHandlerFactoryLocator, IIdentityProvider identityProvider)
 {
     return new User(new ID<IUserOrGroup, Guid>(new Guid(id)), name, true, true, fileHandlerFactoryLocator, name, identityProvider);
 }
 public static ParkingSession Start(IIdentityProvider identityProvider, Entrance entrance, Vehicle vehicle, Valet valet, ParkingPlace parkingPlace)
 {
     var id = identityProvider.GetId();
     return new ParkingSession(id, entrance, vehicle, valet, parkingPlace, new ParkingPeriod(DateTime.Now, null));
 }
Exemple #47
0
 public GarmentPackingListDetailRepository(PackingInventoryDbContext dbContext, IServiceProvider serviceProvider)
 {
     _dbContext        = dbContext;
     _dbSet            = dbContext.Set <GarmentPackingListDetailModel>();
     _identityProvider = serviceProvider.GetService <IIdentityProvider>();
 }
Exemple #48
0
 protected MessageClient(IHubConnectionFactory connector, string targetService, IIdentityProvider identityProvider, bool useEvents)
 {
     this.connector        = connector;
     this.targetService    = targetService;
     isBidirectional       = useEvents;
     this.useEvents        = useEvents;
     this.identityProvider = identityProvider;
     ReConnectClient();
 }
Exemple #49
0
 public CardActivity(IStorageProvider storageProvider, IIdentityProvider identityProvider)
 {
     StorageProvider = storageProvider;
     IdentityProvider = identityProvider;
 }
 public ComputeProvider(IIdentityProvider identityProvider = null, IRestService restService = null)
 {
     _factory = new ComputeProviderFactory(identityProvider, restService);
 }
 public ObjectStoreProvider(CloudIdentity defaultIdentity, IIdentityProvider identityProvider, IRestService restService, IObjectStoreValidator objectStoreValidator)
     : base(defaultIdentity, identityProvider, restService)
 {
     _objectStoreValidator = objectStoreValidator;
 }
        public IUser CreateUser(
			string name,
            string password,
            string displayName,
            ID<IUserOrGroup, Guid> userId,
            bool builtIn,
            string identityProviderArgs,
            IIdentityProvider identityProvider)
        {
            name = name.ToLowerInvariant();

            if (null != MaxLocalUsers)
                if (this.GetTotalLocalUsers() >= MaxLocalUsers.Value)
                    throw new MaximumUsersExceeded("The maximum number of users allowed on this server is met: " + MaxLocalUsers.Value.ToString());

            IDirectoryHandler usersDirectory = FileHandlerFactoryLocator.FileSystemResolver.ResolveFile("Users").CastFileHandler<IDirectoryHandler>();

            IUserHandler newUser;
            IUser userObj = null;

            this.persistedUserManagerData.WriteReentrant(userManagerData =>
            {
                this.ThrowExceptionIfDuplicate(userManagerData, name);

                if (identityProvider == FileHandlerFactoryLocator.LocalIdentityProvider)
                {
                    if (usersDirectory.IsFilePresent(name))
                        throw new UserAlreadyExistsException("There is a pre-existing directory for " + name);

                    if (usersDirectory.IsFilePresent(name + " .user"))
                        throw new UserAlreadyExistsException("There is a pre-existing " + name + ".user");
                }

                var user = new UserInt()
                {
                    name = name,
                    id = userId,
                    builtIn = builtIn,
                    displayName = displayName,
                    identityProviderCode = identityProvider.IdentityProviderCode,
                    identityProviderArgs = identityProviderArgs
                };

                if (null != password)
                    this.SetPassword(user, password);
                else
                {
                    user.passwordMD5 = null;
                    user.salt = null;
                }

                userManagerData.users[userId] = user;
                userManagerData.byName[name] = user;
                userObj = this.CreateUserObject(user);

                if (identityProvider == FileHandlerFactoryLocator.LocalIdentityProvider)
                {
                    try
                    {
                        // Careful here!!!  When calling the constructor of the user's .user object or the user's directory, a transaction will
                        // be created against the user database!  That can cause a deadlock!
                        usersDirectory.CreateFile(name, "directory", userObj.Id);

                        string userFileName = name + ".user";
                        newUser = usersDirectory.CreateSystemFile<IUserHandler>(userFileName, "user", userObj.Id);
                        newUser.Name = name;
                        usersDirectory.SetPermission(
                            null,
                            userFileName,
                            new ID<IUserOrGroup, Guid>[] { FileHandlerFactoryLocator.UserFactory.Everybody.Id },
                            FilePermissionEnum.Read,
                            false,
                            false);
                    }
                    catch
                    {
                        if (null != usersDirectory)
                        {
                            if (usersDirectory.IsFilePresent(name))
                                try
                                {
                                    usersDirectory.DeleteFile(null, name);
                                }
                                catch { }

                            if (usersDirectory.IsFilePresent(name + ".user"))
                                try
                                {
                                    usersDirectory.DeleteFile(null, name + ".user");
                                }
                                catch { }
                        }

                        throw;
                    }

                    if (!builtIn)
                        this.CreateGroupInt(
                            userManagerData,
                            "friends",
                            displayName + "'s friends",
                            userObj.Id,
                            new ID<IUserOrGroup, Guid>(Guid.NewGuid()),
                            false,
                            false,
                            GroupType.Personal);
                }
            });

            return userObj;
        }
 public ObjectStoreProvider(IIdentityProvider identityProvider, IRestService restService)
     : base(identityProvider, restService) { }
Exemple #54
0
 public HomeIndexViewModel(IIdentityProvider identityProvider)
     : base(identityProvider)
 {
 }
 public GarmentDebiturBalanceRepository(PackingInventoryDbContext dbContext, IServiceProvider serviceProvider)
 {
     _dbContext        = dbContext;
     _dbSet            = dbContext.Set <GarmentDebiturBalanceModel>();
     _identityProvider = serviceProvider.GetService <IIdentityProvider>();
 }
 public DirectMethodHandler(IConnectionRegistry connectionRegistry, IIdentityProvider identityProvider)
 {
     this.connectionRegistry = Preconditions.CheckNotNull(connectionRegistry);
     this.identityProvider   = Preconditions.CheckNotNull(identityProvider);
 }
 public IUser CreateUser(string name, string displayName, string identityProviderArgs, IIdentityProvider identityProvider)
 {
     return CreateUser(
         name,
         null,
         displayName,
         new ID<IUserOrGroup, Guid>(Guid.NewGuid()),
         false,
         identityProviderArgs,
         identityProvider);
 }
 public UnitOfMeasurementController(IServiceProvider serviceProvider)
 {
     _service          = serviceProvider.GetService <IUOMService>();
     _identityProvider = serviceProvider.GetService <IIdentityProvider>();
     _validateService  = serviceProvider.GetService <IValidateService>();
 }
    AddToRowIDDictionary
    (
        ExcelTableReader.ExcelTableRow row,
        IIdentityProvider edgeOrVertex,
        Boolean isEdge
    )
    {
        Debug.Assert(row != null);
        Debug.Assert(edgeOrVertex != null);
        AssertValid();

        if (!m_bFillIDColumns)
        {
            return;
        }

        Dictionary<Int32, IIdentityProvider> oRowIDDictionary = isEdge ?
            m_oEdgeRowIDDictionary : m_oVertexRowIDDictionary;

        // Because the derived class fills in its ID column if the column
        // exists, each cell in the column should be valid.

        String sRowID;
        Int32 iRowID = Int32.MinValue;

        if (
            row.TryGetNonEmptyStringFromCell(CommonTableColumnNames.ID,
                out sRowID)
            &&
            Int32.TryParse(sRowID, out iRowID)
            )
        {
            oRowIDDictionary.Add(iRowID, edgeOrVertex);

            Debug.Assert(edgeOrVertex is IMetadataProvider);

            // Store the row ID in the edge or vertex tag.

            ( (IMetadataProvider)edgeOrVertex ).Tag = iRowID;
        }
    }
Exemple #60
0
 public FabricProductPackingRepository(PackingInventoryDbContext dbContext, IServiceProvider serviceProvider)
 {
     _dbContext        = dbContext;
     _identityProvider = serviceProvider.GetService <IIdentityProvider>();
 }