Skip to content

fix(acls): replace UUID type with str for improved compatibility#85

Open
briansumma wants to merge 4 commits intoNorthShoreAutomation:mainfrom
briansumma:feature/acls
Open

fix(acls): replace UUID type with str for improved compatibility#85
briansumma wants to merge 4 commits intoNorthShoreAutomation:mainfrom
briansumma:feature/acls

Conversation

@briansumma
Copy link
Copy Markdown
Contributor

Summary

I'd like to update my existing PR "feat(acls): implement ACLs API functionality" with the following changes:

Changes in this update

  • Replace all UUID type references with str in model field definitions
  • Update parameter type annotations in all AclsSpec methods
  • Ensure backward compatibility with existing models
  • Maintain consistent type handling across the API
  • Update docstrings to reflect type changes

Implementation details

After additional testing with the API, I discovered that using Python's UUID type directly caused compatibility issues with:

  1. Existing code that expects string IDs
  2. Client code that passes string identifiers
  3. Raw responses from the API that may use string representations

This change simplifies the type system and avoids unnecessary conversions between UUID and string types. The implementation maintains all the same functionality but improves usability and robustness when dealing with identifiers from various sources.

Testing

All existing tests have been updated to reflect the type changes and continue to pass. The tests demonstrate proper handling of string identifiers throughout the ACLs functionality.

This change has no impact on the API's behavior - it's purely a type system improvement to match user expectations and simplify integration.

Add complete ACLs API integration providing access control management features.

Key additions:
- AclsSpec with comprehensive permission management methods
- Pydantic models for ACL request/response handling
- Internal utilities for Pydantic model detection
- Extensive test coverage for ACLs functionality
Update ACLs models and specs to use string type instead of UUID for all identifiers.
This change ensures better compatibility with existing models and aligns with user
expectations when calling API methods.
@nsa-brant
Copy link
Copy Markdown
Member

nice! mind updating to use list_ instead of fetch when getting a list of objects? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants