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

Make possible for apps to define their own avatar types #24579

Closed

Commits on Dec 7, 2020

  1. Make possible to send requests as anonymous users in integration tests

    Until now requests always had "auth" headers either for an admin or a
    regular user, depending on the value of "currentUser". Now, if
    "currentUser" starts by "anonymous" no "auth" header is sent, which
    makes possible to also test requests with users not logged in.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    b553b43 View commit details
    Browse the repository at this point in the history
  2. Make possible to set body in requesttoken requests in integration tests

    "sendingAToWithRequesttoken" needs to be used to test some non OCS
    endpoints which require the request token to be sent in the request. Now
    it is possible to specify the body (or, rather, additional contents
    beside the cookies and the request token) for those requests, as it will
    be needed for example to upload an avatar.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    184742e View commit details
    Browse the repository at this point in the history
  3. Add integration tests for user avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    2cc22a0 View commit details
    Browse the repository at this point in the history
  4. Add integration tests for resized user avatars

    Even on solid color images the resizing can cause some small artifacts
    that slightly modify the color of certain pixels. Due to this now the
    color comparison is no longer strict but fuzzy.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    1552add View commit details
    Browse the repository at this point in the history
  5. Add integration tests for getting guest avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    b4b3276 View commit details
    Browse the repository at this point in the history
  6. Add getter for generic avatars to IAvatarManager

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    1de8dc3 View commit details
    Browse the repository at this point in the history
  7. Add OCS endpoint for avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    bcce5a6 View commit details
    Browse the repository at this point in the history
  8. Make possible to set body in OCS requests in integration tests

    "sendingToWith" is used to test OCS endpoints. Now it is possible to
    specify the body (or, rather, additional contents beside the cookies and
    the request token) for those requests, as it will be needed for example
    to upload an avatar.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    2522439 View commit details
    Browse the repository at this point in the history
  9. Add integration tests for getting and setting generic avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    b190431 View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2020

  1. fixup! Add OCS endpoint for avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 10, 2020
    Configuration menu
    Copy the full SHA
    63cbd7b View commit details
    Browse the repository at this point in the history
  2. fixup! Add OCS endpoint for avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 10, 2020
    Configuration menu
    Copy the full SHA
    a31a7fd View commit details
    Browse the repository at this point in the history
  3. Make possible to define custom avatar types

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 10, 2020
    Configuration menu
    Copy the full SHA
    92c9fc0 View commit details
    Browse the repository at this point in the history
  4. fixup! Add OCS endpoint for avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 10, 2020
    Configuration menu
    Copy the full SHA
    a836608 View commit details
    Browse the repository at this point in the history
  5. Move registration of IAvatarProviders to IRegistrationContext

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 10, 2020
    Configuration menu
    Copy the full SHA
    95e0177 View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2020

  1. fixup! Make possible to define custom avatar types

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    f04a16a View commit details
    Browse the repository at this point in the history
  2. fixup! Add OCS endpoint for avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    ebf242a View commit details
    Browse the repository at this point in the history
  3. fixup! Add getter for generic avatars to IAvatarManager

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    bf9169e View commit details
    Browse the repository at this point in the history
  4. fixup! Make possible to define custom avatar types

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    1e13309 View commit details
    Browse the repository at this point in the history
  5. fixup! Add OCS endpoint for avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    6e43ce7 View commit details
    Browse the repository at this point in the history
  6. fixup! Make possible to define custom avatar types

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    90ac35d View commit details
    Browse the repository at this point in the history
  7. fixup! Move registration of IAvatarProviders to IRegistrationContext

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    5d0102e View commit details
    Browse the repository at this point in the history
  8. fixup! Move registration of IAvatarProviders to IRegistrationContext

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    ab910ec View commit details
    Browse the repository at this point in the history
  9. fixup! Make possible to define custom avatar types

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    a2c63ff View commit details
    Browse the repository at this point in the history
  10. Move deprecated ILogger to LoggerInterface in avatar private classes

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    76e4bd2 View commit details
    Browse the repository at this point in the history
  11. Add explicit providers for user and guest avatars

    User and guest avatars were treated as built-in types and handled
    directly by the AvatarManager. Now a provider is introduced for each
    type, so they are handled like any generic avatar type.
    
    The AvatarManagerTest only tested getting user avatars, so the unit test
    was renamed and adjusted to test the UserAvatarProvider instead.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    612dbe6 View commit details
    Browse the repository at this point in the history
  12. Remove no longer needed attributes from AvatarManager

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    0e953eb View commit details
    Browse the repository at this point in the history
  13. Get the avatar provider rather than the avatar itself from the manager

    This will make possible to use other future IAvatarProvider methods.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    0bb311f View commit details
    Browse the repository at this point in the history
  14. Add method to get the cache duration of an avatar to IAvatarProvider

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    611881b View commit details
    Browse the repository at this point in the history
  15. fixup! Add method to get the cache duration of an avatar to IAvatarPr…

    …ovider
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    6c99a9a View commit details
    Browse the repository at this point in the history

