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

Alter Valve to send roles via Http header #14

Merged
merged 1 commit into from
Dec 18, 2018

Conversation

whikloj
Copy link
Member

@whikloj whikloj commented Dec 12, 2018

GitHub Issue: Islandora/documentation#966

What does this Pull Request do?

It moves all Drupal roles into a Http header that is passed to Fedora using its HeaderProvider.

It assigns a single role of fedoraUser or fedoraAdmin based on whether any of the current user roles match fedoraAdmin. Perhaps this should be made configurable in future.

Also when we reverted the SynFilter PR, we reverted the change to accept the standard JWT claims. So I have re-added those changes here.

Lastly we were parsing the syn-settings.xml file 3 times, I changed the code to accept a Config object. So we just parse once to get that object and pass it to get the various maps.

What's new?

  • Does this change require documentation to be updated? I added some info to the README, but more might be necessary
  • Does this change add any new dependencies? no
  • Does this change require any other modifications to be made to the repository (ie. Regeneration activity, etc.)? no
  • Could this change impact execution of existing code? no

How should this be tested?

See Islandora-Devops/islandora-playbook#86

Interested parties

@Islandora-CLAW/committers

@codecov
Copy link

codecov bot commented Dec 12, 2018

Codecov Report

Merging #14 into master will increase coverage by 3.13%.
The diff coverage is 92.98%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #14      +/-   ##
============================================
+ Coverage     86.11%   89.25%   +3.13%     
- Complexity      116      123       +7     
============================================
  Files             6        6              
  Lines           353      363      +10     
  Branches         65       61       -4     
============================================
+ Hits            304      324      +20     
+ Misses           24       19       -5     
+ Partials         25       20       -5
Impacted Files Coverage Δ Complexity Δ
src/main/java/ca/islandora/syn/token/Verifier.java 100% <100%> (+31.25%) 10 <3> (+1) ⬆️
...rc/main/java/ca/islandora/syn/settings/Config.java 100% <100%> (ø) 9 <2> (+2) ⬆️
...java/ca/islandora/syn/settings/SettingsParser.java 81.57% <50%> (-0.36%) 50 <0> (ø)
src/main/java/ca/islandora/syn/valve/SynValve.java 91.8% <97.05%> (+1.06%) 32 <9> (+4) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c3fd5ac...c8a3adf. Read the comment docs.

@dannylamb
Copy link
Contributor

@whikloj Just spun up a fresh vagrant and am testing now.

Copy link
Contributor

@dannylamb dannylamb left a comment

Choose a reason for hiding this comment

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

Tested as part of Islandora-Devops/islandora-playbook#86. Working as expected

@dannylamb dannylamb merged commit 81503ab into Islandora:master Dec 18, 2018
@whikloj whikloj deleted the issue-966 branch December 18, 2018 21:21
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.

2 participants