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

Initial implementation changes for Jakarta Authorization 3.0 #29402

Merged
merged 4 commits into from
Aug 28, 2024

Conversation

jhanders34
Copy link
Member

@jhanders34 jhanders34 commented Aug 15, 2024

Jakarta Authorization 3.0 updates to no longer use java.security.Policy. Now they introduced a jakarta.security.jacc.Policy object since java.security.Policy has been deprecated with the deprecation of Java SecurityManager. From an IBM API perspective ProviderService no longer will return a java.security.Policy and is updated with a new version of the API for Jakarta Authorization 3.0.

The changes in this PR handle this change by adding interfaces to proxy the Policy and ProviderService object since they are different between JACC / Authorization 1.0, 2.0 and 2.1 and Authorization 3.0. Additionally a new project is created for API because cannot easily transform for the ProviderService API changes. The changes were done this way to allow for most code to remain common.

Add abstraction to 1.5, 2.0 and 2.1 JACC implementation

  • Abstract java.security.Policy references by adding and using a PolicyProxy interface
  • Abstract com.ibm.wsspi.security.authorization.jacc.ProviderService by adding and using a ProviderServiceProxy interface
  • Add new bundles for ProviderService and PolicyProxy and ProviderServiceProxy implementations
  • Update feature files to reference new bundles

Add Jakarta Authorization 3.0 implementation

  • Add new extension API bundle for updated ProviderService interface to return Authorization Policy instead of java.security.Policy
  • Add bundle with PolicyProxy and ProviderServiceProxy implementations for 3.0
  • Update feature file to reference new extension API and implementation bundle
  • Update transformation rules for new version of extension API

Update test and sample jacc providers

  • Update 2.1 test jacc provider feature file to not tolerate 3.0
  • Add new 3.0 test jacc provider

Update Jakarta Authorization FATs to have EE 11 repeats

  • Add EE 11 repeats and update FAT logic to use the new 3.0 test provider

For #25420

@jhanders34
Copy link
Member Author

#build

@LibbyBot
Copy link

Please code review feature-related files, @OpenLiberty/delivery-approvers

@LibbyBot
Copy link

Your personal pipeline request is at https://libh-proxy1.fyre.ibm.com/cognitive/pipelineAnalysis.html?uuid=63cc94e6-1a85-44ae-a4b3-7b3bb53f2482

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

Your personal build request is at https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_XKXWQFq0Ee-nla_L9rYqvA

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

@LibbyBot
Copy link

The build jhanders34-29402-20240814-2122
https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_XKXWQFq0Ee-nla_L9rYqvA
completed and has errors or failures.

For help analyzing your personal build, go to https://libh-proxy1.fyre.ibm.com/cognitive/buildAnalysis.html?uuid=_XKXWQFq0Ee-nla_L9rYqvA

@jhanders34
Copy link
Member Author

#libby #build

@jhanders34
Copy link
Member Author

!pbbeta

@LibbyBot
Copy link

Your personal pipeline request is at https://libh-proxy1.fyre.ibm.com/cognitive/pipelineAnalysis.html?uuid=fe73e6c2-0e8c-46bb-bd1e-a084f872f75a

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

Your personal pipeline request is at https://libh-proxy1.fyre.ibm.com/cognitive/pipelineAnalysis.html?uuid=20bd7273-e016-49d4-be63-8bc5450be05c

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

Your personal pipeline request is at https://libh-proxy1.fyre.ibm.com/cognitive/pipelineAnalysis.html?uuid=d56777b6-4253-403f-828d-bb4ffe59636e

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

@LibbyBot
Copy link

@LibbyBot
Copy link

@jhanders34
Copy link
Member Author

!pbbeta
git.clone.checkout.branch=branch3
git.clone.repository.username=jhanders

@LibbyBot
Copy link

