Annotation Type ConjurPropertySource


  • @Documented
    @Target(TYPE)
    @Retention(RUNTIME)
    @Repeatable(ConjurPropertySources.class)
    @Import(Registrar.class)
    public @interface ConjurPropertySource
    The @ConjurPropertySource annotation allows you to specify the root of a policy to look up. The Spring Boot Plugin routes the look up to Conjur through the Conjur Spring Boot SDK and a REST API that we expose. Using @ConjurPropertySource in conjunction with @Configuration classes is required. The names of secrets, passwords, and user IDs all remain as originally specified.

    Example usage

    Given a vault's path policy/my-application containing the configuration data pair database.password=mysecretpassword, the following @Configuration class uses ConjurPropertySource).

     @Configuration
     @ConjurPropertySource("policy/my-application")
     public class AppConfig {
    
            @Value("${database.password:notFound}")
            private String password;
     
            @Bean
            public TestBean testBean() {
                    TestBean testBean = new TestBean();
                    testBean.setPassword(password));
                    return testBean;
            }
     }
     
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String[] value
      Indicate the Vault path(s) of the policy to be retrieved.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean ignoreResourceNotFound  
      String name
      Indicates the name of query vault.
    • Element Detail

      • value

        String[] value
        Indicate the Vault path(s) of the policy to be retrieved. For example, "policy/my-application/db.userName".
        Returns:
        Vault path(s)
      • name

        String name
        Indicates the name of query vault.
        Returns:
        name of query vault.
        Default:
        ""
      • ignoreResourceNotFound

        boolean ignoreResourceNotFound
        Returns:
        false.
        Default:
        false