{
  "$comment": "GENERATED by TimeBasedOneTimePasswords/tools/generate-test-vectors.py (OpenChargingTechnology/Whitepapers) - do not edit by hand. Regenerate by rerunning the generator.",
  "specification": "Open Charging Technology TOTP HTTP Authentication 1.0 (draft)",
  "description": "The 'Authorization: TOTP' scheme as RFC 9110 auth-params: TOTP login=\"<b64>\", totp=\"<b64>\"[, tlscb=true|false]. login/totp are mandatory Base64 of UTF-8; tlscb is optional and defaults to TRUE; unknown parameters are ignored, duplicates rejected. 'vectors' round-trip (build the canonical header AND parse it back), 'parseVectors' are parse-only leniency cases, 'invalidHeaders' MUST be rejected by parsers. The whole file requires the listed capabilities; harnesses without them skip it declaratively.",
  "requires": [
    "httpAuthentication"
  ],
  "vectors": [
    {
      "id": "raw-token",
      "description": "A raw token must say so: tlscb defaults to true, so tlscb=false is explicit.",
      "input": {
        "login": "chargingstation-0001",
        "totp": "CN63y502maVh",
        "tlscb": false
      },
      "expected": {
        "header": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVZo\", tlscb=false"
      }
    },
    {
      "id": "tls-channel-bound",
      "description": "The canonical bound form omits tlscb - true is the default (secure by default).",
      "input": {
        "login": "chargingstation-0001",
        "totp": "gAzxPfYtmRgd",
        "tlscb": true
      },
      "expected": {
        "header": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Z0F6eFBmWXRtUmdk\""
      }
    },
    {
      "id": "login-with-colon",
      "description": "Login and token are Base64-encoded separately, so a colon in the login - HTTP Basic Auth's classic ambiguity - is harmless.",
      "input": {
        "login": "EVSE:DE*GEF*E1234*1",
        "totp": "CN63y502maVh",
        "tlscb": false
      },
      "expected": {
        "header": "TOTP login=\"RVZTRTpERSpHRUYqRTEyMzQqMQ==\", totp=\"Q042M3k1MDJtYVZo\", tlscb=false"
      }
    },
    {
      "id": "login-utf8",
      "description": "A non-ASCII login is UTF-8 encoded before Base64.",
      "input": {
        "login": "Lades\u00e4ule-S\u00fcd-01",
        "totp": "SLuwWQOYh3g0",
        "tlscb": false
      },
      "expected": {
        "header": "TOTP login=\"TGFkZXPDpHVsZS1Tw7xkLTAx\", totp=\"U0x1d1dRT1loM2cw\", tlscb=false"
      }
    },
    {
      "id": "short-token",
      "description": "A six character token (the OCPP minimum length).",
      "input": {
        "login": "chargingstation-0001",
        "totp": "Ik0dNs",
        "tlscb": false
      },
      "expected": {
        "header": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"SWswZE5z\", tlscb=false"
      }
    }
  ],
  "parseVectors": [
    {
      "id": "scheme-lowercase",
      "description": "The scheme name is matched case-insensitively.",
      "header": "totp login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVZo\", tlscb=false",
      "expected": {
        "login": "chargingstation-0001",
        "totp": "CN63y502maVh",
        "tlscb": false
      }
    },
    {
      "id": "scheme-mixed-case",
      "description": "The scheme name is matched case-insensitively.",
      "header": "tOtP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Z0F6eFBmWXRtUmdk\"",
      "expected": {
        "login": "chargingstation-0001",
        "totp": "gAzxPfYtmRgd",
        "tlscb": true
      }
    },
    {
      "id": "explicit-tlscb-true",
      "description": "tlscb=true is the spelled-out default.",
      "header": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Z0F6eFBmWXRtUmdk\", tlscb=true",
      "expected": {
        "login": "chargingstation-0001",
        "totp": "gAzxPfYtmRgd",
        "tlscb": true
      }
    },
    {
      "id": "tlscb-value-case-insensitive",
      "description": "The tlscb value is matched case-insensitively.",
      "header": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVZo\", tlscb=FALSE",
      "expected": {
        "login": "chargingstation-0001",
        "totp": "CN63y502maVh",
        "tlscb": false
      }
    },
    {
      "id": "tlscb-quoted",
      "description": "Auth-param values may use the quoted-string form.",
      "header": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVZo\", tlscb=\"false\"",
      "expected": {
        "login": "chargingstation-0001",
        "totp": "CN63y502maVh",
        "tlscb": false
      }
    },
    {
      "id": "parameter-order-insensitive",
      "description": "Auth-params are unordered.",
      "header": "TOTP totp=\"Q042M3k1MDJtYVZo\", tlscb=false, login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\"",
      "expected": {
        "login": "chargingstation-0001",
        "totp": "CN63y502maVh",
        "tlscb": false
      }
    },
    {
      "id": "unknown-parameter-ignored",
      "description": "Unknown auth-params MUST be ignored - the standard extension point.",
      "header": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVZo\", tlscb=false, foo=\"bar\"",
      "expected": {
        "login": "chargingstation-0001",
        "totp": "CN63y502maVh",
        "tlscb": false
      }
    },
    {
      "id": "token-form-value",
      "description": "A Base64 value without padding is a valid token and may come unquoted.",
      "header": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=Q042M3k1MDJtYVZo, tlscb=false",
      "expected": {
        "login": "chargingstation-0001",
        "totp": "CN63y502maVh",
        "tlscb": false
      }
    },
    {
      "id": "whitespace-around-separators",
      "description": "Optional whitespace around \"=\" and \",\" is accepted.",
      "header": "TOTP login = \"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\" , totp=\"Q042M3k1MDJtYVZo\" ,tlscb=false",
      "expected": {
        "login": "chargingstation-0001",
        "totp": "CN63y502maVh",
        "tlscb": false
      }
    }
  ],
  "invalidHeaders": [
    {
      "id": "missing-login",
      "description": "The login parameter is mandatory.",
      "header": "TOTP totp=\"Q042M3k1MDJtYVZo\""
    },
    {
      "id": "missing-totp",
      "description": "The totp parameter is mandatory.",
      "header": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\""
    },
    {
      "id": "empty-login",
      "description": "An empty login is rejected.",
      "header": "TOTP login=\"\", totp=\"Q042M3k1MDJtYVZo\""
    },
    {
      "id": "duplicate-login",
      "description": "Duplicate parameters are ambiguous and rejected.",
      "header": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVZo\""
    },
    {
      "id": "duplicate-totp",
      "description": "Duplicate parameters are ambiguous and rejected.",
      "header": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVZo\", totp=\"Q042M3k1MDJtYVZo\""
    },
    {
      "id": "duplicate-tlscb",
      "description": "Duplicate parameters are ambiguous and rejected.",
      "header": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVZo\", tlscb=false, tlscb=true"
    },
    {
      "id": "tlscb-invalid-value",
      "description": "tlscb is a boolean.",
      "header": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVZo\", tlscb=maybe"
    },
    {
      "id": "login-not-base64",
      "description": "The login value must be valid Base64.",
      "header": "TOTP login=\"not-base64!\", totp=\"Q042M3k1MDJtYVZo\""
    },
    {
      "id": "totp-not-base64",
      "description": "The totp value must be valid Base64.",
      "header": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"not-base64!\""
    },
    {
      "id": "unterminated-quote",
      "description": "A quoted-string must be closed.",
      "header": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE="
    },
    {
      "id": "abandoned-type-digit-form",
      "description": "The whitespace-separated type digit of an earlier draft is not the format.",
      "header": "TOTP 0 Y2hhcmdpbmdzdGF0aW9uLTAwMDE=:Q042M3k1MDJtYVZo"
    },
    {
      "id": "abandoned-colon-type-form",
      "description": "The colon-separated type of an earlier draft is not the format.",
      "header": "TOTP 1:Y2hhcmdpbmdzdGF0aW9uLTAwMDE=:Q042M3k1MDJtYVZo"
    },
    {
      "id": "abandoned-two-segment-form",
      "description": "The typeless two-segment form of an earlier draft is not the format.",
      "header": "TOTP Y2hhcmdpbmdzdGF0aW9uLTAwMDE=:Q042M3k1MDJtYVZo"
    },
    {
      "id": "bare-token68-blob",
      "description": "A single token68-style blob is not auth-params.",
      "header": "TOTP Y2hhcmdpbmdzdGF0aW9uLTAwMDE="
    },
    {
      "id": "wrong-scheme",
      "description": "A different authentication scheme is not ours to parse.",
      "header": "Basic login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVZo\""
    },
    {
      "id": "empty",
      "description": "An empty header value is rejected.",
      "header": ""
    },
    {
      "id": "scheme-only",
      "description": "The scheme name alone is not a credential.",
      "header": "TOTP"
    }
  ]
}
