org.springframework.boot.actuate.info.InfoEndpoint Java Examples

The following examples show how to use org.springframework.boot.actuate.info.InfoEndpoint. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SecurityConfiguration.java    From flowable-engine with Apache License 2.0 6 votes vote down vote up
protected void configure(HttpSecurity http) throws Exception {

            http
                .sessionManagement()
                .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                .and()
                .csrf()
                .disable();

            http
                .requestMatcher(new ActuatorRequestMatcher())
                .authorizeRequests()
                .requestMatchers(EndpointRequest.to(InfoEndpoint.class, HealthEndpoint.class)).authenticated()
                .requestMatchers(EndpointRequest.toAnyEndpoint()).hasAnyAuthority(DefaultPrivileges.ACCESS_ADMIN)
                .and().httpBasic();
        }
 
Example #2
Source File: SecurityConfiguration.java    From flowable-engine with Apache License 2.0 6 votes vote down vote up
protected void configure(HttpSecurity http) throws Exception {

            http
                .sessionManagement()
                .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                .and()
                .csrf()
                .disable();

            http
                .requestMatcher(new ActuatorRequestMatcher())
                .authorizeRequests()
                .requestMatchers(EndpointRequest.to(InfoEndpoint.class, HealthEndpoint.class)).authenticated()
                .requestMatchers(EndpointRequest.toAnyEndpoint()).hasAnyAuthority(DefaultPrivileges.ACCESS_ADMIN)
                .and().httpBasic();
        }
 
Example #3
Source File: SecurityConfiguration.java    From flowable-engine with Apache License 2.0 6 votes vote down vote up
@Override
protected void configure(HttpSecurity http) throws Exception {

    http
        .sessionManagement()
        .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
        .and()
        .csrf()
        .disable();

    http
        .requestMatcher(new ActuatorRequestMatcher())
        .authorizeRequests()
        .requestMatchers(EndpointRequest.to(InfoEndpoint.class, HealthEndpoint.class)).authenticated()
        .requestMatchers(EndpointRequest.toAnyEndpoint()).hasAnyAuthority(DefaultPrivileges.ACCESS_ADMIN)
        .and().httpBasic();
}
 
Example #4
Source File: SecurityConfiguration.java    From flowable-engine with Apache License 2.0 6 votes vote down vote up
protected void configure(HttpSecurity http) throws Exception {

            http
                .sessionManagement()
                .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                .and()
                .csrf()
                .disable();

            http
                .requestMatcher(new ActuatorRequestMatcher())
                .authorizeRequests()
                .requestMatchers(EndpointRequest.to(InfoEndpoint.class, HealthEndpoint.class)).authenticated()
                .requestMatchers(EndpointRequest.toAnyEndpoint()).hasAnyAuthority(DefaultPrivileges.ACCESS_ADMIN)
                .and().httpBasic();
        }
 
Example #5
Source File: ActuatorCommand.java    From ssh-shell-spring-boot with Apache License 2.0 5 votes vote down vote up
public ActuatorCommand(ApplicationContext applicationContext, Environment environment,
                       SshShellProperties properties, SshShellHelper helper,
                       @Lazy AuditEventsEndpoint audit, @Lazy BeansEndpoint beans,
                       @Lazy ConditionsReportEndpoint conditions,
                       @Lazy ConfigurationPropertiesReportEndpoint configprops, @Lazy EnvironmentEndpoint env,
                       @Lazy HealthEndpoint health,
                       @Lazy HttpTraceEndpoint httptrace, @Lazy InfoEndpoint info, @Lazy LoggersEndpoint loggers,
                       @Lazy MetricsEndpoint metrics,
                       @Lazy MappingsEndpoint mappings, @Lazy ScheduledTasksEndpoint scheduledtasks,
                       @Lazy ShutdownEndpoint shutdown,
                       @Lazy ThreadDumpEndpoint threaddump) {
    this.applicationContext = applicationContext;
    this.environment = environment;
    this.properties = properties;
    this.helper = helper;
    this.audit = audit;
    this.beans = beans;
    this.conditions = conditions;
    this.configprops = configprops;
    this.env = env;
    this.health = health;
    this.httptrace = httptrace;
    this.info = info;
    this.loggers = loggers;
    this.metrics = metrics;
    this.mappings = mappings;
    this.scheduledtasks = scheduledtasks;
    this.shutdown = shutdown;
    this.threaddump = threaddump;
}
 
