Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update backend.Key to be its own distinct type #46701

Merged
merged 1 commit into from
Oct 4, 2024

Commits on Oct 4, 2024

  1. Update backend.Key to be its own distinct type

    Converts the backend.Key from a slice of bytes to a concrete struct.
    The main motivation behind this change is to be able to better
    distinguish individual components of a key. The textual representation
    of a backend key is constructed by joining all components of the key
    with a /. By representing the entire key as a single textual object
    it prevented resources containing a / in their name from being
    properly identified. There was a lot of code that interpolated keys
    in various manners and expected only a specific number of
    subcomponents for a particular resource. This lead to most,
    if not all, of the RPCs used to create a resource to permit a name
    containing /, (i.e. a user named test/llama/1), but any RPCs used
    to retrieve the resources would fail to retrieve them from the
    backend.
    
    Every backend.Key now carries a slice of all the individual
    components in addition to the textual representation. This permits
    more fine grained inspection per component, while also not having
    to construct the textual representation for a group of components
    more than once.
    
    The backend.Sanitizer was updated to only validate keys for backend
    writes. Retrieving and deleting invalid of malformed keys is now
    permitted. This will allow any existing resources that were created
    with / in one of the components to become retrievable and deletable.
    However, any new resources with  / in their name are explicitly
    prevented.
    
    Closes #6088
    Closes #9107
    Closes #10576
    Closes #42823
    rosstimothy committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    4bcabfb View commit details
    Browse the repository at this point in the history