Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rethinking credentials for multiple adaptors #802

Open
josephjclark opened this issue Oct 22, 2024 · 0 comments
Open

Rethinking credentials for multiple adaptors #802

josephjclark opened this issue Oct 22, 2024 · 0 comments

Comments

@josephjclark
Copy link
Collaborator

For collections, we need to support multiple adaptor an multiple credentials. Because collections are implemented as an adaptor.

At the moment, I'm sort of fudging this, and saying the engine supports multiple credentials, which get flattened into a single configuration object. It's sort of fine. Or actually I might implement a global credential object which is shared by everything in the workflow. Whatever.

The point is: when there are multiple adaptors on a step, it makes sense that you need multiple credentials.

In the runtime, they need to get flattened to one object, which gives you a problem with name conflicts - especially with stuff like baseUrl an username, which are common. So we need a scoped configuration object, and the runtime needs to pass the right scope into each adaptor function. And this needs to go hand in hand I think with #779 - the config we pass as a second argument to the operation needs to be scoped.

On the execution plan, this may mean that we have { adaptor, credential } pairs in an array called dependencies, or something, rather than the adaptors and credential singletons we have right now.

(quick reminder to me and whoever is reading that the other big problem with multiple adaptors comes from imports: if you use, i don't know, fhir an commcare in one step, and both adptors export fn, which package should we import fn from? Importing fn twice is an error. So basically we need a means of declaring, where there are import conflicts, which to choose.)

@github-project-automation github-project-automation bot moved this to New Issues in v2 Oct 22, 2024
@josephjclark josephjclark mentioned this issue Oct 22, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New Issues
Development

No branches or pull requests

1 participant