diff --git a/core/cas-server-core-services/src/test/java/org/apereo/cas/services/RegisteredServiceTestUtils.java b/core/cas-server-core-services/src/test/java/org/apereo/cas/services/RegisteredServiceTestUtils.java index 89818cc61f80..a8dd4e379a37 100644 --- a/core/cas-server-core-services/src/test/java/org/apereo/cas/services/RegisteredServiceTestUtils.java +++ b/core/cas-server-core-services/src/test/java/org/apereo/cas/services/RegisteredServiceTestUtils.java @@ -3,6 +3,8 @@ import org.apereo.cas.CasProtocolConstants; import org.apereo.cas.authentication.AcceptUsersAuthenticationHandler; import org.apereo.cas.authentication.Authentication; +import org.apereo.cas.authentication.AuthenticationHandler; +import org.apereo.cas.authentication.Credential; import org.apereo.cas.authentication.DefaultAuthenticationBuilder; import org.apereo.cas.authentication.DefaultAuthenticationHandlerExecutionResult; import org.apereo.cas.authentication.credential.HttpBasedServiceCredential; diff --git a/settings.gradle b/settings.gradle index 81c348402c37..2cf77e76511b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -48,8 +48,6 @@ dependencyResolutionManagement { includeModule("org.nodejs", "node") } } - - mavenLocal() mavenCentral() maven { url "https://build.shibboleth.net/maven/snapshots" diff --git a/support/cas-server-support-openrewrite/recipes/META-INF/rewrite/cas7010.yml b/support/cas-server-support-openrewrite/recipes/META-INF/rewrite/cas7010.yml new file mode 100644 index 000000000000..9635968eac9b --- /dev/null +++ b/support/cas-server-support-openrewrite/recipes/META-INF/rewrite/cas7010.yml @@ -0,0 +1,43 @@ +--- +type: specs.openrewrite.org/v1beta/recipe +name: org.apereo.cas.cas7010 +displayName: Upgrade CAS to version 7.0.10 +recipeList: + - org.openrewrite.gradle.AddProperty: + key: cas.version + value: 7.0.10 + overwrite: true + filePattern: 'gradle.properties' + - org.openrewrite.gradle.AddProperty: + key: version + value: 7.0.10 + overwrite: true + filePattern: 'gradle.properties' + - org.openrewrite.gradle.AddProperty: + key: sourceCompatibility + value: 21 + overwrite: true + filePattern: 'gradle.properties' + - org.openrewrite.gradle.AddProperty: + key: targetCompatibility + value: 21 + overwrite: true + filePattern: 'gradle.properties' + - org.openrewrite.gradle.AddProperty: + key: springBootVersion + value: 3.2.1 + overwrite: true + filePattern: 'gradle.properties' + - org.openrewrite.gradle.UpdateGradleWrapper: + version: 8.5 + addIfMissing: true + - org.openrewrite.gradle.AddProperty: + key: tomcatVersion + value: 10.1.31 + overwrite: false + filePattern: 'gradle.properties' + - org.openrewrite.gradle.AddProperty: + key: jibVersion + value: 3.4.0 + overwrite: true + filePattern: 'gradle.properties' diff --git a/support/cas-server-support-surrogate-authentication/src/test/java/org/apereo/cas/ticket/SurrogateServiceTicketGeneratorAuthorityTests.java b/support/cas-server-support-surrogate-authentication/src/test/java/org/apereo/cas/ticket/SurrogateServiceTicketGeneratorAuthorityTests.java index 60be088f33b0..a5bbb61bac05 100644 --- a/support/cas-server-support-surrogate-authentication/src/test/java/org/apereo/cas/ticket/SurrogateServiceTicketGeneratorAuthorityTests.java +++ b/support/cas-server-support-surrogate-authentication/src/test/java/org/apereo/cas/ticket/SurrogateServiceTicketGeneratorAuthorityTests.java @@ -7,10 +7,9 @@ import org.apereo.cas.authentication.surrogate.BaseSurrogateAuthenticationServiceTests; import org.apereo.cas.authentication.surrogate.SurrogateCredentialTrait; import org.apereo.cas.configuration.CasConfigurationProperties; -import org.apereo.cas.services.DefaultRegisteredServiceSurrogatePolicy; import org.apereo.cas.services.RegisteredServiceTestUtils; import org.apereo.cas.services.ServicesManager; -import org.apereo.cas.test.CasTestExtension; +import org.apereo.cas.services.SurrogateRegisteredServiceAccessStrategy; import lombok.val; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; @@ -33,7 +32,6 @@ */ @ExtendWith(MockitoExtension.class) @Tag("Impersonation") -@ExtendWith(CasTestExtension.class) @SpringBootTest(classes = BaseSurrogateAuthenticationServiceTests.SharedTestConfiguration.class, properties = { "cas.authn.attribute-repository.stub.attributes.uid=uid", @@ -66,12 +64,16 @@ void verifyOperation() throws Throwable { val registeredService = RegisteredServiceTestUtils.getRegisteredService(service.getId(), Map.of()); servicesManager.save(registeredService); - registeredService.setSurrogatePolicy(new DefaultRegisteredServiceSurrogatePolicy().setEnabled(false)); + val accessStrategy = new SurrogateRegisteredServiceAccessStrategy(); + accessStrategy.setSurrogateEnabled(false); + + registeredService.setAccessStrategy(accessStrategy); assertTrue(surrogateServiceTicketGeneratorAuthority.supports(authenticationResult, service)); assertThrows(SurrogateAuthenticationException.class, () -> surrogateServiceTicketGeneratorAuthority.shouldGenerate(authenticationResult, service)); - registeredService.setSurrogatePolicy(new DefaultRegisteredServiceSurrogatePolicy().setEnabled(true)); + accessStrategy.setSurrogateEnabled(true); + registeredService.setAccessStrategy(accessStrategy); servicesManager.save(registeredService); assertTrue(surrogateServiceTicketGeneratorAuthority.shouldGenerate(authenticationResult, service)); }