Move auth_redirects ECA to its own recipe, or create a drupal_cms_eca recipe

Created on 4 October 2024, about 2 months ago

Problem/Motivation

In ๐Ÿ“Œ Create recipe for certain technical redirects with ECA Active , and ECA that added a best practices style redirect solution into the Base Recipe. This sets precedent for adding redirect solutions to Drupal without code. It is shareable, and repeatable, and could be used on a Drupal site.

But it is in the base recipe, and the only way to reuse it on an existing site would be to copy and paste. Could this be moved into it's own recipe, or in a drupal_cms_eca recipe so existing sites could use this best practice.

My vote would be for it's own recipe, as I assume there will be some ECAs added to drupal_cms that will be drupal_cms specific. But this and the drupal_cms_โ€Žclone_entityโ€Ž recipe being worked on in ๐Ÿ“Œ Create recipe to clone entities with ECA Active could be used by the great Drupal community.

Proposed resolution

Move the code in https://git.drupalcode.org/project/drupal_cms/-/merge_requests/112/diffs into a drupal_cms_eca_auth_redirects recipe.

Remaining tasks

Get approval.

User interface changes

API changes

Data model changes

โœจ Feature request
Status

Active

Component

Base Recipe

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @thejimbirch
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    No technical objections but I would like buy-in from Pam before we do this refactoring.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany jurgenhaas Gottmadingen

    Sounds like a reasonable proposal to me, wouldn't be a big deal either.

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia pameeela

    This seems fine, I think it needs to be updated though now that we are removing the dashboard redirect.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany jurgenhaas Gottmadingen

    I'll take this on.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    In principle this seems okay but I'm a little conflicted that it should be its own recipe. It's a very small piece of the overall Drupal CMS puzzle, and frankly these redirects are things that should be fixed in core anyway. Adding more recipes increases complexity and maintenance burden, albeit not by much...but it adds up.

    Is there any chance we could hold off on this until after release, and split out this feature into its own recipe if there is demand for that?

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany jurgenhaas Gottmadingen

    I'm holding back on this. I just can see the point from @thejimbirch that the recipe would be interesting also outside of Drupal CMS. For that, I can offer to make a copy of that recipe available stand-alone, if that helps?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States thejimbirch Cape Cod, Massachusetts

    In principle this seems okay but I'm a little conflicted that it should be its own recipe. It's a very small piece of the overall Drupal CMS puzzle, and frankly these redirects are things that should be fixed in core anyway. Adding more recipes increases complexity and maintenance burden, albeit not by much...but it adds up.

    It is a very small piece of the Drupal CMS, but one that provides a foundation and example for using ECA instead of custom code or more contributed modules that needs to be maintained.

    It indeed adds some maintenance burden for Drupal CMS , but I worry that that line of thinking will make the base Drupal CMS recipe too opinionated. The fact that ECA's are saved as config entities make them shareable and repeatable. Allowing this small piece of functionality to be its own package would benefit and lower the maintenance cost for the community with being able to require and use instead of copying and pasting.

    In the Recipe Author Guide's Guidelines for interoperable recipes it is recommended to

    Put reusable config in its own recipe.

    As a rule, where a config entity is applicable to many different use
    cases, it should go in its own recipe....

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    As per the brief proposal and discussion in #3482188-2: Simplify 403 redirecting by setting /user/login as the 403 page โ†’ , let's go ahead with this. Please call the new recipe drupal_cms_authentication, since we'll add other stuff to it that makes the authentication experience better.

    To prove that point, let's also move the dependency on login_emailusername into this new recipe as well.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts
  • Pipeline finished with Success
    27 days ago
    Total: 825s
    #320402
  • Pipeline finished with Failed
    27 days ago
    Total: 688s
    #320437
  • Pipeline finished with Failed
    27 days ago
    Total: 800s
    #320438
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany jurgenhaas Gottmadingen

    The MR contains these changes:

    • Move the ECA authentication into its own recipe
    • Use Drupal core's mechanism for 403 redirect handling
    • Also move the login by email module into that new recipe

    The ECA model got cleaned up, and it now only contains the redirect after logout. I wonder, should we keep the redirect after login to the dashboard in there as well? It doesn't hurt, since the hard-coded redirect from the dashboard module overrides that anyway. But for those who use this recipe elsewhere, it might be a helpful component.

    The 403 redirect test had to be changed, as core manages this such that the url still contains /admin and not /user/login, although we're obviously on the login page. I've changed the assertion such that it checks for the "Log in" button.

  • Pipeline finished with Failed
    27 days ago
    Total: 815s
    #320464
  • Pipeline finished with Failed
    27 days ago
    Total: 942s
    #320465
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany jurgenhaas Gottmadingen

    The failing test is about the anti spam recipe not being available, and I wonder if that should be a dependency here, too? If not, we need to remove its permissions from the test.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    Seems pretty solid - just needs a little more fine-tuning.

  • Pipeline finished with Failed
    23 days ago
    Total: 74s
    #323862
  • Pipeline finished with Failed
    23 days ago
    Total: 76s
    #323863
  • Pipeline finished with Canceled
    23 days ago
    Total: 61s
    #323867
  • Pipeline finished with Canceled
    23 days ago
    Total: 62s
    #323868
  • Pipeline finished with Canceled
    23 days ago
    Total: 62s
    #323869
  • Pipeline finished with Canceled
    23 days ago
    Total: 65s
    #323870
  • Pipeline finished with Failed
    23 days ago
    Total: 62s
    #323871
  • Pipeline finished with Failed
    23 days ago
    Total: 62s
    #323872
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany jurgenhaas Gottmadingen

    I've rebased this MR and adopted all suggested changes except for one. I couldn't find the right methods on how to test for the response code or the form_id. @phenaproxima could you either give me a hint or add those directly? It's the only thread left in the MR, all others are resolved.

  • Pipeline finished with Failed
    23 days ago
    Total: 504s
    #323881
  • Pipeline finished with Failed
    23 days ago
    Total: 504s
    #323882
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    Okay, left a few hints on the MR. :)

    Please also add drupal_cms_authentication to the job matrix in .gitlab-ci.yml's "run PHP tests" job. Otherwise the test won't run!

  • Pipeline finished with Canceled
    21 days ago
    Total: 64s
    #325763
  • Pipeline finished with Canceled
    21 days ago
    Total: 65s
    #325764
  • Pipeline finished with Canceled
    21 days ago
    Total: 164s
    #325795
  • Pipeline finished with Success
    21 days ago
    Total: 502s
    #325796
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany jurgenhaas Gottmadingen

    Completed all feedback threads and tests are all green.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    Only one complaint here, which is that WebDriverWebAssert makes no sense in the context of this test.

    Otherwise I think this is good to go.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany jurgenhaas Gottmadingen

    Resolved those remaining threads.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    Not quite...

  • Pipeline finished with Failed
    21 days ago
    Total: 640s
    #325913
  • Pipeline finished with Failed
    21 days ago
    Total: 654s
    #325912
  • Pipeline finished with Failed
    21 days ago
    Total: 618s
    #325917
  • Pipeline finished with Failed
    21 days ago
    Total: 634s
    #325918
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    Oh, one more thing - please add this new recipe to the PHPUnit job matrix in .gitlab-ci.yml.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany jurgenhaas Gottmadingen

    Add recipe to matrix.

  • Pipeline finished with Canceled
    21 days ago
    Total: 124s
    #325932
  • Pipeline finished with Failed
    21 days ago
    Total: 599s
    #325933
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany jurgenhaas Gottmadingen

    As the recipe gets tested in isolation, the antispam modules are not loaded and hence we can't remove their permissions. Have removed that from the tests.

  • Pipeline finished with Canceled
    21 days ago
    Total: 171s
    #325947
  • Pipeline finished with Canceled
    21 days ago
    Total: 187s
    #325946
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    That makes sense to me. ๐Ÿ‘

  • Pipeline finished with Failed
    21 days ago
    Total: 687s
    #325951
  • Pipeline finished with Canceled
    21 days ago
    Total: 177s
    #326001
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    Happy with this; merging on green.

  • Pipeline finished with Failed
    21 days ago
    Total: 733s
    #326008
  • Pipeline finished with Skipped
    21 days ago
    #326026
  • Pipeline finished with Skipped
    21 days ago
    #326027
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    Merged into 0.x. This is a good idea - the better we can make the login experience, the better everyone off will be since this is a shareable and reusable component.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024