/*******************************************************************************
* Copyright 2014 Federal Chancellery Austria
* MOA-ID has been developed in a cooperation between BRZ, the Federal
* Chancellery Austria - ICT staff unit, and Graz University of Technology.
*
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
* the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
* http://www.osor.eu/eupl/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*
* This product combines work with different licenses. See the "NOTICE" text
* file for details on the various modules and licenses.
* The "NOTICE" text file is part of the distribution. Any derivative works
* that you distribute must include a readable copy of the "NOTICE" text file.
******************************************************************************/
/*
* Copyright 2003 Federal Chancellery Austria
* MOA-ID has been developed in a cooperation between BRZ, the Federal
* Chancellery Austria - ICT staff unit, and Graz University of Technology.
*
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
* the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
* http://www.osor.eu/eupl/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*
* This product combines work with different licenses. See the "NOTICE" text
* file for details on the various modules and licenses.
* The "NOTICE" text file is part of the distribution. Any derivative works
* that you distribute must include a readable copy of the "NOTICE" text file.
*/
package at.gv.egovernment.moa.id.auth.validator;
import java.util.Map;
import org.w3c.dom.Element;
import at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult;
import at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams;
import at.gv.egovernment.moa.id.auth.exception.ValidateException;
/**
* Validates an InfoboxReadResponse.
* An implementing class has to validate the content of the InfoboxReadResponse
* according to the type specific rules and guidelines of the underlying
* application.
*/
public interface InfoboxValidator {
/**
* This method validates an InfoboxReadResponse.
* The method validates the content of the passed infoboxReadResponse
* according to the type specific rules and guidelines of the underlying
* application.
*
* @param params {@link at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams
* Parameters} needed by the validator.
*
* @return InfoboxValidationResult structure (@link at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult}
*
* @throws ValidateException If an error occurs on validating the
* InfoboxReadResponse.
*/
public InfoboxValidationResult validate (InfoboxValidatorParams params)
throws ValidateException;
/**
* This method is used to do intermediate processing before signing the auth block.
* If a infobox validator threw a form to gather user input, this method is used
* to validate this input. In no further input is needed the form must be empty to
* proceed, and also a valid InfoboxValidationResult
is necessary.
* If more input is needed, the validator can build a new form and it is then shown
* to the citizen.
* The implementation of InfoboxValidator
must hold its necessary
* data and configuration internally, if this method is called - the class is
* reused at this call
*
* @param parameters the parameters got returned by the input fields
*
* @return InfoboxValidationResult structure (@link at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult}
*
* @throws ValidateException If an error occurs on validating the
* InfoboxReadResponse.
*/
public InfoboxValidationResult validate (Map parameters)
throws ValidateException;
/**
* This method is used to do post processing after signing the auth block.
* The method validates the content of the infoboxReadResponse
samlAssertion if needed.
* The implementation of InfoboxValidator
must hold its necessary
* data and configuration internally, if this method is called - the class is
* reused at this call
*
* @param samlAssertion the SAML assertion needed by the validator
*
* @return InfoboxValidationResult structure (@link at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult}
*
* @throws ValidateException If an error occurs on validating the
* InfoboxReadResponse.
*/
public InfoboxValidationResult validate (Element samlAssertion)
throws ValidateException;
/**
* form for user interaction for intermediate processing of infobox validation
*
* @return answer form of the servlet request.
*/
public String getForm();
}