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

SSP-2066_add_routes_and_controllers #45

Open
wants to merge 48 commits into
base: master
Choose a base branch
from

Conversation

ioigoume
Copy link
Contributor

@ioigoume ioigoume commented Nov 19, 2024

Closes #26

@ioigoume ioigoume marked this pull request as draft November 19, 2024 18:08
@tvdijen tvdijen force-pushed the SSP-2066_add_routes_and_controllers branch from d8d4fc7 to f5170a1 Compare November 20, 2024 15:50
@tvdijen tvdijen force-pushed the SSP-2066_add_routes_and_controllers branch from f5170a1 to 5b93932 Compare November 20, 2024 15:52
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 90.39548% with 51 lines in your changes missing coverage. Please review.

Project coverage is 67.86%. Comparing base (2b946a9) to head (416f2b1).
Report is 82 commits behind head on master.

Additional details and impacted files
@@              Coverage Diff              @@
##             master      #45       +/-   ##
=============================================
+ Coverage     41.43%   67.86%   +26.42%     
- Complexity      204      340      +136     
=============================================
  Files            14       26       +12     
  Lines           654     1229      +575     
=============================================
+ Hits            271      834      +563     
- Misses          383      395       +12     

@ioigoume ioigoume marked this pull request as ready for review December 2, 2024 17:05
@ioigoume ioigoume requested a review from pradtke December 15, 2024 08:35
Copy link
Collaborator

@pradtke pradtke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ioigoume for all the work on this major update and improvement. I did some QA but have not yet read through the code changes. Most things worked great. I ran into the below issues

  1. Overriding the CAS configuration for a specific service url did not work for me. See

    for an example of how that looks in the config. My expectation is that I would be able to adjust various settings (such as attrname, attributes_to_transfer , and authproc) for each CAS service url. That wasn't working for me.

  2. I couldn't get the Cas1 validate to work. It would always return no and have this error casserver:validate: internal server error. Missing user name attribute: 'uid'

  3. I think this is a pre-existing issue. Basically HttpUtils changes the service url in ways that can be unexpected by the CAS client. For example if the service url was https%3A%2F%2Flocalhost%2Fexample%3Fval%3Db%26val%3Dc which has a query parameter ?val=a&val=b then SSP is dropping one of the those values. There are other similar issues with '+' and a couple other ambiguous parts of url spec. I think we can look at this in a separate PR (I think Option to redirect to exact service url #25 was my previous workaround).

  4. Spurious 'Header already sent' error in logs. If I do something like not send a ticket param to validate, I get the expected CAS error, but in the logs I also see ERR [TRdeaf66cb] Error creating session: Headers already sent..

I'll look through the code and unit tests during my next free block.

src/Http/XmlResponse.php Outdated Show resolved Hide resolved
@ioigoume ioigoume requested a review from tvdijen December 19, 2024 13:56
Copy link
Collaborator

@pradtke pradtke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ioigoume . I did a read through of the code. I've added some comments for things.

I think the main issue is that the per service CAS configs are not being used in Cas20Controller since it instantiates all the objects before the service url is resolved. I think that also means the test coverage for per service urls is not working. For us the things that change per service url are the attrname, attributes to transfer and authprocs.

Secondary would be proxy validate doesn't seem like it doesn't work. I think it is hard to know what working looks like (it probably won't be till the new year that I have a real world example)

Last bit is deciding if returning null from a controller to make tests work is good or to use RunnableResponse. @tvdijen I wonder what your thoughts are on RunnableResponse - is that something you recommend we use to wrap SSP calls (like http urils or authsource->logout()) that won't return? or stick with using mocks on those and have the controller return 'null'?

src/Controller/Cas10Controller.php Outdated Show resolved Hide resolved
src/Controller/Cas20Controller.php Outdated Show resolved Hide resolved
src/Controller/Cas20Controller.php Outdated Show resolved Hide resolved
src/Controller/Cas30Controller.php Outdated Show resolved Hide resolved
src/Controller/LogoutController.php Outdated Show resolved Hide resolved
src/Controller/Traits/UrlTrait.php Outdated Show resolved Hide resolved
src/Controller/Traits/UrlTrait.php Outdated Show resolved Hide resolved
src/Controller/LoginController.php Show resolved Hide resolved
src/Controller/LoginController.php Outdated Show resolved Hide resolved
tests/src/Controller/Cas20ControllerTest.php Outdated Show resolved Hide resolved
@tvdijen
Copy link
Member

tvdijen commented Dec 24, 2024

I think the RunnableResponse is the right way @pradtke, because in the future our utilities will return a response-object .. This will also make it easier to find these cases once that happens.

@tvdijen tvdijen mentioned this pull request Jan 8, 2025
@ioigoume ioigoume requested a review from pradtke January 9, 2025 15:54
composer.json Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce Controller-classes to replace old www-dir
3 participants