Add opt in callback and redirect variable control - #27
Conversation
|
@shawn-dhillon thanks for the contribution. I was traveling this week but will look soon. I think probably The static headers addition seems practical. |
Thank you for the feedback @ottonomy. Apologies for not following up here sooner, I interpreted your message as you were still reviewing and there would be more context to follow; as I may be missing context on how we would safely merge this all under The premise behind all my changes and the additional variables were for granularity and control, so that they are added configuration that no op if unset. To review:
My concern is reusing I am interpreting your goal as to minimize the config surface. For const source = callback.exchangeScope === 'partial' ?
scrubExchangeForPartialScope(exchange) : exchange;
const payload = {
id: `${config.server.baseUri}/workflows/${exchange.workflowId}` +
`/exchanges/${exchange.id}`,
variables: source.variables,
step: 'default'
};which would strip the presentation and vp token, though we would loose some control and force all exchange vars and keep the rest of the meta fields but still enact data minimization to prevent sending PII to the relying backend. For let redirect_uri =
`${baseUri}/${procedurePath}?exchange_token=${token}`;
const {variables} = updatedExchange;
const responseVar = workflow.callback?.responseVariable;
if(responseVar && variables && variables[responseVar] !== undefined) {
const raw = variables[responseVar];
const value = typeof raw === 'string' ? raw : JSON.stringify(raw);
redirect_uri +=
`&${encodeURIComponent(responseVar)}=${encodeURIComponent(value)}`;
}I am more than happy to align or discuss more in case I may be missing your implication and my concerns are unwarranted. Thank you again for your feedback. |
@Ryanmtate @ottonomy @bryceteinck