use of com.thoughtworks.go.plugin.access.authorization.models.Capabilities in project gocd by gocd.
the class AuthorizationPluginConfigMetadataStore method add.
@Override
public void add(PluginDescriptor plugin, AuthorizationPluginRegistry extension) {
try {
Image icon = extension.getIcon(plugin.id());
Capabilities capabilities = extension.getCapabilities(plugin.id());
PluginProfileMetadataKeys authConfigMetadata = extension.getPluginConfigurationMetadata(plugin.id());
String authConfigView = extension.getPluginConfigurationView(plugin.id());
cacheRoleMetadataAndView(plugin, extension);
this.icons.put(plugin, icon);
this.authConfigMetadata.put(plugin, authConfigMetadata);
this.authConfigView.put(plugin, authConfigView);
this.capabilities.put(plugin, capabilities);
} catch (Exception e) {
LOGGER.error("Failed to load plugin {}", plugin.id(), e);
throw e;
}
}
use of com.thoughtworks.go.plugin.access.authorization.models.Capabilities in project gocd by gocd.
the class CapabilitiesTest method shouldDeserializeFromJSON.
@Test
public void shouldDeserializeFromJSON() throws Exception {
String json = "" + "{\n" + " \"supported_auth_type\": \"web\",\n" + " \"can_search\": true\n" + "}";
Capabilities capabilities = Capabilities.fromJSON(json);
assertThat(capabilities.getSupportedAuthType(), is(SupportedAuthType.Web));
assertThat(capabilities.canSearch(), is(true));
}
Aggregations