Commits on Dec 15, 2020

  1. fixup! Add explicit providers for user and guest avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    6079793 View commit details
    Browse the repository at this point in the history
  2. fixup! Move registration of IAvatarProviders to IRegistrationContext

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    bcd2074 View commit details
    Browse the repository at this point in the history
  3. fixup! Get the avatar provider rather than the avatar itself from the…

    … manager
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    23f4c1d View commit details
    Browse the repository at this point in the history
  4. fixup! Make possible to define custom avatar types

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    e88d3b6 View commit details
    Browse the repository at this point in the history
  5. fixup! Add explicit providers for user and guest avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    4a26943 View commit details
    Browse the repository at this point in the history
  6. fixup! Add explicit providers for user and guest avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    fa0342a View commit details
    Browse the repository at this point in the history
  7. fixup! Get the avatar provider rather than the avatar itself from the…

    … manager
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    ebc3f14 View commit details
    Browse the repository at this point in the history
  8. fixup! Add integration tests for getting and setting generic avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    03eed3e View commit details
    Browse the repository at this point in the history
  9. fixup! Add integration tests for getting and setting generic avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    1348cab View commit details
    Browse the repository at this point in the history
  10. fixup! Add OCS endpoint for avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    8d69a4e View commit details
    Browse the repository at this point in the history
  11. fixup! Make possible to define custom avatar types

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    4368ec0 View commit details
    Browse the repository at this point in the history
  12. fixup! Add integration tests for getting and setting generic avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    6b8f290 View commit details
    Browse the repository at this point in the history

Commits on Dec 16, 2020

  1. fixup! Add method to get the cache duration of an avatar to IAvatarPr…

    …ovider
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    68b298e View commit details
    Browse the repository at this point in the history
  2. Split try/catch blocks to catch only the relevant exceptions

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    cc7cd18 View commit details
    Browse the repository at this point in the history
  3. Add method to check if an avatar can be accessed by the current user

    IAvatarProvider implementers now need to define whether the current user
    can access or not a given IAvatar (created by the provider itself). With
    this the GenericAvatarController can allow or deny access to avatars in
    a generic way.
    
    The controller returns STATUS_NOT_FOUND instead of STATUS_FORBIDDEN to
    prevent revealing to unauthorized users the existence of an element with
    the given id.
    
    Adding the method to IAvatarProvider prevents touching IAvatar, which
    might require changes in apps, and also keeps the access control logic
    separate from the avatar logic, which is more focused on handling of
    files and images.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    6ed5fde View commit details
    Browse the repository at this point in the history
  4. Add method to check if an avatar can be modified by the current user

    IAvatarProvider implementers now need to define whether the current user
    can modify or not a given IAvatar (created by the provider itself). With
    this the GenericAvatarController can allow or deny modification
    (including deletion) of avatars in a generic way.
    
    The controller returns STATUS_NOT_FOUND instead of STATUS_FORBIDDEN to
    prevent revealing to unauthorized users the existence of an element with
    the given id.
    
    Adding the method to IAvatarProvider prevents touching IAvatar, which
    might require changes in apps, and also keeps the access control logic
    separate from the avatar logic, which is more focused on handling of
    files and images.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    65c8c22 View commit details
    Browse the repository at this point in the history
  5. Add integration tests for unauthorized modification of avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    135d14b View commit details
    Browse the repository at this point in the history
  6. Add method to get the version of an avatar

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    330fac8 View commit details
    Browse the repository at this point in the history
  7. Limit the returned sizes of the avatars to a predefined set

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    68fa045 View commit details
    Browse the repository at this point in the history
  8. fixup! Get the avatar provider rather than the avatar itself from the…

    … manager
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    601d741 View commit details
    Browse the repository at this point in the history
  9. fixup! Add explicit providers for user and guest avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    6391a2b View commit details
    Browse the repository at this point in the history
  10. fixup! Add method to check if an avatar can be modified by the curren…

    …t user
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    029d22c View commit details
    Browse the repository at this point in the history
  11. fixup! Add explicit providers for user and guest avatars

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    3a4b926 View commit details
    Browse the repository at this point in the history
  12. fixup! Make possible to define custom avatar types

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    6895199 View commit details
    Browse the repository at this point in the history