Your personal pipeline request is at https://libh-proxy1.fyre.ibm.com/cognitive/pipelineAnalysis.html?uuid=6e999583-d5f0-4dee-89ce-9d467556eaab

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

The build jhanders34-29402-20240815-1635
https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_Olaz4FsbEe-nla_L9rYqvA
completed and has errors or failures.

For help analyzing your personal build, go to https://libh-proxy1.fyre.ibm.com/cognitive/buildAnalysis.html?uuid=_Olaz4FsbEe-nla_L9rYqvA

@jhanders34
Copy link
Member Author

!pbbeta
git.clone.checkout.branch=branch3
git.clone.repository.username=jhanders

@LibbyBot
Copy link

Your personal pipeline request is at https://libh-proxy1.fyre.ibm.com/cognitive/pipelineAnalysis.html?uuid=e5793d2a-b953-45b4-a7be-3a0aa34fb5ab

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

@LibbyBot
Copy link

The build jhanders34-29402-20240815-2318
https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_R-HTkFtTEe-nla_L9rYqvA
completed and has errors or failures.

For help analyzing your personal build, go to https://libh-proxy1.fyre.ibm.com/cognitive/buildAnalysis.html?uuid=_R-HTkFtTEe-nla_L9rYqvA

@jhanders34
Copy link
Member Author

!pbbeta
git.clone.checkout.branch=branch3
git.clone.repository.username=jhanders

@LibbyBot
Copy link

Your personal pipeline request is at https://libh-proxy1.fyre.ibm.com/cognitive/pipelineAnalysis.html?uuid=0c0d44b3-8f0e-444b-a1c5-76edc1b8ecf3

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

@LibbyBot
Copy link

The build jhanders34-29402-20240816-0304
https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_DqOwsFtzEe-nla_L9rYqvA
completed and has errors or failures.

For help analyzing your personal build, go to https://libh-proxy1.fyre.ibm.com/cognitive/buildAnalysis.html?uuid=_DqOwsFtzEe-nla_L9rYqvA

@LibbyBot
Copy link

ayoho
ayoho previously approved these changes Aug 20, 2024
Bundle-Name: WAS Security JACC 1.5 Service
Bundle-SymbolicName: com.ibm.ws.security.authorization.jacc
Bundle-Name: WAS Security JACC Service
Bundle-SymbolicName: com.ibm.ws.security.authorization.jacc.common
Copy link
Member

Choose a reason for hiding this comment

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

Noting that the BSN will no longer match the project name.

Copy link
Member Author

Choose a reason for hiding this comment

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

That is correct. The package name still starts the bundle name so it can still be found whereas the transformed.bnd, 1.5.bnd and 2.0.bnd bundle names do not start with the project name which is why they are included in the cnf/build.bnd and in the testpath for the ejb and web bundle to point to the project that those bundles are from.

Comment on lines +10 to +13
/**
* @version 20.0
*/
@org.osgi.annotation.versioning.Version("20.0")
Copy link
Member

Choose a reason for hiding this comment

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

I'm blanking - is there a specific reason for the version being 20.0?

Copy link
Member Author

Choose a reason for hiding this comment

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

The original version was 1.0 and then we made it 10.0 for Jakarta EE 9+. This allows for APIs to have additional version updates between 1.0 and 10.0. Similarly for EE 9+, you could still have new versions of the API package of 11.0, 12.0, etc until you reach 20. It isn't perfect, but it allows for these types of changes without causing to run into conflict issues with the API package versions.

Copy link
Member Author

Choose a reason for hiding this comment

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

#11497 (comment) in that issue gives some details about what we decided in that design issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

The other option is to start with a completely new API for Authorization 3.0. If we did such a thing, I would create one with io.openliberty package prefix.

