This repository was archived by the owner on Dec 20, 2025. It is now read-only.
Commit 381f554
authored
refactor(OAuth2): groovy to java conversion for OAuth module (#1871)
* refactor(OAuth2): groovy to java conversion for OAuth module
Validated and tested using google and github OAuth.
* Add specific imports and remove *
* Remove DefaultGroovyMethods
* Add StructuredArguments.entries
* Rename safeGet to toStringOrNull. toStringOrNull returns null when the input is null. Add javadoc
* Replace details.getOrDefault with Optional to handle null cases
* Add log statement from groovy code
* Use AssertJ
* First checks log.isDebugEnabled() to avoid unnecessary String concatenation
* Add non empty string check
* Add test for SpinnakerUserInfoTokenServices#isServiceAccount
* Refactor SpinnakerUserInfoTokenServices to use constructor injection
- Replaced member injection with constructor injection
- Improved encapsulation by removing direct member access
- Updated tests to pass dependencies via constructor
* Preserve method call verifications in tests
* Refactor to use constructor injection
- Removed annotations from individual members
- Added to the all-args constructor
- Removed no-arg constructor to enforce dependency injection
- Improved clarity and testability of the class
* Add specific imports and remove *
* Move SpinnakerProviderTokenServices to constructor argument and make it optional using Optional<SpinnakerProviderTokenServices>1 parent b0ee1b1 commit 381f554
File tree
16 files changed
+1022
-793
lines changed- gate-oauth2
- src
- main
- groovy/com/netflix/spinnaker/gate/security/oauth2
- provider
- java/com/netflix/spinnaker/gate/security/oauth2
- provider
- test
- groovy/com/netflix/spinnaker/gate/security/oauth2
- java/com/netflix/spinnaker/gate/security/oauth2
- gate-web/src/test
- groovy/com/netflix/spinnaker/gate/security/oauth2
- java/com/netflix/spinnaker/gate/security/oauth
16 files changed
+1022
-793
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
Lines changed: 0 additions & 73 deletions
This file was deleted.
Lines changed: 0 additions & 130 deletions
This file was deleted.
0 commit comments