MCPcopy
hub / github.com/authlib/authlib / JWESharedHeader

Class JWESharedHeader

authlib/jose/rfc7516/models.py:113–137  ·  view source on GitHub ↗

Shared header object for JWE. Combines protected header and shared unprotected header together.

Source from the content-addressed store, hash-verified

111
112
113class JWESharedHeader(dict):
114 """Shared header object for JWE.
115
116 Combines protected header and shared unprotected header together.
117 """
118
119 def __init__(self, protected, unprotected):
120 obj = {}
121 if unprotected:
122 obj.update(unprotected)
123 if protected:
124 obj.update(protected)
125 super().__init__(obj)
126 self.protected = protected if protected else {}
127 self.unprotected = unprotected if unprotected else {}
128
129 def update_protected(self, addition):
130 self.update(addition)
131 self.protected.update(addition)
132
133 @classmethod
134 def from_dict(cls, obj):
135 if isinstance(obj, cls):
136 return obj
137 return cls(obj.get("protected"), obj.get("unprotected"))
138
139
140class JWEHeader(dict):

Callers 1

deserialize_jsonMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…