Module @map-colonies/auth-bundler

A library to facilitate creating authentication bundles for consumption with Open Policy Agent.

The library has two main parts:

  • createBundle - A function to create the bundles.
  • BundleDatabase - A helper class to make all the required database actions when creating a bundle.

auth-bundler

A library to facilitate creating authentication bundles for consumption with Open Policy Agent.

API reference

TBD

Usage example

Templating engine

The package uses handlebars for templating the asset files. When running, the engine is supplied an array containing all the connections for the bundle to use for templating.

For convenience we have added the following helper function to aid creating json files:

#escapeJson

Escapes the given string using the JSON.stringify function.

# input
{
{{escapeJson name}}: {{ enabled }}
}

# result
{
"avi": true
}

#delimitedEach

Templated in a loop with , as a delimiter. useful for JSON arrays / objects.

# input
[
{{#delimitedEach .}}
{
"name": {{ name }}
}
{{/delimitedEach}}
]

# result
[
{
"name": avi
}
,{
"name": iva
}
]

Index

Classes

Interfaces

Functions

logger

Generated using TypeDoc