syntax = "proto3";

option go_package = "github.com/kong/koko/internal/gen/wrpc/kong/model;model";

package kong.model;

import "kong/model/consumer.proto";

message PluginData {
  repeated KeyAuth key_auths = 1;
  repeated BasicAuth basic_auths = 2;
  repeated HMACAuth hmac_auths = 3;
  repeated JWTAuth jwt_auths = 4;
  repeated MTLSAuth mtls_auths = 5;
  repeated ACLGroup acls = 6;
}

message BasicAuth {
  string id = 1;
  string username = 2;
  string password = 3;
  Consumer consumer = 4;
  int32 created_at = 5;
  repeated string tags = 6;
}

message KeyAuth {
  string id = 1;
  string key = 2;
  int32 ttl = 3;
  Consumer consumer = 4;
  int32 created_at = 5;
  repeated string tags = 6;
}


message MTLSAuth {
  string id = 1;
  string subject_name = 2;
  string ca_certificate_id = 3;
  int32 created_at = 4;
  Consumer consumer = 5;
  repeated string tags = 6;
}
message ACLGroup {
  string id = 1;
  string group = 2;
  Consumer consumer = 3;
  int32 created_at = 4;
  repeated string tags = 5;
}

message HMACAuth {
  string id = 1;
  string username = 2;
  string secret = 3;
  string consumer_id = 4;
  int32 created_at = 5;
  repeated string tags = 6;
}

message JWTAuth {
  string id = 1;
  string algorithm = 2;
  string key = 3;
  string rsa_public_key = 4;
  string secret = 5;
  Consumer consumer = 6;
  int32 created_at = 7;
  repeated string tags = 8;
}