Example #6
Source File: ServiceDiscoveryConfiguration.java    From Kafdrop with Apache License 2.0 5 votes vote down vote up
@Bean
public ServiceDiscoveryApplicationListener serviceDiscoveryStartupListener(WebServerApplicationContext webContext,
                                                                           ServiceDiscovery serviceDiscovery,
                                                                           Environment environment,
                                                                           InfoEndpoint infoEndpoint)
{
   return new ServiceDiscoveryApplicationListener(webContext, serviceDiscovery, environment, infoEndpoint);
}
 
Example #7
Source File: ServiceDiscoveryConfiguration.java    From Kafdrop with Apache License 2.0 5 votes vote down vote up
public ServiceDiscoveryApplicationListener(WebServerApplicationContext webContext,
                                           ServiceDiscovery serviceDiscovery,
                                           Environment environment,
                                           InfoEndpoint infoEndpoint)
{
   this.webContext = webContext;
   this.serviceDiscovery = serviceDiscovery;
   this.environment = environment;
   this.infoEndpoint = infoEndpoint;
}
 
Example #8
Source File: AppDimensionConfiguration.java    From sofa-dashboard-client with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public ActuatorInfoDimension createInfoDimension(InfoEndpoint endpoint) {
    return new ActuatorInfoDimension(endpoint);
}
 
Example #9
Source File: ActuatorInfoDimension.java    From sofa-dashboard-client with Apache License 2.0 4 votes vote down vote up
public ActuatorInfoDimension(InfoEndpoint endpoint) {
    this.endpoint = endpoint;
}
 
Example #10
Source File: DimensionTestContext.java    From sofa-dashboard-client with Apache License 2.0 4 votes vote down vote up
@Bean
public ActuatorInfoDimension createInfoDimension(InfoEndpoint endpoint) {
    return new ActuatorInfoDimension(endpoint);
}
 
Example #11
Source File: ActuatorCommand.java    From ssh-shell-spring-boot with Apache License 2.0 4 votes vote down vote up
/**
 * @return whether `info` command is available
 */
public Availability infoAvailability() {
    return availability("info", InfoEndpoint.class);
}
 
Example #12
Source File: InfoCommand.java    From sshd-shell-spring-boot with Apache License 2.0 4 votes vote down vote up
InfoCommand(@Value("${sshd.system.command.roles.info}") String[] systemRoles, InfoEndpoint infoEndpoint) {
    super(systemRoles);
    this.infoEndpoint = infoEndpoint;
}
 
Example #13
Source File: SecurityConfiguration.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Override
protected void configure(HttpSecurity http) throws Exception {
    HttpSecurity httpSecurity = http.authenticationProvider(authenticationProvider())
            .sessionManagement()
            .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
            .and()
            .csrf().disable();

    if (restAppProperties.getCors().isEnabled()) {
        httpSecurity.apply(new PropertyBasedCorsFilter(restAppProperties));
    }

    // Swagger docs
    if (isSwaggerDocsEnabled()) {
        httpSecurity
            .authorizeRequests()
            .antMatchers("/docs/**").permitAll();

    } else {
        httpSecurity
            .authorizeRequests()
            .antMatchers("/docs/**").denyAll();
        
    }

    httpSecurity
        .authorizeRequests()
        .requestMatchers(EndpointRequest.to(InfoEndpoint.class, HealthEndpoint.class)).authenticated()
        .requestMatchers(EndpointRequest.toAnyEndpoint()).hasAnyAuthority(SecurityConstants.ACCESS_ADMIN);

    // Rest API access
    if (isVerifyRestApiPrivilege()) {
        httpSecurity
            .authorizeRequests()
            .anyRequest()
            .hasAuthority(SecurityConstants.PRIVILEGE_ACCESS_REST_API).and ().httpBasic();
        
    } else {
        httpSecurity
        .authorizeRequests()
        .anyRequest()
        .authenticated().and().httpBasic();
    }
}
 
Example #14
Source File: InfoWebEndpointExtension.java    From tutorials with MIT License 4 votes vote down vote up
public InfoWebEndpointExtension(InfoEndpoint infoEndpoint) {
    this.delegate = infoEndpoint;
}