simplesamlphp-module-drupalauth icon indicating copy to clipboard operation
simplesamlphp-module-drupalauth copied to clipboard

Alter attributes event - Reroll of pull/95

Open stesi561 opened this issue 6 months ago • 3 comments

Adds SetAttributesEvent Event that happens after attributes are created. This allows us to update the attributes in a Drupal Module by subscribing to this event.

Also changes two methods in the Drupal Helper from protected to public so they can be used via the Event Subscriber.

Reroll required due to 6ad28dda12a6f3b978eaefd7ff8ad1ab77f8d8bd which also adds Aliases/Imports in a way that prevents an automatic merge.

stesi561 avatar Jul 17 '25 21:07 stesi561

I'm guessing to merge you will probably want some test coverage included of this new functionality?

I'm not sure if @j4-m is still interested in this work.

We have a couple of clients using this functionality so I'm definitely keen to get merged. I can potentially look at adding some test coverage if required.

Potentially we could also think about the behaviour of the Event - should we be able to remove attributes or just alter and add new ones.

Currently the Event Subscriber can remove attributes. I'm not sure if this is desirable behaviour? Perhaps instead of returning the attributes as set on the event after it returns from dispatch we should merge in the attributes returned?

stesi561 avatar Jul 17 '25 21:07 stesi561

Hmm. Interesting we now fail. Strange.

I think will need to dig into this more.

stesi561 avatar Jul 17 '25 21:07 stesi561