コード例 #1
0
        public KerberosManager(KerberosOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            Options = options;
            _logger = options.Logger;
            if (_logger == null)
            {
                // Default-ish behavior pre-Logger
                _logger = DefaultConsoleLogger;
                _logger.LogWarning("No logger specified, defaulting to simple console logging");
            }

            _isLinux           = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
            _awsLambdaFuncName = Environment.GetEnvironmentVariable(AwsLambdaFuncNameEnvKey);

            Enabled = _isLinux && !string.IsNullOrEmpty(_awsLambdaFuncName);

            _logger.LogInformation($"Kerberos Manager is [{(Enabled ? "ENABLED" : "DISABLED")}]:");
            _logger.LogInformation("* Is Linux: " + _isLinux);
            _logger.LogInformation("* Lambda Function Name: " + _awsLambdaFuncName);

            // DEBUG:
            // foreach (var env in Environment.GetEnvironmentVariables().Cast<System.Collections.DictionaryEntry>().OrderBy(e => e.Key))
            // {
            //     _logger.LogInformation($"ENV: [{env.Key}]=[{env.Value}]");
            // }
        }
コード例 #2
0
        public KerberosManager(KerberosOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            Options = options;

            _isLinux           = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
            _awsLambdaFuncName = Environment.GetEnvironmentVariable(AwsLambdaFuncNameEnvKey);

            Enabled = _isLinux && !string.IsNullOrEmpty(_awsLambdaFuncName);

            Console.WriteLine($"Kerberos Manager is [{(Enabled ? "ENABLED" : "DISABLED")}]:");
            Console.WriteLine("* Is Linux: " + _isLinux);
            Console.WriteLine("* Lambda Function Name: " + _awsLambdaFuncName);

            // DEBUG:
            // foreach (var env in Environment.GetEnvironmentVariables().Cast<System.Collections.DictionaryEntry>().OrderBy(e => e.Key))
            // {
            //     Console.WriteLine($"ENV: [{env.Key}]=[{env.Value}]");
            // }
        }