Add a context provider for secrets

This commit is contained in:
Josh Gross
2022-11-29 16:56:20 -05:00
parent a67069da17
commit 72c7fbd032
10 changed files with 105 additions and 9 deletions
+3 -1
View File
@@ -12,6 +12,7 @@ import {ContextProviderConfig} from "./context-providers/config";
import {getContext} from "./context-providers/default";
import {getWorkflowContext, WorkflowContext} from "./context/workflow-context";
import {nullTrace} from "./nulltrace";
import {getAllowedContext} from "./utils/allowed-context";
import {findToken} from "./utils/find-token";
import {transform} from "./utils/transform";
import {Value, ValueProviderConfig} from "./value-providers/config";
@@ -80,7 +81,8 @@ export async function complete(
const expressionInput = (getExpressionInput(currentInput, relCharPos) || "").trim();
const context = getContext(token.definition?.readerContext || [], contextProviderConfig);
const allowedContext = getAllowedContext(token, parent!);
const context = await getContext(allowedContext, contextProviderConfig);
return completeExpression(expressionInput, context, []);
}