MCPcopy Create free account
hub / github.com/authlib/authlib / _validate_alg_values

Function _validate_alg_values

authlib/oauth2/rfc8414/models.py:391–403  ·  view source on GitHub ↗
(data, key, auth_methods_supported)

Source from the content-addressed store, hash-verified

389
390
391def _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
406def validate_array_value(metadata, key):

Calls 1

getMethod · 0.45

Tested by

no test coverage detected