Package org.springframework.boot.actuate.autoconfigure.ShellProperties

Examples of org.springframework.boot.actuate.autoconfigure.ShellProperties.SpringAuthenticationProperties


      // based authentication and get role to access shell from
      // ManagementServerProperties.
      // In case shell.auth is set to spring and roles are configured using
      // shell.auth.spring.roles the below default role will be overridden by
      // ConfigurationProperties.
      SpringAuthenticationProperties authenticationProperties = new SpringAuthenticationProperties();
      if (this.management != null) {
        authenticationProperties.setRoles(new String[] { this.management
            .getSecurity().getRole() });
      }
      return authenticationProperties;
    }
View Full Code Here


    assertTrue(security.getUser().isDefaultPassword());
  }

  @Test
  public void testBindingSpring() {
    SpringAuthenticationProperties props = new SpringAuthenticationProperties();
    RelaxedDataBinder binder = new RelaxedDataBinder(props, "shell.auth.spring");
    binder.bind(new MutablePropertyValues(Collections.singletonMap(
        "shell.auth.spring.roles", "role1, role2")));
    assertFalse(binder.getBindingResult().hasErrors());

    Properties p = new Properties();
    props.applyToCrshShellConfig(p);

    assertEquals("role1, role2", p.get("crash.auth.spring.roles"));
  }
View Full Code Here

TOP

Related Classes of org.springframework.boot.actuate.autoconfigure.ShellProperties.SpringAuthenticationProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.