Skip to content

Commit

Permalink
Merge branch '7.0.x' of github.com:apereo/cas into 7.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoayyed committed Nov 1, 2024
2 parents e54a694 + 51d16e3 commit 1564bfc
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ dependencyResolutionManagement {
includeModule("org.nodejs", "node")
}
}

mavenLocal()
mavenCentral()
maven {
url "https://build.shibboleth.net/maven/snapshots"
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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",
Expand Down Expand Up @@ -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));
}
Expand Down

0 comments on commit 1564bfc

Please sign in to comment.