Skip to main content

DataSource

Data Sources define standard schemas for fetching additional information during rule evaluation. Using data sources during rule evaluation is covered in the conceptual background. Currently, data sources can only be used with the Rego rule evaluator.

YAML Example

version: v1
type: data-source
name: ghapi
rest:
providerAuth: true
def:
license:
endpoint: https://api.github.com/repos/{owner}/{repo}/license
parse: json
input_schema:
type: object
properties:
owner:
type: string
repo:
type: string
repo_config:
endpoint: https://api.github.com/repos/{owner}/{repo}
parse: json
input_schema:
type: object
properties:
owner:
type: string
repo:
type: string
vulnerability_reporting:
endpoint: https://api.github.com/repos/{owner}/{repo}/private-vulnerability-reporting
parse: json
input_schema:
type: object
properties:
owner:
type: string
repo:
type: string

Fields

note

Note that the Minder CLI uses snake_case for field names, but the OpenAPI spec (shown here) uses camelCase for names like display_name, in_entity, etc.

version
required
string

version is the version of the data source API.

type
string (type is the data source type)
object (v1ContextV2)

ContextV2 defines the context in which a rule is evaluated.

name
required
string

name is the name of the data source. Note that this is unique within a project hierarchy. Names must be lowercase and can only contain letters, numbers, hyphens, and underscores.

id
string

id is the unique identifier of the data source.

object (v1StructDataSource)

StructDataSource is the structured data source driver.

object (v1RestDataSource)

RestDataSource is the REST data source driver.

;