version: 1
metadata:
  name: test conditional fields
  labels:
    blueprints.goauthentik.io/description: |
      Some models have conditional fields that are only allowed in blueprint contexts
      - Token (key)
      - Application (icon)
      - Source (icon)
      - Flow (background)
      - Endpoint Enrollment token (key)
entries:
  token:
    - model: authentik_core.token
      identifiers:
        identifier: "%(uid)s-token"
      attrs:
        key: "%(uid)s"
        user: "%(user)s"
        intent: api
  app:
    - model: authentik_core.application
      identifiers:
        slug: "%(uid)s-app"
      attrs:
        name: "%(uid)s-app"
        icon: https://goauthentik.io/img/icon.png
  source:
    - model: authentik_sources_oauth.oauthsource
      identifiers:
        slug: "%(uid)s-source"
      attrs:
        name: "%(uid)s-source"
        provider_type: azuread
        consumer_key: "%(uid)s"
        consumer_secret: "%(uid)s"
        icon: https://goauthentik.io/img/icon.png
  flow:
    - model: authentik_flows.flow
      identifiers:
        slug: "%(uid)s-flow"
      attrs:
        name: "%(uid)s-flow"
        title: "%(uid)s-flow"
        designation: authentication
        background: https://goauthentik.io/img/icon.png
  user:
    - model: authentik_core.user
      identifiers:
        username: "%(uid)s"
      attrs:
        name: "%(uid)s"
        password: "%(uid)s"
    - model: authentik_core.user
      identifiers:
        username: "%(uid)s-no-password"
      attrs:
        name: "%(uid)s"
  endpoint:
    - model: authentik_endpoints_connectors_agent.agentconnector
      id: connector
      identifiers:
        name: "%(uid)s"
    - model: authentik_endpoints_connectors_agent.enrollmenttoken
      identifiers:
        name: "%(uid)s"
      attrs:
        key: "%(uid)s"
        connector: !KeyOf connector
