Module aeonics.core

Class User


  • public class User
    extends Item<User.Type>
    This item plays a role in the definition of the Security. It represents a login to the system, whether or not it is linked to a physical person, a service, or a device is left at the sole discretion of the security Provider.

    Important implementation notes:

    The Entity.id() is the unique identifier for a user, it does not carry information but is used to reference users. You should avoid duplicate IDs and those must be stable over time: never change and the same user must always have the same ID.

    The User.Type.login() is used to perform the authentication, it can be of any form: email, login name or opaque credentials.

    The Entity.name() is the friendly name of the user. Usually it is identical to the login but it is not a requirement. Since the name is free text there may be duplicates, so never rely on this information.

    Any other property or profile information is not included by default, you can add them in the custom attributes property, fetch them somehow, or add a related profile entity.

    Example:

     id: 12345-678910
     login: john.doe@example.com
     name: Monster2023
     email: john.doe@example.com (custom attribute)
     firstname: John (custom attribute)
     lastname: Doe (custom attribute)
     
    • Field Detail

      • ANONYMOUS

        public static final User.Type ANONYMOUS
      • SYSTEM

        public static final User.Type SYSTEM
    • Constructor Detail

      • User

        public User()
    • Method Detail

      • defaultTarget

        protected java.lang.Class<? extends User.Type> defaultTarget()
        Description copied from class: Item
        Returns the default target entity type. This method should be implemented by subclasses to specify the target entity type.
        Specified by:
        defaultTarget in class Item<User.Type>
        Returns:
        the default target entity type
      • defaultCreator

        protected java.util.function.Supplier<? extends User.Type> defaultCreator()
        Description copied from class: Item
        Returns the default target entity creator. This method should be implemented by subclasses to specify the entity creator.
        Specified by:
        defaultCreator in class Item<User.Type>
        Returns:
        the default target entity creator
      • category

        protected java.lang.Class<? extends User> category()
        Description copied from class: Item
        Returns the target entity category. This method should be implemented by subclasses to specify the entity category.
        Specified by:
        category in class Item<User.Type>
        Returns:
        the target entity category
      • template

        public Template<? extends User.Type> template()
        Description copied from class: Item
        Returns the template to build the target entity.

        This method should ultimately be used to provide the final entity template. Although, it may also provide a partial template that subclassed may complement.

        Overrides:
        template in class Item<User.Type>
        Returns:
        the matching entity template