feat: enforce DDS token access through common grants
This commit is contained in:
@@ -56,4 +56,19 @@ class DdsPropertiesTest {
|
||||
assertEquals("dds_demo_my_role", properties.users().get("my").dataRole());
|
||||
assertTrue(properties.users().get("my").mapped());
|
||||
}
|
||||
|
||||
@Test
|
||||
void bindsTokenTechnicalUserSeparatelyFromApplicationUsers() {
|
||||
var source = new MapConfigurationPropertySource(Map.of(
|
||||
"dds.token.username", "dds_demo_token",
|
||||
"dds.token.password", "secret"
|
||||
));
|
||||
|
||||
var properties = new Binder(source)
|
||||
.bind("dds", Bindable.of(DdsProperties.class))
|
||||
.orElseThrow(() -> new AssertionError("dds token properties did not bind"));
|
||||
|
||||
assertEquals("dds_demo_token", properties.token().username());
|
||||
assertTrue(properties.token().configured());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user