Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.

Commit 381f554

Browse files
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

16 files changed

+1022
-793
lines changed

gate-oauth2/gate-oauth2.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ dependencies {
22
implementation project(":gate-core")
33
implementation "com.netflix.spectator:spectator-api"
44
implementation "io.spinnaker.fiat:fiat-api:$fiatVersion"
5+
implementation "io.spinnaker.fiat:fiat-core:$fiatVersion"
56
implementation "io.spinnaker.kork:kork-exceptions"
67
implementation "io.spinnaker.kork:kork-retrofit"
78
implementation "io.spinnaker.kork:kork-security"

gate-oauth2/src/main/groovy/com/netflix/spinnaker/gate/security/oauth2/ExternalAuthTokenFilter.groovy

Lines changed: 0 additions & 73 deletions
This file was deleted.

gate-oauth2/src/main/groovy/com/netflix/spinnaker/gate/security/oauth2/OAuth2SsoConfig.groovy

Lines changed: 0 additions & 130 deletions
This file was deleted.

0 commit comments

Comments
 (0)