@Test void testConfigurationAuth1() throws Exception { final TrellisConfiguration config = new YamlConfigurationFactory<>(TrellisConfiguration.class, Validators.newValidator(), Jackson.newMinimalObjectMapper(), "") .build(new File(getClass().getResource("/config1.yml").toURI())); assertTrue(config.getAuth().getWebac().getEnabled(), "WebAC should be enabled!"); assertEquals(200L, config.getAuth().getWebac().getCacheSize(), "Incorrect auth/webac/cacheSize"); assertEquals(15L, config.getAuth().getWebac().getCacheExpireSeconds(), "Bad auth/webac/cache expiry!"); assertTrue(config.getAuth().getBasic().getEnabled(), "basic auth not enabled!"); assertEquals("users.auth", config.getAuth().getBasic().getUsersFile(), "Incorrect basic users file!"); assertEquals("trellis", config.getAuth().getRealm(), "Incorrect auth realm!"); assertEquals("openid", config.getAuth().getScope(), "Incorrect auth scope!"); config.getAuth().setRealm("foobar"); config.getAuth().setScope("baz"); assertEquals("foobar", config.getAuth().getRealm(), "Incorrect auth/basic/realm value!"); assertEquals("baz", config.getAuth().getScope(), "Incorrect auth scope!"); assertTrue(config.getAuth().getJwt().getEnabled(), "auth/jwt not enabled!"); assertEquals("Mz4DGzFLQysSGC98ESAnSafMLbxa71ls/zzUFOdCIJw9L0J8Q0Gt7+yCM+Ag73Tm5OTwpBemFOqPFiZ5BeBo4Q==", config.getAuth().getJwt().getKey(), "Incorrect auth/jwt/key"); assertEquals("password", config.getAuth().getJwt().getKeyStorePassword(), "Wrong auth/jwt/keyStorePassword"); assertEquals("/tmp/trellisData/keystore.jks", config.getAuth().getJwt().getKeyStore(), "Wrong keystore path!"); assertTrue(config.getAuth().getJwt().getKeyIds().contains("baz"), "'baz' not in auth/jwt/keyIds"); assertTrue(config.getAuth().getJwt().getKeyIds().contains("bar"), "'bar' not in auth/jwt/keyIds"); assertTrue(config.getAuth().getJwt().getKeyIds().contains("trellis"), "'trellis' not in auth/jwt/keyIds"); assertEquals(3, config.getAuth().getJwt().getKeyIds().size(), "Incorrect count of auth/jwt/keyIds"); assertEquals("https: "Wrong jwks value!"); }
@JsonProperty public AuthConfiguration getAuth() { return auth; }
TrellisConfiguration extends Configuration { @JsonProperty public AuthConfiguration getAuth() { return auth; } }
TrellisConfiguration extends Configuration { @JsonProperty public AuthConfiguration getAuth() { return auth; }  }
TrellisConfiguration extends Configuration { @JsonProperty public AuthConfiguration getAuth() { return auth; }  @JsonProperty String getBaseUrl(); @JsonProperty void setBaseUrl(final String baseUrl); @JsonProperty String getHubUrl(); @JsonProperty void setHubUrl(final String hubUrl); @JsonProperty void setAssets(final AssetConfiguration assets); @JsonProperty AssetConfiguration getAssets(); @JsonProperty String getDefaultName(); @JsonProperty void setDefaultName(final String name); @JsonAnySetter TrellisConfiguration setAdditionalConfig(final String name, final Object value); @JsonAnyGetter Map<String, Object> any(); @JsonProperty void setCache(final CacheConfiguration cache); @JsonProperty CacheConfiguration getCache(); @JsonProperty void setCors(final CORSConfiguration cors); @JsonProperty CORSConfiguration getCors(); @JsonProperty void setAuth(final AuthConfiguration auth); @JsonProperty AuthConfiguration getAuth(); @JsonProperty void setJsonld(final JsonLdConfiguration jsonld); @JsonProperty JsonLdConfiguration getJsonld(); @JsonProperty void setUseRelativeIris(final boolean useRelativeIris); @JsonProperty boolean getUseRelativeIris(); @JsonProperty void setNotifications(final NotificationsConfiguration notifications); @JsonProperty NotificationsConfiguration getNotifications(); }
TrellisConfiguration extends Configuration { @JsonProperty public AuthConfiguration getAuth() { return auth; }  @JsonProperty String getBaseUrl(); @JsonProperty void setBaseUrl(final String baseUrl); @JsonProperty String getHubUrl(); @JsonProperty void setHubUrl(final String hubUrl); @JsonProperty void setAssets(final AssetConfiguration assets); @JsonProperty AssetConfiguration getAssets(); @JsonProperty String getDefaultName(); @JsonProperty void setDefaultName(final String name); @JsonAnySetter TrellisConfiguration setAdditionalConfig(final String name, final Object value); @JsonAnyGetter Map<String, Object> any(); @JsonProperty void setCache(final CacheConfiguration cache); @JsonProperty CacheConfiguration getCache(); @JsonProperty void setCors(final CORSConfiguration cors); @JsonProperty CORSConfiguration getCors(); @JsonProperty void setAuth(final AuthConfiguration auth); @JsonProperty AuthConfiguration getAuth(); @JsonProperty void setJsonld(final JsonLdConfiguration jsonld); @JsonProperty JsonLdConfiguration getJsonld(); @JsonProperty void setUseRelativeIris(final boolean useRelativeIris); @JsonProperty boolean getUseRelativeIris(); @JsonProperty void setNotifications(final NotificationsConfiguration notifications); @JsonProperty NotificationsConfiguration getNotifications();  }