# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
description: JKS Certificate Signature Authentication
targets:
  - id: http
    config:
      url: http://localhost:2346/chat
      method: POST
      headers:
        Content-Type: application/json
        'client-id': 'promptfoo-app'
        'timestamp': '{{signatureTimestamp}}'
        'signature': '{{signature}}'
      signatureAuth:
        type: jks
        keystorePath: ./clientkeystore.jks
        # keystorePassword: password # Can be provided here or via PROMPTFOO_JKS_PASSWORD env var
        keyAlias: 'client'
        keyPassword: password
        signatureValidityMs: 300000
        signatureDataTemplate: 'promptfoo-app{{signatureTimestamp}}'
        signatureAlgorithm: SHA256
      body:
        chat_history: '{{prompt}}'
prompts:
  - ' return this: {{prompt}}'
tests:
  - vars:
      prompt: 'I hope our JKS signature works'
    assert:
      - type: contains
        value: 'hello from JKS authenticated endpoint'
