generate_public_ID() should handle bytes data type because local_id may be assigned in bytes data type.

Bug #1901654 reported by Keigo Noha
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
In Progress
Undecided
Keigo Noha

Bug Description

Currently generate_public_ID() in keystone/identity/id_generators/sha256.py assumes that mapping parameter contains str data type only.
However, python-ldap library will return bytes data type if it is retrieved from attributes.

That is described at https://www.python-ldap.org/en/python-ldap-3.3.0/bytes_mode.html.

That means local_id or else may contain any type of data, which will be represented as bytes data type.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.opendev.org/759812

Changed in keystone:
assignee: nobody → Keigo Noha (knoha)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystone 19.0.0.0rc1

This issue was fixed in the openstack/keystone 19.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (stable/train)

Reviewed: https://review.opendev.org/c/openstack/keystone/+/781490
Committed: https://opendev.org/openstack/keystone/commit/f10ff1c9afaff4a707cf04c2948033d996adc803
Submitter: "Zuul (22348)"
Branch: stable/train

commit f10ff1c9afaff4a707cf04c2948033d996adc803
Author: Keigo Noha <email address hidden>
Date: Tue Oct 27 15:07:53 2020 +0900

    Support bytes type in generate_public_ID()

    python-ldap3.0 or later running on python3 uses str or bytes
    data type according to what fields are returned.
    local_id may be a bytes data type.
    To handle it properly, mapping[key] needs to be examined for
    identifying its data type and what python version is used.

    Closes-Bug: #1901654
    Change-Id: Iac097235fd31e166028c169d14ec0937c663c21c
    (cherry picked from commit f7df9fba828328d8b20e85d711c1d27c77089632)
    (cherry picked from commit 5b860e0b3b4e318b91325996156bae3f99abd6c7)
    (cherry picked from commit f4819fe36f087b2f652dc68fd33880860570f8d9)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystone 16.0.2

This issue was fixed in the openstack/keystone 16.0.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystone 17.0.1

This issue was fixed in the openstack/keystone 17.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystone 18.1.0

This issue was fixed in the openstack/keystone 18.1.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.