Пример #1
0
        public AuthenticationService(HostSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            _Settings = settings;
        }
Пример #2
0
        public static void ConfigureHost(this ICakeContext context, HostSettings settings)
        {
            HostSettings instance = context.GetContainer().GetInstance <HostSettings>();

            foreach (User user in settings.Users)
            {
                instance.AddUser(user.Username, user.Password);
            }

            foreach (string key in settings.ApiKeys)
            {
                instance.AddApiKey(key);
            }

            instance.Host = settings.Host;
            instance.Port = settings.Port;
            instance.Url  = settings.Url;

            context.Log.Information("Host configured.");
        }