Skip to content

Cleanup and deprecate confusing annotations #583

Open
@oojacoboo

Description

@oojacoboo

The following annotations are confusing and have a lot of overlap in their documented functionality.

  • #[Logged]
  • #[Right]
  • #[HideIfUnauthorized]

Personally, we don't use any of them and I find the #[Security] annotation to be more than appropriate, especially with the expression language extensibility. Nonetheless, we're left with these others in the library. This ticket is to open a discussion into the current use of these annotations and potentially clean them up and deprecate where possible.

Further, #[HideIfUnauthorized], is dynamic in nature, causing the inability to cache types/schema for performance purposes. See #569 for more discussion on this topic.

As I understand it, #[HideIfUnauthorized] is required to hide the field, regardless of #[Logged] or #[Right] being declared. In this case, I don't see why #[Logged] and #[Right] cannot implement an argument that determines if the field is hidden or not: #[Logged(hide: true)]. TBH, I don't even see the purpose of #[Logged] or #[Right], if the field isn't being hidden. So, why aren't these hiding by default and what are they doing when declared alone?

Additionally, can #[Logged] and #[Right] be merged together, and/or replaced by #[Security]?

All of these annotations are terribly confusing and the design is pretty awful IMO. I'd like to hear from others in how you're using them, suggestions for improvements, but with the overall goal of cleaning these up and deprecating them as much as possible.

Metadata

Metadata

Assignees

No one assigned

    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