// Copyright 2016 Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

// $title: Denier
// $description: Adapter that always returns a precondition denial.
// $location: https://istio.io/docs/reference/config/policy-and-telemetry/adapters/denier.html
// $supported_templates: listentry,quota,checknothing
// $aliases:
// $  - /docs/reference/config/adapters/denier.html

// The `denier` adapter is designed to always return a denial to precondition
// checks. You can specify the exact error to return for these denials.
//
// This adapter supports the [checknothing template](https://istio.io/docs/reference/config/policy-and-telemetry/templates/checknothing/),
// the [listentry template](https://istio.io/docs/reference/config/policy-and-telemetry/templates/listentry/),
// and the [quota template](https://istio.io/docs/reference/config/policy-and-telemetry/templates/quota/).
package adapter.denier.config;

import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "google/rpc/status.proto";

option go_package="config";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = false;
option (gogoproto.gostring_all) = false;

// Configuration format for the Denier adapter.
message Params {
	// The error to return when denying a request.
	google.rpc.Status status = 1 [(gogoproto.nullable) = false];

	// The duration for which the denial is valid.
	google.protobuf.Duration valid_duration = 2 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true];

	// The number of times the denial may be used.
	int32 valid_use_count = 3;
}
