syntax = "proto3";

// If you make any changes make sure you run: make regenerate-proto

package gitlab.agent.kubernetes_api;

option go_package = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v18/internal/module/kubernetes_api";

import "buf/validate/validate.proto";

// ImpersonationConfig is a representation of client-go rest.ImpersonationConfig.
// See https://github.com/kubernetes/client-go/blob/release-1.22/rest/config.go#L201-L210
message ImpersonationConfig {
  string username = 1 [(buf.validate.field).string.min_bytes = 1];
  repeated string groups = 2 [(buf.validate.field).repeated.items.string.min_bytes = 1];
  // Optional. UID is a unique value that identifies the user.
  string uid = 3;
  repeated ExtraKeyVal extra = 4;
}

message ExtraKeyVal {
  string key = 1 [(buf.validate.field).string.min_bytes = 1];
  repeated string val = 2 [(buf.validate.field).repeated.items.string.min_bytes = 1, (buf.validate.field).repeated.min_items = 1];
}
