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

Move OAuth2 Core Server Classes to UAA namespace #2813

Merged
merged 95 commits into from
May 8, 2024

Conversation

strehle
Copy link
Member

@strehle strehle commented Apr 3, 2024

  • Moved Endpoints for OAuth2 from library to UAA. Main OIDC endpoints are in UAA implemented, so changes needed.

  • Core-Beans for Server start. Entry point OAuth2SecurityNamespaceHandler.java, which supports XML key words in spring-servlet.xml. (moved to server)

  • Moved spring schema handlers to server - support usage of spring-servlet.xml

    • server/src/main/resources/META-INF/spring.handlers
    • server/src/main/resources/META-INF/spring.schemas
  • Client Token Creation, Main class OAuth2RestTemplate (moved to model)

  • Not Moved / OPEN. Client Annotation. UAA does not need it

Statistics

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/187364134

The labels on this github issue will be updated when the story is started.

@strehle strehle added this to the EOL_Removal milestone Apr 3, 2024
@strehle strehle linked an issue Apr 3, 2024 that may be closed by this pull request
@swalchemist swalchemist self-assigned this May 1, 2024
…auth2/core-server

# Conflicts:
#	server/src/test/java/org/cloudfoundry/identity/uaa/oauth/ClientAccessTokenValidityTest.java
#	server/src/test/java/org/cloudfoundry/identity/uaa/oauth/ClientRefreshTokenValidityTest.java
#	server/src/test/java/org/cloudfoundry/identity/uaa/oauth/TokenRevocationEndpointTests.java
#	server/src/test/java/org/cloudfoundry/identity/uaa/oauth/expression/IsSelfCheckTest.java
#	server/src/test/java/org/cloudfoundry/identity/uaa/zone/MultitenantJdbcClientDetailsServiceTests.java
#	uaa/src/test/java/org/cloudfoundry/identity/uaa/login/TokenEndpointDocs.java
#	uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockTests.java
@Tallicia
Copy link
Contributor

Tallicia commented May 2, 2024

@strehle I see the sonar link showing:
Failed Last analysis 23 hours ago 13.85%. Coverage: Required ≥ 80.0%
Is this still in progress?

@strehle
Copy link
Member Author

strehle commented May 2, 2024

Is this still in progress?

No it is ready. The issues are solved, the coverage needs tests but I have putted the forked tests into another PR, see
#2843 (comment)

-> PR 2848 is this PR plus tests
-> https://sonarcloud.io/summary/new_code?id=cloudfoundry-identity-parent&pullRequest=2848

Why: because then this PR would have even more changes

@Tallicia
Copy link
Contributor

Tallicia commented May 2, 2024

All existing tests are passing. ✅
want to run against new tests at strehle:eol/oauth2/core-server-plus-tests next

@Tallicia
Copy link
Contributor

Tallicia commented May 2, 2024

Tests from strehle:eol/oauth2/core-server-plus-tests passing. ✅ #2843
Screenshot 2024-05-02 at 12 54 34 PM

@Tallicia
Copy link
Contributor

Tallicia commented May 2, 2024

Making progress, about 1/3rd of the way through so far.

@Tallicia
Copy link
Contributor

Tallicia commented May 2, 2024

Approximately 2/3rd the way through (315 of 488 files).

So far everything is looking good with some comments and questions in the review.

I am out of time today, but expect I will have this completed tomorrow and ready for approval and merging. It looks like this and the PR with tests need to go together.
Screenshot 2024-05-02 at 4 53 09 PM

Copy link
Contributor

@Tallicia Tallicia left a comment

Choose a reason for hiding this comment

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

This is approved. There are some comments and questions I would appreciate some updates and responses on before merging if possible or shortly after.

@Tallicia Tallicia added in progress accepted Accepted the issue labels May 3, 2024
strehle and others added 6 commits May 4, 2024 10:36
* Move tests from spring-security-oauth2 into UAA

Test coverage should help to identity if we need the coding or not.
Coding, which is not covered should be checked in Unit and Integration Tests
and should be removed if not really used.

* More Tests

* Extended exception tests

* more tests for client grant flows

* More tests

* Added tests for XML configuration

* Added tests for InMemoryTokenStore

* More Tests

* Move tests for oauth2 authentication

* Tests for OAuth2 expression parser

* Token Endpoint Tests

* Exception handling tests

* More tests for new coding

* More tests

* More tests

* Test coverage

* Test coverage

* Add test for InMemory code service.

Used in tests

* Refactor tests

* Add client scopes for test fix

* Add test

* Fix test Coverage

* Fix test

* Test added

* Test coverage

* Test coverage
…auth2/core-server

# Conflicts:
#	server/src/test/java/org/cloudfoundry/identity/uaa/scim/jdbc/JdbcScimGroupExternalMembershipManagerTests.java
#	server/src/test/java/org/cloudfoundry/identity/uaa/scim/jdbc/JdbcScimGroupProvisioningTests.java
Used intellij which offers this in extras
@strehle
Copy link
Member Author

strehle commented May 7, 2024

@Tallicia I hope I have done all comments... / questions. If you have open questions , things I do not have answered, please let me know

@strehle strehle requested a review from Tallicia May 7, 2024 16:25
commons-codec is used / needed in uaa.war, so it comes because of different dependencies
Thought before we dont need it, therefore removed the CHUCK SIZE constant.

Revert JsonWebKey changes
this ID was used before and changed accidentially
@strehle
Copy link
Member Author

strehle commented May 8, 2024

Statistics:

Moved ca. 170 classes from https://github.com/spring-attic/spring-security-oauth/tree/main/spring-security-oauth2 to UAA
into model and server sub projects.

Moved ca. 70 tests from https://github.com/spring-attic/spring-security-oauth/tree/main/spring-security-oauth2 into UAA

Did code cleanup based on CodeQL and Sonar findings.

Refactored existing UAA forks , e.g. Token Endpoints

uaa.war now includes 134 external libraries (before 136)
uaa.war now has 61 MB (before 64 MB)

Summary. UAA now has all code to run as OAuth2/OIDC Server in this project, so that further refactoring can be done,
e.g.

@strehle strehle merged commit 5a7a4ef into develop May 8, 2024
20 checks passed
@strehle strehle deleted the eol/oauth2/core-server branch May 8, 2024 08:34
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.

Spring Security Oauth2 End of Life
4 participants