File size: 5,946 Bytes
e932372
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.aptdot.com/data/v1/jwt-claims-reference.schema.json",
  "title": "Aptdot JWT Claims Reference & Signed Test Token Fixtures",
  "type": "object",
  "required": ["metadata", "registered_claims_dictionary", "token_fixtures"],
  "$defs": {
    "requirement": { "type": "string", "enum": ["required", "optional", "not_defined"] },
    "numericDate": { "type": "integer", "minimum": 0 }
  },
  "properties": {
    "metadata": {
      "type": "object",
      "required": ["name", "version", "date_modified", "license", "license_url", "schema", "source", "reference_time", "reference_time_epoch", "test_signing_key", "total_registered_claims", "total_token_fixtures", "description"],
      "properties": {
        "name": { "type": "string" },
        "version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" },
        "date_modified": { "type": "string", "format": "date" },
        "license": { "const": "CC0-1.0" },
        "license_url": { "type": "string", "format": "uri" },
        "schema": { "type": "string", "format": "uri" },
        "source": { "type": "string", "format": "uri" },
        "reference_time": { "type": "string", "format": "date-time" },
        "reference_time_epoch": { "$ref": "#/$defs/numericDate" },
        "specifications": { "type": "object", "additionalProperties": { "type": "string", "format": "uri" } },
        "test_signing_key": {
          "type": "object",
          "required": ["kid", "alg", "secret", "warning"],
          "properties": {
            "kid": { "type": "string" },
            "alg": { "const": "HS256" },
            "secret": { "type": "string", "minLength": 32 },
            "warning": { "type": "string" }
          }
        },
        "related_datasets": { "type": "array", "items": { "type": "string", "format": "uri" } },
        "persona_note": { "type": "string" },
        "total_registered_claims": { "type": "integer", "minimum": 1 },
        "total_token_fixtures": { "type": "integer", "minimum": 1 },
        "description": { "type": "string" }
      }
    },
    "registered_claims_dictionary": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["claim", "name", "type", "rfc_spec", "required_in", "description", "security_considerations"],
        "properties": {
          "claim": { "type": "string", "enum": ["iss", "sub", "aud", "exp", "nbf", "iat", "jti"] },
          "name": { "type": "string" },
          "type": { "type": "string" },
          "rfc_spec": { "type": "string", "format": "uri" },
          "required_in": {
            "type": "object",
            "required": ["rfc7519", "oidc_id_token", "rfc9068_access_token"],
            "properties": {
              "rfc7519": { "$ref": "#/$defs/requirement" },
              "oidc_id_token": { "$ref": "#/$defs/requirement" },
              "rfc9068_access_token": { "$ref": "#/$defs/requirement" }
            }
          },
          "description": { "type": "string" },
          "security_considerations": { "type": "string" }
        }
      }
    },
    "token_fixtures": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "required": ["fixture_id", "description", "intended_outcome", "expected_error", "verification", "header", "payload", "token"],
        "properties": {
          "fixture_id": { "type": "string" },
          "description": { "type": "string" },
          "intended_outcome": {
            "type": "string",
            "enum": ["valid", "invalid_expired", "invalid_premature", "invalid_missing_claim", "invalid_audience", "invalid_signature", "invalid_algorithm"]
          },
          "expected_error": {
            "oneOf": [
              { "type": "null" },
              {
                "type": "object",
                "required": ["pyjwt", "jsonwebtoken"],
                "properties": { "pyjwt": { "type": "string" }, "jsonwebtoken": { "type": "string" }, "jsonwebtoken_message": { "type": "string" } }
              }
            ]
          },
          "verification": {
            "type": "object",
            "required": ["algorithms", "issuer", "audience", "required_claims"],
            "properties": {
              "algorithms": { "type": "array", "items": { "type": "string" } },
              "issuer": { "type": "string" },
              "audience": { "type": "string" },
              "required_claims": { "type": "array", "items": { "type": "string" } },
              "required_typ": { "type": "string" }
            }
          },
          "header": {
            "type": "object",
            "required": ["alg"],
            "properties": { "alg": { "type": "string" }, "typ": { "type": "string" }, "kid": { "type": "string" } }
          },
          "payload": {
            "type": "object",
            "properties": {
              "iss": { "type": "string" },
              "sub": { "type": "string" },
              "aud": { "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] },
              "exp": { "$ref": "#/$defs/numericDate" },
              "nbf": { "$ref": "#/$defs/numericDate" },
              "iat": { "$ref": "#/$defs/numericDate" },
              "auth_time": { "$ref": "#/$defs/numericDate" },
              "jti": { "type": "string" },
              "scope": { "type": "string" },
              "amr": { "type": "array", "items": { "type": "string" } }
            }
          },
          "token": { "type": "string", "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]*$" }
        },
        "allOf": [
          {
            "if": { "properties": { "intended_outcome": { "const": "valid" } } },
            "then": { "properties": { "expected_error": { "type": "null" } } },
            "else": { "properties": { "expected_error": { "type": "object" } } }
          }
        ]
      }
    }
  }
}