A dict instance to represent a JWS object.
| 67 | |
| 68 | |
| 69 | class JWSObject(dict): |
| 70 | """A dict instance to represent a JWS object.""" |
| 71 | |
| 72 | def __init__(self, header, payload, type="compact"): |
| 73 | super().__init__( |
| 74 | header=header, |
| 75 | payload=payload, |
| 76 | ) |
| 77 | self.header = header |
| 78 | self.payload = payload |
| 79 | self.type = type |
| 80 | |
| 81 | @property |
| 82 | def headers(self): |
| 83 | """Alias of ``header`` for JSON typed JWS.""" |
| 84 | if self.type == "json": |
| 85 | return self["header"] |
no outgoing calls
no test coverage detected
searching dependent graphs…