Skip to content

Installation & Setup

  • Java 17+
  • Spring Boot 4.1+, with Spring MVC or WebFlux
  • rulii 2.3.0 and rulii-spring 2.3.0 for explorer 1.2.0
  • rulii-bean-validation 1.1.0, only for the Beans section
rulii-explorer rulii and rulii-spring
1.2.0 2.3+
1.1.0 2.2+
1.0.0 2.1+

The explorer goes into an application that already uses rulii-spring.

<dependency>
<groupId>org.rulii</groupId>
<artifactId>rulii-explorer-spring-boot-starter</artifactId>
<version>1.2.0</version>
</dependency>
implementation 'org.rulii:rulii-explorer-spring-boot-starter:1.2.0'

With the BOM, leave the version off.

The explorer is off by default, so a production deployment never shows its rules unless someone chose to. Switch it on and expose its endpoint, as for any Actuator endpoint:

rulii.explorer.enabled=true
management.endpoints.web.exposure.include=health,rulii

Start the application and open /rulii. The same information is available as JSON at /actuator/rulii.

A context path, a custom management.endpoints.web.base-path and a separate management.server.port are respected. With a separate management port the page is served there, next to the endpoint.

The descriptor is protected by whatever protects your Actuator endpoints. The page’s own files contain no data. With Spring Security, a typical arrangement lets one role in and keeps everyone else out:

import org.springframework.boot.security.autoconfigure.actuate.web.servlet.EndpointRequest;
@Bean
SecurityFilterChain explorer(HttpSecurity http) throws Exception {
http.securityMatcher(EndpointRequest.to("rulii"), PathPatternRequestMatcher.withDefaults().matcher("/rulii/**"))
.authorizeHttpRequests(a -> a.anyRequest().hasRole("RULES"))
.httpBasic(Customizer.withDefaults());
return http.build();
}

When the descriptor answers 401 or 403, the page says what to do instead of showing nothing. The endpoint has no write operations.

The descriptor can be written from any @SpringBootTest and compared between releases, so a review sees which rules changed:

@SpringBootTest(properties = "rulii.explorer.enabled=true")
class DescriptorSnapshotTest {
@Autowired
ApplicationContext context;
@Test
void writeDescriptor() throws IOException {
RuliiDescriptors.write(context, Path.of("target/rules.json"));
}
}

The document follows rulii-descriptor-1.schema.json, which ships in rulii-explorer-core.

Opening Another Application’s Descriptor

Section titled “Opening Another Application’s Descriptor”

The page is not tied to the application that serves it. The chip beside the application name opens another descriptor:

  • Another application’s endpoint, such as https://staging:8080/actuator/rulii. The browser fetches it directly, so that application has to allow the origin:

    management.endpoints.web.cors.allowed-origins=https://where-this-explorer-runs

    The request carries no credentials, so a protected endpoint cannot be read this way. Save its descriptor to a file and open the file.

  • A descriptor saved as JSON at any address that allows cross-origin reads, such as the file the test above writes.

  • A file from your machine, chosen or dropped on the page. It stays in the browser tab.

The choice is part of the page address (/rulii?descriptor=...), so a link into another application’s rules can be shared. rulii.explorer.ui.external-sources=false turns this off.

Next: Configuration.