Skip to content

from_global_id() differs from reference implementation #39

@markedwards

Description

@markedwards

The python from_global_id does not exhibit the same behavior as the reference TypeScript implementation when handling invalid input.

Examples:

  • from_global_id("invalid") raises binascii.Error
  • from_global_id("") raises TypeError
  • from_global_id(b64encode(b"foo")) raises TypeError

In the first two cases, the reference implementation returns {type: "", id: ""}. In the third case, it returns {type: "", id: "foo"}. In no case does it throw an error.

This might seem like nitpicking, but it can cause significant differences in how user input ends up being handled.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy