| 389 | |
| 390 | |
| 391 | def _validate_alg_values(data, key, auth_methods_supported): |
| 392 | value = data.get(key) |
| 393 | if value and not isinstance(value, list): |
| 394 | raise ValueError(f'"{key}" MUST be JSON array') |
| 395 | |
| 396 | auth_methods = set(auth_methods_supported) |
| 397 | jwt_auth_methods = {"private_key_jwt", "client_secret_jwt"} |
| 398 | if auth_methods & jwt_auth_methods: |
| 399 | if not value: |
| 400 | raise ValueError(f'"{key}" is required') |
| 401 | |
| 402 | if value and "none" in value: |
| 403 | raise ValueError(f'the value "none" MUST NOT be used in "{key}"') |
| 404 | |
| 405 | |
| 406 | def validate_array_value(metadata, key): |