Exemplo n.º 1
0
        private IHttpActionResult DeleteFunctionSecret(string keyName, string functionName = null)
        {
            if (keyName == null || keyName.StartsWith("_"))
            {
                // System keys cannot be deleted.
                return(BadRequest("Invalid key name."));
            }

            if ((functionName != null && !_scriptHostManager.Instance.Functions.Any(f => string.Equals(f.Name, functionName, StringComparison.OrdinalIgnoreCase))) ||
                !_secretManager.DeleteSecret(keyName, functionName))
            {
                // Either the function or the key were not found
                return(NotFound());
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }