// Copyright 2018 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";

// adapter config for policy backend.
package policy;

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

option go_package="policy";

// Config for policy backend, which could be used as a fake adapter for integration test,
// supports checknothing and keyval template.
message Params {
  // Check params which controls check result returned by policy backend.
  message CheckParams {
    // Controls that request should be allowed or not.
    bool check_allow = 1;

    // Valid duration of the check result.
    google.protobuf.Duration valid_duration = 2;

    // Valid request count of the check result.
    int64 valid_count = 3;
  }

  // Specify check related params.
  CheckParams check_params = 1;

  // Specify route directive related params.
  map<string, string> table = 2;
}
