示例#1
0
        public AuthMethod(string path, string type)
        {
            // We do not call the actual property setters here, because of an endless loop situation.
            _type     = type;
            _typeEnum = AuthMethodEnumConverters.EnumAuthMethodsFromString(type);
            Config    = new AuthConfig();

            // We also accept a null path value.  We have to allow this because Vault does not return the path as part of the JSON object, but
            // rather as a dictionary key element.  We are assuming that if the value is null then the caller will eventually get around to
            // setting the path or name....
            if (path != null)
            {
                SetPathAndName(path);
            }
        }
示例#2
0
        /// <summary>
        /// Constructor that accepts our EnumAuthMethod argument for constructing the method.
        /// </summary>
        /// <param name="path">The path to the mount point for the provided Authentication Method</param>
        /// <param name="authenticationMethod">EnumAuthMethod - Type of authentication method object to create</param>
        public AuthMethod(string path, EnumAuthMethods authenticationMethod)
        {
            _typeEnum = authenticationMethod;
            _type     = AuthMethodEnumConverters.EnumAuthMethodsToString(_typeEnum);
            Config    = new AuthConfig();

            if (path == null)
            {
                throw new ArgumentException("The path value cannot be null.");
            }

            if (path == "")
            {
                throw new ArgumentException("The path value cannot be an empty string.");
            }

            SetPathAndName(path);
        }