sodal-project / cartographer-mvp

MIT License
3 stars 1 forks source link

Integration Processor #190

Open tbenbow opened 1 year ago

tbenbow commented 1 year ago

The goal of this task is to make creating integrations easier. Creating integrations should only require two steps...

  1. Fetch all of the necessary data from the service's API
  2. Format fetched data as an object

We will write a processor function which will take the structured data and use the already existing Persona functions to create all of the stuff necessary. Just pass your array of objects to the processor function and you're done.

Here's a potential structure for the data we pass to this function...

{
  standardProps = {
    platform: "aws",
    type: "account",
    id: data.Id,
    status: data.Id === "ACTIVE" ? "active" : "suspended",
    friendlyName: data.Name,
  },
  customProps = {
    arn: data.Arn,
  },
  relationships: [
    {
      type: 'controller',
      access: 'superadmin',
      upn: XXXX (or a unique id)
    },
    {
      type: 'obeys'
      access: 'user',
      upn: XXXX
    },
  ]
}

It would also be handy to write a validator function to check for errors in your structured data but that could come at another time.