Search in sources :

Example 1 with Report

use of org.codice.ddf.admin.api.report.Report in project admin-console-beta by connexta.

the class SecurityValidation method validateStsClaimsExist.

public static Report validateStsClaimsExist(List<StringField> claimArgs, ServiceActions serviceActions, StsServiceProperties stsServiceProps) {
    Report report = Reports.emptyReport();
    List<String> supportedClaims = stsServiceProps.getConfiguredStsClaims(serviceActions);
    claimArgs.stream().filter(claimArg -> !supportedClaims.contains(claimArg.getValue())).forEach(claimArg -> report.addErrorMessage(invalidClaimType(claimArg.getPath())));
    return report;
}
Also used : List(java.util.List) Reports(org.codice.ddf.admin.common.report.Reports) SecurityMessages.invalidClaimType(org.codice.ddf.admin.security.common.SecurityMessages.invalidClaimType) ServiceActions(org.codice.ddf.internal.admin.configurator.actions.ServiceActions) Report(org.codice.ddf.admin.api.report.Report) StringField(org.codice.ddf.admin.common.fields.base.scalar.StringField) StsServiceProperties(org.codice.ddf.admin.security.common.services.StsServiceProperties) Report(org.codice.ddf.admin.api.report.Report)

Example 2 with Report

use of org.codice.ddf.admin.api.report.Report in project admin-console-beta by connexta.

the class ServiceCommons method updateService.

public Report<Void> updateService(PidField servicePid, Map<String, Object> newConfig) {
    Report report = serviceConfigurationExists(servicePid);
    if (report.containsErrorMessages()) {
        return report;
    }
    String pid = servicePid.getValue();
    Configurator configurator = configuratorSuite.getConfiguratorFactory().getConfigurator();
    configurator.add(configuratorSuite.getServiceActions().build(pid, newConfig, true));
    OperationReport operationReport = configurator.commit("Updated config with pid [{}]", pid);
    if (operationReport.containsFailedResults()) {
        report.addErrorMessage(failedPersistError());
    }
    return report;
}
Also used : Report(org.codice.ddf.admin.api.report.Report) OperationReport(org.codice.ddf.admin.configurator.OperationReport) Configurator(org.codice.ddf.admin.configurator.Configurator) OperationReport(org.codice.ddf.admin.configurator.OperationReport)

Aggregations

Report (org.codice.ddf.admin.api.report.Report)2 List (java.util.List)1 StringField (org.codice.ddf.admin.common.fields.base.scalar.StringField)1 Reports (org.codice.ddf.admin.common.report.Reports)1 Configurator (org.codice.ddf.admin.configurator.Configurator)1 OperationReport (org.codice.ddf.admin.configurator.OperationReport)1 SecurityMessages.invalidClaimType (org.codice.ddf.admin.security.common.SecurityMessages.invalidClaimType)1 StsServiceProperties (org.codice.ddf.admin.security.common.services.StsServiceProperties)1 ServiceActions (org.codice.ddf.internal.admin.configurator.actions.ServiceActions)1