- Abstract java.security.Policy references by adding and using a
PolicyProxy interface
- Abstract com.ibm.wsspi.security.authorization.jacc.ProviderService by
adding and using a ProviderServiceProxy interface
- Add new bundles for ProviderService and PolicyProxy and
ProviderServiceProxy implementations
- Update feature files to reference new bundles
- Add new extension API bundle for updated ProviderService interface to
return Authorization Policy instead of java.security.Policy
- Add bundle with PolicyProxy and ProviderServiceProxy implementations
for 3.0
- Update feature file to reference new extension API and implementation
bundle
- Update transformation rules for new version of extension API
- Update 2.1 test jacc provider feature file to not tolerate 3.0
- Add new 3.0 test jacc provider
- Add EE 11 repeats and update FAT logic to use the new 3.0 test
provider
@jhanders34
Copy link
Member Author

#libby #build

@LibbyBot
Copy link

Your personal pipeline request is at https://libh-proxy1.fyre.ibm.com/cognitive/pipelineAnalysis.html?uuid=79b9614e-f955-4190-b360-e93335773039

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

Please code review feature-related files, @OpenLiberty/delivery-approvers

@LibbyBot
Copy link

Your personal build request is at https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_JOMF4GDAEe-4wdAm7liz3w

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

Code analysis and actions

DO NOT DELETE THIS COMMENT.
  • 62 product code files were changed.

  • Please describe in a separate comment how you tested your changes.

  • 18 infrastructure code files were changed.

  • 19 FAT files were changed, added, or removed.

  • Check that the build did not break the affected FAT suite(s).

  • 14 NLS files were changed and need an ID review.

  • @OpenLiberty/message-reviewer Please review.

  • dev/com.ibm.ws.security.authorization.jacc.testprovider/resources/OSGI-INF/l10n/metatype_de.properties

  • dev/com.ibm.ws.security.authorization.jacc.testprovider/resources/OSGI-INF/l10n/metatype_pt_BR.properties

  • dev/com.ibm.ws.security.authorization.jacc.testprovider/resources/OSGI-INF/l10n/metatype_zh_TW.properties

  • dev/com.ibm.ws.security.authorization.jacc.testprovider/resources/OSGI-INF/l10n/metatype_ja.properties

  • dev/com.ibm.ws.security.authorization.jacc.testprovider/resources/OSGI-INF/l10n/metatype_cs.properties

  • dev/com.ibm.ws.security.authorization.jacc.testprovider/resources/OSGI-INF/l10n/metatype_pl.properties

  • dev/com.ibm.ws.security.authorization.jacc.testprovider/resources/OSGI-INF/l10n/metatype_ro.properties

  • dev/com.ibm.ws.security.authorization.jacc.testprovider/resources/OSGI-INF/l10n/metatype_fr.properties

  • dev/com.ibm.ws.security.authorization.jacc.testprovider/resources/OSGI-INF/l10n/metatype_hu.properties

  • dev/com.ibm.ws.security.authorization.jacc.testprovider/resources/OSGI-INF/l10n/metatype_ko.properties

  • dev/com.ibm.ws.security.authorization.jacc.testprovider/resources/OSGI-INF/l10n/metatype_ru.properties

  • dev/com.ibm.ws.security.authorization.jacc.testprovider/resources/OSGI-INF/l10n/metatype_zh.properties

  • dev/com.ibm.ws.security.authorization.jacc.testprovider/resources/OSGI-INF/l10n/metatype_it.properties

  • dev/com.ibm.ws.security.authorization.jacc.testprovider/resources/OSGI-INF/l10n/metatype_es.properties

@LibbyBot
Copy link

@LibbyBot
Copy link

The build jhanders34-29402-20240822-2058
https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_JOMF4GDAEe-4wdAm7liz3w
completed and has errors or failures.

For help analyzing your personal build, go to https://libh-proxy1.fyre.ibm.com/cognitive/buildAnalysis.html?uuid=_JOMF4GDAEe-4wdAm7liz3w

@jhanders34 jhanders34 merged commit a0e81af into OpenLiberty:integration Aug 28, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants