Skip to content

Commit

Permalink
clean up deprecated usages
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoayyed committed May 26, 2020
1 parent 996f8ac commit b873c1b
Show file tree
Hide file tree
Showing 17 changed files with 131 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ public static class Endpoints implements Serializable {
*/
private LdapSecurity ldap = new LdapSecurity();

/**
* Control whether access to endpoints can be controlled
* via form-based login over the web via a special admin login endpoint.
*/
private boolean formLoginEnabled;

@Getter
@Setter
public static class JaasSecurity implements Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,101 +39,121 @@
public class ServiceRegistryProperties implements Serializable {

private static final long serialVersionUID = -368826011744304210L;

/**
* Properties pertaining to Cosmos DB service registry.
*/
@NestedConfigurationProperty
private CosmosDbServiceRegistryProperties cosmosDb = new CosmosDbServiceRegistryProperties();

/**
* Properties pertaining to Apache Cassandra service registry.
*/
@NestedConfigurationProperty
private CassandraServiceRegistryProperties cassandra = new CassandraServiceRegistryProperties();

/**
* Properties pertaining to Git-based service registry.
*/
@NestedConfigurationProperty
private GitServiceRegistryProperties git = new GitServiceRegistryProperties();

/**
* Properties pertaining to Cosmos DB service registry.
*/
@NestedConfigurationProperty
private CouchDbServiceRegistryProperties couchDb = new CouchDbServiceRegistryProperties();

/**
* Properties pertaining to REST service registry.
*/
@NestedConfigurationProperty
private BaseRestEndpointProperties rest = new BaseRestEndpointProperties();

/**
* Properties pertaining to redis service registry.
*/
@NestedConfigurationProperty
private RedisServiceRegistryProperties redis = new RedisServiceRegistryProperties();

/**
* Properties pertaining to JSON service registry.
*/
@NestedConfigurationProperty
private JsonServiceRegistryProperties json = new JsonServiceRegistryProperties();

/**
* Properties pertaining to YAML service registry.
*/
@NestedConfigurationProperty
private YamlServiceRegistryProperties yaml = new YamlServiceRegistryProperties();

/**
* Properties pertaining to jpa service registry.
*/
@NestedConfigurationProperty
private JpaServiceRegistryProperties jpa = new JpaServiceRegistryProperties();

/**
* Properties pertaining to ldap service registry.
*/
@NestedConfigurationProperty
private LdapServiceRegistryProperties ldap = new LdapServiceRegistryProperties();

/**
* Properties pertaining to mongo db service registry.
*/
@NestedConfigurationProperty
private MongoDbServiceRegistryProperties mongo = new MongoDbServiceRegistryProperties();

/**
* Properties pertaining to couchbase service registry.
*/
@NestedConfigurationProperty
private CouchbaseServiceRegistryProperties couchbase = new CouchbaseServiceRegistryProperties();

/**
* Properties pertaining to dynamo db service registry.
*/
@NestedConfigurationProperty
private DynamoDbServiceRegistryProperties dynamoDb = new DynamoDbServiceRegistryProperties();

/**
* Properties pertaining to streaming service registry content over the wire.
*/
@NestedConfigurationProperty
private StreamingServiceRegistryProperties stream = new StreamingServiceRegistryProperties();

/**
* Scheduler settings to indicate how often is metadata reloaded.
*/
@NestedConfigurationProperty
private SchedulingProperties schedule = new SchedulingProperties();

/**
* Email settings for notifications.
*/
@NestedConfigurationProperty
private EmailProperties mail = new EmailProperties();

/**
* SMS settings for notifications.
*/
@NestedConfigurationProperty
private SmsProperties sms = new SmsProperties();

/**
* Flag that indicates whether to initialise active service registry implementation with a default set of service definition included
* with CAS in JSON format.
*/
private boolean initFromJson;

/**
* Flag indicating whether a background watcher thread is enabled for the purposes of live reloading of service registry data changes
* from persistent data store.
*/
private boolean watcherEnabled = true;

/**
* Determine how services are internally managed, queried, cached and reloaded by CAS.
* Accepted values are the following:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@ public class CasEmbeddedApacheTomcatAjpProperties implements Serializable {
* <p>
* See the Apache Tomcat documentation for a full list.
*/
private Map<String, Object> attributes = new LinkedHashMap<>(0);
private Map<String, String> attributes = new LinkedHashMap<>(0);
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ public class CasEmbeddedApacheTomcatHttpProperties implements Serializable {
/**
* Additional attributes to be set on the connector.
*/
private Map<String, Object> attributes = new LinkedHashMap<>(0);
private Map<String, String> attributes = new LinkedHashMap<>(0);
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ public class CasEmbeddedApacheTomcatHttpProxyProperties implements Serializable
/**
* Custom attributes to set on the proxy connector.
*/
private Map<String, Object> attributes = new LinkedHashMap<>();
private Map<String, String> attributes = new LinkedHashMap<>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,8 @@ To determine whether an endpoint is available, the calculation order for all end

```properties
# management.endpoint.<endpoint-name>.enabled=true
```
```

2. If undefined, the global endpoint security is consulted from CAS settings.
3. If undefined, the default built-in setting for the endpoint in CAS is consulted, which is typically `false` by default.

Expand Down Expand Up @@ -806,11 +807,14 @@ The following health indicator names are available, given the presence of the ap
### Endpoint Security

Global endpoint security configuration activated by CAS may be controlled under the configuration key `cas.monitor.endpoints.endpoint.<endpoint-name>`.
There is a special endpoint named `defaults` which serves as a shortcut that controls the security of all endpoints, if left undefined in CAS settings.
There is a special endpoint named `defaults` which serves as a shortcut that controls the security of all endpoints, if left undefined in CAS settings. Accessing an endpoint
over the web can be allowed via a special login form whose access and presence can be controlled via:

Note that any individual endpoint must be first enabled before any security can be applied.
```properties
# cas.monitor.endpoints.form-login-enabled=false
```

The security of all endpoints is controlled using the following settings:
Note that any individual endpoint must be first enabled before any security can be applied. The security of all endpoints is controlled using the following settings:

```properties
# ${configuration-key}.required-roles[0]=
Expand Down
2 changes: 0 additions & 2 deletions support/cas-server-support-radius/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ dependencies {
testImplementation project(":core:cas-server-core-authentication")
testImplementation project(":core:cas-server-core-logout")

testImplementation project(path: ":core:cas-server-core-util-api", configuration: "tests")
testImplementation project(path: ":core:cas-server-core-authentication-api", configuration: "tests")

testImplementation project(path: ":core:cas-server-core", configuration: "tests")
testImplementation project(path: ":core:cas-server-core-util-api", configuration: "tests")
testImplementation project(path: ":core:cas-server-core-webflow-mfa-api", configuration: "tests")
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
*
* @author Marvin S. Addison
* @since 3.5
* @deprecated since 6.2.0
*/
@Slf4j
@Endpoint(id = "status", enableByDefault = false)
@Deprecated(since ="6.2.0")
public class StatusEndpoint extends BaseCasActuatorEndpoint {
private final HealthEndpoint healthEndpoint;

Expand All @@ -48,7 +50,6 @@ public Map<String, Object> handle() {
LOGGER.info("Health endpoint is undefined/disabled. No health indicators may be consulted to query for health data "
+ "and the status results are always going to be [{}]", model);
} else {

val health = this.healthEndpoint.health();
val status = health.getStatus();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.apereo.cas.ticket.registry.TicketRegistrySupport;
import org.apereo.cas.web.cookie.CasCookieBuilder;
import org.apereo.cas.web.report.AuditLogEndpoint;
import org.apereo.cas.web.report.CasApplicationContextReloadEndpoint;
import org.apereo.cas.web.report.CasInfoEndpointContributor;
import org.apereo.cas.web.report.CasReleaseAttributesReportEndpoint;
import org.apereo.cas.web.report.CasResolveAttributesReportEndpoint;
Expand All @@ -24,6 +23,7 @@
import org.apereo.cas.web.report.StatisticsEndpoint;
import org.apereo.cas.web.report.StatusEndpoint;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
Expand Down Expand Up @@ -153,20 +153,17 @@ public CasReleaseAttributesReportEndpoint releaseAttributesReportEndpoint() {
principalFactory.getObject());
}

@Bean
@ConditionalOnAvailableEndpoint
public CasApplicationContextReloadEndpoint casApplicationContextReloadEndpoint() {
return new CasApplicationContextReloadEndpoint(casProperties, contextRefresher.getObject());
}

/**
* This this {@link StatusEndpointConfiguration}.
*
* @author Misagh Moayyed
* @since 6.0.0
* @deprecated since 6.2.0
*/
@Configuration("statusEndpointConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
@Slf4j
@Deprecated(since ="6.2.0")
public static class StatusEndpointConfiguration {
@Autowired
private CasConfigurationProperties casProperties;
Expand All @@ -177,6 +174,8 @@ public static class StatusEndpointConfiguration {
@Bean
@ConditionalOnAvailableEndpoint
public StatusEndpoint statusEndpoint() {
LOGGER.warn("The status actuator endpoint is deprecated and is scheduled to be removed from CAS in the future. "
+ "To obtain status and health inforation, please configure and use the health endpoint instead.");
return new StatusEndpoint(casProperties, healthEndpoint.getIfAvailable());
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.apereo.cas;

import org.apereo.cas.web.report.AuditLogEndpointTests;
import org.apereo.cas.web.report.CasApplicationContextReloadEndpointTests;
import org.apereo.cas.web.report.CasInfoEndpointContributorTests;
import org.apereo.cas.web.report.CasReleaseAttributesReportEndpointTests;
import org.apereo.cas.web.report.CasResolveAttributesReportEndpointTests;
Expand Down Expand Up @@ -30,7 +29,6 @@
StatusEndpointTests.class,
StatusEndpointWithHealthTests.class,
StatisticsEndpointTests.class,
CasApplicationContextReloadEndpointTests.class,
SingleSignOnSessionsEndpointTests.class,
SpringWebflowEndpointTests.class,
LoggingConfigurationEndpointTests.class,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
*
* @author Misagh Moayyed
* @since 6.2.0
* @deprecated since 6.2.0
*/
@TestPropertySource(properties = {
"management.endpoint.status.enabled=true",
"management.endpoint.health.enabled=false"
})
@Tag("Simple")
@Deprecated(since ="6.2.0")
public class StatusEndpointTests extends AbstractCasEndpointTests {
@Autowired
@Qualifier("statusEndpoint")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
*
* @author Misagh Moayyed
* @since 6.2.0
* @deprecated since 6.2.0
*/
@TestPropertySource(properties = {
"management.endpoint.status.enabled=true",
"management.endpoint.health.enabled=true",
"management.endpoint.health.show-details=always"
})
@Tag("Simple")
@Deprecated(since ="6.2.0")
public class StatusEndpointWithHealthTests extends AbstractCasEndpointTests {
@Autowired
@Qualifier("statusEndpoint")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
properties = {
"server.port=9303",
"cas.service-registry.rest.url=http://localhost:9303",
"cas.service-registry.initFromJson=false"
"cas.service-registry.init-from-json=false"
},
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@EnableConfigurationProperties(CasConfigurationProperties.class)
Expand Down
Loading

0 comments on commit b873c1b

Please sign in to comment.