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 Crayfish-Commons a Symfony bundle only. #49

Merged
merged 6 commits into from
May 5, 2022
Merged

Conversation

whikloj
Copy link
Member

@whikloj whikloj commented Nov 3, 2021

GitHub Issue: Islandora/documentation#1224

What does this Pull Request do?

Updates Crayfish-Commons to make it a Symfony 4.4 LTS bundle fully.

This PR goes along with an upcoming one for Crayfish that changes ALL the microservices to Symfony 4.4.

This PR moves the stuff that has been sitting in the symfony-flex branch (for Houdini) and makes it the actual Crayfish-Commons code as ALL microservices will be using symfony.

As this is not backwards compatible with Crayfish-Commons 2.0.0, this PR is against the new 3.x branch and will be the first commit of version 3.0.0

Once this PR and the Crayfish PR are merged, the branch symfony-flex can be deleted.

What's new?

  • Does this change require documentation to be updated? 🤷 there is no documentation for Crayfish-Commons right now, and I have not added any.
  • Does this change add any new dependencies? It removes and adds dependencies
  • Does this change require any other modifications to be made to the repository (i.e. Regeneration activity, etc.)? no
  • Could this change impact execution of existing code? It should not

How should this be tested?

This will need to be tested with the associated PR in Crayfish Islandora/Crayfish#133

Additional Notes:

Interested parties

@Islandora/8-x-committers

@adam-vessey
Copy link
Contributor

@whikloj : Just confirming, but this is superseding #28, correct? Should #28 be closed?

Copy link
Contributor

@adam-vessey adam-vessey left a comment

Choose a reason for hiding this comment

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

Seems pretty good... All fairly small things we could probably live with...

Syn/JwtAuthenticator.php Outdated Show resolved Hide resolved
Tests/ApixMiddlewareTest.php Outdated Show resolved Hide resolved
Syn/JwtAuthenticator.php Show resolved Hide resolved
Syn/JwtAuthenticator.php Outdated Show resolved Hide resolved
ApixMiddleware.php Outdated Show resolved Hide resolved
Tests/Syn/JwtAuthenticatorTest.php Show resolved Hide resolved
composer.json Show resolved Hide resolved
Copy link
Member

@ruebot ruebot left a comment

Choose a reason for hiding this comment

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

I've been using this in my dev/stage/prod builds for a few months now, and everything seems fine. Set it all up in conjunction with your Alpaca 2.0.0 work.

@whikloj whikloj mentioned this pull request May 5, 2022
@adam-vessey adam-vessey merged commit e7b8cbd into 3.x May 5, 2022
@rosiel rosiel deleted the issue-1224 branch July 22, 2022 14:14
Comment on lines -50 to +65
return new Response(
"Malformed request, no Apix-Ldp-Resource header present",
400
);
$this->log->debug("No Apix-Ldp-Resource header present, no fedora_resource set");
$request->attributes->set('fedora_resource', false);
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

In poking around and running tests, I found that the we broke the tests here, where it tests for the 400 error being emitted... easy enough fix just setting the response with something like:

diff --git a/ApixMiddleware.php b/ApixMiddleware.php
index b75df0a..5a29209 100644
--- a/ApixMiddleware.php
+++ b/ApixMiddleware.php
@@ -62,6 +62,10 @@ class ApixMiddleware implements EventSubscriberInterface
         if (!$request->headers->has("Apix-Ldp-Resource")) {
             $this->log->debug("No Apix-Ldp-Resource header present, no fedora_resource set");
             $request->attributes->set('fedora_resource', false);
+           $event->setResponse(new Response(
+                "Malformed request, no Apix-Ldp-Resource header present",
+                400
+            ));
             return;
         }

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking to address in #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants