OpenFn / OpenFn/kit

Rethinking credentials for multiple adaptors

Open
#802 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
21
Forks
23
Avg merge
1d 22h
Merged PRs (30d)
17

Description

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.)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the runtime and execution-plan representations described in the issue, then compare the configuration passed to adaptor functions with the scoped configuration requested in #779. Establish acceptance criteria for multiple adaptor/credential pairs, credential name conflicts, and conflicting adaptor imports before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.