MCPcopy
hub / github.com/authlib/authlib / get_header_alg

Method get_header_alg

authlib/jose/rfc7516/jwe.py:695–712  ·  view source on GitHub ↗
(self, header)

Source from the content-addressed store, hash-verified

693 return ensure_dict(obj, "JWE")
694
695 def get_header_alg(self, header):
696 if "alg" not in header:
697 raise MissingAlgorithmError()
698
699 alg = header["alg"]
700 if alg not in self.ALG_REGISTRY:
701 raise UnsupportedAlgorithmError()
702
703 instance = self.ALG_REGISTRY[alg]
704
705 # use all ALG_REGISTRY algorithms
706 if self._algorithms is None:
707 # do not use deprecated algorithms
708 if instance.deprecated:
709 raise UnsupportedAlgorithmError()
710 elif alg not in self._algorithms:
711 raise UnsupportedAlgorithmError()
712 return instance
713
714 def get_header_enc(self, header):
715 if "enc" not in header:

Callers 4

serialize_compactMethod · 0.95
serialize_jsonMethod · 0.95
deserialize_compactMethod · 0.95
deserialize_jsonMethod · 0.95

Calls 2

Tested by

no test coverage detected