001/* 002 * oauth2-oidc-sdk 003 * 004 * Copyright 2012-2020, Connect2id Ltd and contributors. 005 * 006 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use 007 * this file except in compliance with the License. You may obtain a copy of the 008 * License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software distributed 013 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 014 * CONDITIONS OF ANY KIND, either express or implied. See the License for the 015 * specific language governing permissions and limitations under the License. 016 */ 017 018package com.nimbusds.openid.connect.sdk.federation.policy.operations; 019 020 021import java.util.List; 022 023import com.nimbusds.openid.connect.sdk.federation.policy.language.PolicyOperation; 024import com.nimbusds.openid.connect.sdk.federation.policy.language.PolicyViolationException; 025 026 027/** 028 * Validates the permitted combinations of known policy operations for a given 029 * metadata parameter. 030 * 031 * <p>To support combinations including non-standard policy operations on 032 * metadata parameters consider overriding 033 * {@link DefaultPolicyOperationCombinationValidator#validate(List)}. 034 * 035 * <p>Related specifications: 036 * 037 * <ul> 038 * <li>OpenID Connect Federation 1.0, section 4.2. 039 * </ul> 040 */ 041public interface PolicyOperationCombinationValidator { 042 043 044 /** 045 * Validates the specified combination of policy operations. 046 * 047 * @param policyOperations The policy operations, empty list if none. 048 * 049 * @return The validated and optionally optimised policy operations. 050 * 051 * @throws PolicyViolationException On a illegal policy combination. 052 */ 053 List<PolicyOperation> validate(final List<PolicyOperation> policyOperations) 054 throws PolicyViolationException; 055}