Skip to content
Snippets Groups Projects
  1. May 02, 2024
  2. Apr 30, 2024
    • Antoine Lambert's avatar
      admin: Ensure to not configure if swh.web.admin django app is disabled · c27d0c72
      Antoine Lambert authored
      It fixes issues with autodoc processing as this django application is
      disabled by default.
      c27d0c72
    • Antoine Lambert's avatar
      cypress/mailmap: Fix some wait conditions · 6ea2b482
      Antoine Lambert authored and Antoine Lambert's avatar Antoine Lambert committed
      6ea2b482
    • Antoine Lambert's avatar
      Add swh.web.admin django application wrapping django admin site · 05f90d17
      Antoine Lambert authored and Antoine Lambert's avatar Antoine Lambert committed
      Enable to use django administration site in swh-web by including "swh.web.admin"
      application in swh_extra_django_apps list from swh-web configuration.
      
      When enabled, the admin site is available through the new /manage/ endpoint.
      
      It allows an user to modify some django models of interest (adding, deleting or
      modifying rows) if he/she has adequate permissions to do so.
      
      Currently, only the add forge now request and save code now request models can
      be managed with the admin site through the use of the following permissions:
      
      - swh_web_add_forge_now.add_request
      - swh_web_add_forge_now.change_request
      - swh_web_add_forge_now.delete_request
      - swh_web_add_forge_now.view_request
      - swh_web_save_code_now.add_saveoriginrequest
      - swh_web_save_code_now.change_saveoriginrequest
      - swh_web_save_code_now.delete_saveoriginrequest
      - swh_web_save_code_now.view_saveoriginrequest
      
      When swh-web is using the default django authentication backend, the admin site
      also enables and administrator to manage user accounts and their permissions.
      
      When swh-web is using Keycloak as the authentication backend, the permissions
      listed above must be added as swh-web client roles and these roles can then be
      set for an user through the Keycloak admin console in order to use the features
      offered by the admin site.
      05f90d17
    • Antoine Lambert's avatar
      tests: Remove use of reset_sequences parameter of pytest.mark.django_db · 03ce950a
      Antoine Lambert authored
      It messes up with django permissions creation when using pytest-xdist.
      03ce950a
  3. Apr 29, 2024
    • Antoine Lambert's avatar
      auth: Add new migration to create webapp permissions in database · b06faa9d
      Antoine Lambert authored and Antoine Lambert's avatar Antoine Lambert committed
      Add a new migration file for the swh.web.auth django application enabling to
      persist webapp special permissions to database in order to be able to use them
      when the webapp relies of the default django authentication backend for login
      operations (mirror version of swh-web for instance that does not use Keycloak
      for authentication).
      
      The permissions can then be set for a particular user using the django admin
      views by a django user having the adequate permissions to modify user accounts.
      
      Some tests were modified as the reset_sequences parameter of django_db pytest
      mark cannot be used as it breaks persisted permissions.
      b06faa9d
  4. Apr 26, 2024
  5. Apr 24, 2024
  6. Apr 17, 2024
  7. Apr 16, 2024
    • Antoine Lambert's avatar
      browse/utils: Reinstate chardet use but only as a fallback · 38204c22
      Antoine Lambert authored
      While charset_normalizer performs usually better than chardet, it
      remains some edge cases where it can fail to detect content encoding
      while chardet succeeds.
      
      So try to detect content encoding with chardet as a fallback when
      charset_normalizer failed.
      38204c22
  8. Apr 12, 2024
  9. Apr 11, 2024
    • Antoine Lambert's avatar
      requirements: Turn beautifulsoup4 into a test dependency · 002b56dc
      Antoine Lambert authored
      It is now only used in the test suites so no need to keep it as
      a runtime dependency, also remove not required lxml dependency.
      002b56dc
    • Jérémy Bobbio (Lunar)'s avatar
      Remove HtmlPrettifyMiddleware (used in development mode) · ca9cf431
      Jérémy Bobbio (Lunar) authored
      HtmlPrettifyMiddleware uses the `prettify()` method from BeautifulSoup.
      Its documentation says:
      
      > Since it adds whitespace (in the form of newlines), `prettify()` changes
      > the meaning of an HTML document and should not be used to reformat one.
      > The goal of `prettify()` is to help you visually understand the structure
      > of the documents you work with.
      
      Having HtmlPrettifyMiddleware enabled therefore leads to surprising
      behavior, like extra spaces surrounding “something” when writing
      `<code>something</code>` in a template.
      
      Now that Django templates are prettified using `djlint`, this middleware
      only has downsides. Let’s remove it entirely.
      ca9cf431
    • Antoine Lambert's avatar
      browse: Add rate limit to content views to avoid abuses · 697a8a58
      Antoine Lambert authored
      It has been observed that some users are scraping the browse content
      views at a high rate by sending too many requests in a short amount
      of time.
      
      So add a rate limit of sixty requests per minute to content views to
      avoid such abuse by using the django-ratelimit package.
      
      Related to #4795.
      v0.4.1
      697a8a58
  10. Apr 10, 2024
  11. Apr 09, 2024
  12. Apr 02, 2024
  13. Mar 31, 2024
  14. Mar 29, 2024
Loading