IAM: Issues with ListMFADevices and CreateVirtualMFADevice (#5334)

This commit is contained in:
Viren Nadkarni 2022-07-26 18:40:18 +05:30 committed by GitHub
parent 98501ae676
commit 036cc6879e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -85,8 +85,8 @@ class VirtualMfaDevice(object):
self.base32_string_seed = base64.b64encode( self.base32_string_seed = base64.b64encode(
random_base32_string.encode("ascii") random_base32_string.encode("ascii")
).decode("ascii") ).decode("ascii")
self.qr_code_png = base64.b64encode( self.qr_code_png = base64.b64encode(os.urandom(64)).decode(
os.urandom(64) "ascii"
) # this would be a generated PNG ) # this would be a generated PNG
self.enable_date = None self.enable_date = None

View File

@ -2110,6 +2110,9 @@ LIST_MFA_DEVICES_TEMPLATE = """<ListMFADevicesResponse>
<member> <member>
<UserName>{{ user_name }}</UserName> <UserName>{{ user_name }}</UserName>
<SerialNumber>{{ device.serial_number }}</SerialNumber> <SerialNumber>{{ device.serial_number }}</SerialNumber>
{% if device.enable_date %}
<EnableDate>{{ device.enabled_iso_8601 }}</EnableDate>
{% endif %}
</member> </member>
{% endfor %} {% endfor %}
</MFADevices> </MFADevices>