keystone.receipt.receipt_formatters.ReceiptFormatter[source]¶Bases: object
Packs and unpacks payloads into receipts for transport.
create_receipt(user_id, methods, expires_at)[source]¶Given a set of payload attributes, generate a Fernet receipt.
creation_time(fernet_receipt)[source]¶Return the creation time of a valid Fernet receipt.
crypto¶Return a cryptography instance.
You can extend this class with a custom crypto @property to provide
your own receipt encoding / decoding. For example, using a different
cryptography library (e.g. python-keyczar) or to meet arbitrary
security requirements.
This @property just needs to return an object that implements
encrypt(plaintext) and decrypt(ciphertext).
keystone.receipt.receipt_formatters.ReceiptPayload[source]¶Bases: object
assemble(user_id, methods, expires_at)[source]¶Assemble the payload of a receipt.
| Parameters: |
|
|---|---|
| Returns: | the payload of a receipt |
attempt_convert_uuid_hex_to_bytes(value)[source]¶Attempt to convert value to bytes or return value.
| Parameters: | value – value to attempt to convert to bytes |
|---|---|
| Returns: | tuple containing boolean indicating whether user_id was stored as bytes and uuid value as bytes or the original value |
convert_uuid_bytes_to_hex(uuid_byte_string)[source]¶Generate uuid.hex format based on byte string.
| Parameters: | uuid_byte_string – uuid string to generate from |
|---|---|
| Returns: | uuid hex formatted string |
convert_uuid_hex_to_bytes(uuid_string)[source]¶Compress UUID formatted strings to bytes.
| Parameters: | uuid_string – uuid string to compress to bytes |
|---|---|
| Returns: | a byte representation of the uuid |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.