Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat(hive): support kerberos (#12505)
Azusaina94f256ce103
diff --git a/backend/component/dbfactory/dbfactory.go b/backend/component/dbfactory/dbfactory.goindex ec1b51c518..17e5d5d5db 100644--- a/backend/component/dbfactory/dbfactory.go+++ b/backend/component/dbfactory/dbfactory.go@@ -189,6 +189,7 @@ func (d *DBFactory) GetDataSourceDriver(ctx context.Context, instance *store.InsKDCPort: t.KrbConfig.KdcPort,KDCTransportProtocol: t.KrbConfig.KdcTransportProtocol,},+ Keytab: t.KrbConfig.Keytab,}default:dbSaslConfig = nildiff --git a/backend/plugin/db/hive/hive.go b/backend/plugin/db/hive/hive.goindex 61fe2b21dd..d181a7a6ff 100644--- a/backend/plugin/db/hive/hive.go+++ b/backend/plugin/db/hive/hive.go@@ -61,6 +61,10 @@ func (d *Driver) Open(_ context.Context, _ storepb.Engine, config db.ConnectionCif !config.SASLConfig.Check() {return nil, errors.New("SASL settings error")}++ db.KrbEnvLock()+ defer db.KrbEnvUnlock()+if err := config.SASLConfig.InitEnv(); err != nil {return nil, errors.Wrapf(err, "failed to init SASL environment")}diff --git a/backend/plugin/db/hive/hive_conn_pool.go b/backend/plugin/db/hive/hive_conn_pool.goindex 15e76fea97..47a5f1caba 100644--- a/backend/plugin/db/hive/hive_conn_pool.go+++ b/backend/plugin/db/hive/hive_conn_pool.go@@ -51,7 +51,7 @@ func CreateHiveConnPool(switch t := config.SASLConfig.(type) {case *db.KerberosConfig:// Kerberos.- hiveConfig.Hostname = config.Host+ hiveConfig.Hostname = t.InstancehiveConfig.Service = t.Primarycase *db.PlainSASLConfig:// Plain.@@ -63,8 +63,24 @@ func CreateHiveConnPool(for i := 0; i < numMaxConn; i++ {conn, err := gohive.Connect(config.Host, port, config.SASLConfig.GetTypeName(), hiveConfig)- if err != nil {- return nil, errors.Wrapf(err, "failed to create Hive connection")+ // release resources if err.+ if err != nil || conn == nil {+ if err == nil {+ err = errors.New("failed to create Hive connection pool")+ } else {+ err = errors.Wrapf(err, "failed to create Hive connection pool")+ }+ var errWhenClose error+ close(conns)+ for conn := range conns {+ if err := conn.Close(); err != nil {+ errWhenClose = err+ }+ }+ if errWhenClose != nil {+ err = errors.Wrapf(err, "failed to release Hive connection")+ }+ return nil, err}conns <- conn}@@ -99,7 +115,7 @@ func (pool *FixedConnPool) Get(dbName string) (*gohive.Connection, error) {var err errorconn, err = gohive.Connect(pool.Host, pool.Port, pool.SASLConfig.GetTypeName(), pool.HiveConfig)if err != nil {- return nil, errors.Wrapf(err, "failed to create Hive connection")+ return nil, errors.Wrapf(err, "failed to get Hive connection")}}diff --git a/backend/plugin/db/sasl.go b/backend/plugin/db/sasl.goindex 6279b9fdf4..679baca090 100644--- a/backend/plugin/db/sasl.go+++ b/backend/plugin/db/sasl.go@@ -4,6 +4,7 @@ import ("fmt""os""os/exec"+ "strings""sync""github.com/pkg/errors"@@ -23,100 +24,136 @@ type Realm struct {KDCTransportProtocol string}type KerberosConfig struct {- Primary string- Instance string- Realm Realm- KeytabPath string+ Primary string+ Instance string+ Realm Realm+ Keytab []byte}type KerberosEnv struct {- krbEnvMutex *sync.Mutex- DefaultKrbConfPath string- realms map[string]Realm+ krbEnvMutex *sync.Mutex+ KrbConfPath string+ KeytabPath string+ KinitBinPath string+ realms map[string]Realm}var (_ SASLConfig = &KerberosConfig{}singletonEnv = KerberosEnv{- DefaultKrbConfPath: "/etc/krb5.conf",+ KrbConfPath: "/tmp/krb5.conf",+ KeytabPath: "/tmp/tmp.keytab",+ // be careful of your environment variables.+ KinitBinPath: "kinit",+ realms: map[string]Realm{},+ krbEnvMutex: &sync.Mutex{},}- // KinitCmdFmt is the cmd for kinit, should be- // kinit -kt {keytab file path} {principal}- // The principal is in {primary}/{instance}@{realm} or {primary}@{realm} format- // example: 'root/[email protected]' or '[email protected]'.- KinitCmdFmt = "kinit -kt %s %s@%s"- // KrbConfRealmFmt is the config content for /etc/krb5.conf, it should like- // [realms] {realm} = { kdc = [service/]host[:port]- // example:- // [realm]- // EXAMPLE.COM = {- // kdc = tcp/192.168.31.2:88++ // The principal is in {primary}/{instance}@{realm} or {primary}@{realm} format, for example:+ // 'root/[email protected]' or '[email protected]'.+ PrincipalWithoutInstanceFmt = "%s@%s"+ PrincipalWithInstanceFmt = "%s/%s@%s"+ // KrbConfRealmFmt is the content format for krb5.conf, for example:+ // [realms]+ // {realm} = {+ // kdc = {transport_protocol}/{host}:{port}// }- KrbConfRealmFmt = "%s = {\n\tkdc = %s/%s:%s\n}"+ KrbConfRealmKeyword = "[realms]"+ KrbConfRealmFmt = "\t%s = {\n\t\tkdc = %s%s:%s\n\t}\n"+ // We have to specify the path of 'krb5.conf' for the 'kinit' command.+ KrbConfEnvVarFmt = "KRB5_CONFIG=%s")+// let users manually solve the resource competition problem.+func KrbEnvLock() {+ singletonEnv.krbEnvMutex.Lock()+}++func KrbEnvUnlock() {+ singletonEnv.krbEnvMutex.Unlock()+}+func (krbConfig *KerberosConfig) InitEnv() error {+ // KDCs can use either 'tcp' or 'udp' as their transport protocol.if krbConfig.Realm.KDCTransportProtocol != "udp" && krbConfig.Realm.KDCTransportProtocol != "tcp" {return errors.Errorf("invalid transport protocol for KDC connection: %s", krbConfig.Realm.KDCTransportProtocol)}- singletonEnv.krbEnvMutex.Lock()- defer singletonEnv.krbEnvMutex.Unlock()-+ // Create tmp krb5.conf.if err := singletonEnv.AddRealm(krbConfig.Realm); err != nil {return err}- var cmdString string- if krbConfig.Instance != "" {- cmdString = fmt.Sprintf(KinitCmdFmt, krbConfig.KeytabPath, krbConfig.Primary, krbConfig.Realm.Name)+ // Save .keytab file as a temporary file.+ if err := func() error {+ keytabFile, err := os.Create(singletonEnv.KeytabPath)+ if err != nil {+ return err+ }+ defer keytabFile.Close()+ if n, err := keytabFile.Write(krbConfig.Keytab); err != nil || n != len(krbConfig.Keytab) {+ return err+ }+ return keytabFile.Sync()+ }(); err != nil {+ return err+ }++ // kinit -kt {keytab file path} {principal}.+ var cmd *exec.Cmd+ var principal string+ if krbConfig.Instance == "" {+ principal = fmt.Sprintf(PrincipalWithoutInstanceFmt, krbConfig.Primary, krbConfig.Realm.Name)} else {- primaryAndInstance := fmt.Sprintf("%s/%s", krbConfig.Primary, krbConfig.Instance)- cmdString = fmt.Sprintf(KinitCmdFmt, krbConfig.KeytabPath, primaryAndInstance, krbConfig.Realm.Name)+ principal = fmt.Sprintf(PrincipalWithInstanceFmt, krbConfig.Primary, krbConfig.Instance, krbConfig.Realm.Name)}+ args := []string{+ fmt.Sprintf(KrbConfEnvVarFmt, singletonEnv.KrbConfPath),+ "kinit",+ "-kt",+ singletonEnv.KeytabPath,+ principal,+ }+ cmd = exec.Command("bash", "-c", strings.Join(args, " "))- cmd := exec.Command(cmdString)- if err := cmd.Run(); err != nil {- return errors.Wrapf(err, "failed to execute command kinit")+ if output, err := cmd.CombinedOutput(); err != nil {+ return errors.Wrapf(err, fmt.Sprintf("failed to execute command kinit: %s", output))}return nil}-func (env *KerberosEnv) AddRealm(realm Realm) error {- // Sync configurations with local krb5.conf if current realm does not exist.- _, ok := env.realms[realm.Name]- if !ok {- env.realms[realm.Name] = realm+func (*KerberosEnv) AddRealm(realm Realm) error {+ // Create a krb5.conf file.+ file, err := os.Create(singletonEnv.KrbConfPath)+ if err != nil {+ return err+ }+ defer file.Close()- // Create krb5.cnof file.- file, err := os.Create(singletonEnv.DefaultKrbConfPath)- if err != nil {- return err- }- defer file.Close()+ // Write configurations.+ if _, err = file.WriteString(fmt.Sprintf("%s\n", KrbConfRealmKeyword)); err != nil {+ return err+ }- // Write configurations.- if _, err = file.WriteString("[realms]\n"); err != nil {- return err- }- for _, realm := range env.realms {- text := fmt.Sprintf(KrbConfRealmFmt, realm.Name, realm.KDCTransportProtocol, realm.KDCHost, realm.KDCPort)- if _, err = file.WriteString(text); err != nil {- return err- }- if err = file.Sync(); err != nil {- return err- }- }+ var kdcConnStr string+ if realm.KDCTransportProtocol == "tcp" {+ // This will force kinit client to communicate with KDC over tcp as Mac+ // doesn't has fall-down mechanism if it fails to communicate over udp.+ kdcConnStr = fmt.Sprintf(KrbConfRealmFmt, realm.Name, "tcp/", realm.KDCHost, realm.KDCPort)+ } else {+ kdcConnStr = fmt.Sprintf(KrbConfRealmFmt, realm.Name, "", realm.KDCHost, realm.KDCPort)+ }+ if _, err = file.WriteString(kdcConnStr); err != nil {+ return err}- return nil+ return file.Sync()}// check whether Kerberos is enabled and its settings are valid.func (krbConfig *KerberosConfig) Check() bool {- if krbConfig.Primary == "" || krbConfig.Instance == "" || krbConfig.Realm.Name == "" || krbConfig.KeytabPath == "" || krbConfig.Realm.KDCTransportProtocol == "" {+ if krbConfig.Primary == "" || krbConfig.Realm.Name == "" || len(krbConfig.Keytab) == 0 || krbConfig.Realm.KDCTransportProtocol == "" {return false}return truediff --git a/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue b/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vueindex ccdf8fa5b2..af280226e6 100644--- a/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue+++ b/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue@@ -86,7 +86,7 @@KDC<span class="text-red-600">*</span></label>- <div class="flex mt-2 items-center space-x-2">+ <div class="flex items-center space-x-2"><div class="w-fit"><NRadioGroupv-model:value="@@ -115,15 +115,17 @@</div><div class="mt-4 sm:col-span-3 sm:col-start-1"><label class="textlabel block">- Keytab File Path+ Keytab File<span class="text-red-600">*</span></label>- <NInput- v-model:value="dataSource.saslConfig.krbConfig.keytab"- class="mt-2 w-full"- :disabled="!allowEdit"- placeholder="keytab file path"- />++ <NUpload :max="1" @change="handleKeytabUpload">+ <NUploadDragger class="mt-3">+ <span class="text-gray-400"+ >Click or Drag your .keytab file here</span+ >+ </NUploadDragger>+ </NUpload></div></div><div v-else class="sm:col-span-3 sm:col-start-1">@@ -774,7 +776,16 @@ MIIEvQ...</template><script setup lang="ts">-import { NButton, NRadioGroup, NRadio, NCheckbox, NInput } from "naive-ui";+import {+ NButton,+ NRadioGroup,+ NRadio,+ NCheckbox,+ NInput,+ NUpload,+ NUploadDragger,+ type UploadFileInfo,+} from "naive-ui";import { watch, reactive, computed, ref } from "vue";import { useI18n } from "vue-i18n";import type { DataSourceOptions } from "@/types/dataSource";@@ -1049,4 +1060,18 @@ watch(ds.updateAuthenticationPrivateKey = true;});++const handleKeytabUpload = (options: { file: UploadFileInfo }) => {+ const reader = new FileReader();+ reader.onload = function () {+ const arrayBuffer = reader.result as ArrayBuffer;+ const data = new Uint8Array(arrayBuffer);+ const ds = props.dataSource;+ if (ds.saslConfig && ds.saslConfig.krbConfig) {+ console.log(data);+ ds.saslConfig.krbConfig.keytab = data;+ }+ };+ reader.readAsArrayBuffer(options.file.file as Blob);+};</script>diff --git a/frontend/src/types/proto/store/data_source.ts b/frontend/src/types/proto/store/data_source.tsindex c78b54384e..a9ff5a0a5a 100644--- a/frontend/src/types/proto/store/data_source.ts+++ b/frontend/src/types/proto/store/data_source.ts@@ -326,7 +326,7 @@ export interface KerberosConfig {primary: string;instance: string;realm: string;- keytab: string;+ keytab: Uint8Array;kdcHost: string;kdcPort: string;kdcTransportProtocol: string;@@ -1125,7 +1125,15 @@ export const SASLConfig = {};function createBaseKerberosConfig(): KerberosConfig {- return { primary: "", instance: "", realm: "", keytab: "", kdcHost: "", kdcPort: "", kdcTransportProtocol: "" };+ return {+ primary: "",+ instance: "",+ realm: "",+ keytab: new Uint8Array(0),+ kdcHost: "",+ kdcPort: "",+ kdcTransportProtocol: "",+ };}export const KerberosConfig = {@@ -1139,8 +1147,8 @@ export const KerberosConfig = {if (message.realm !== "") {writer.uint32(26).string(message.realm);}- if (message.keytab !== "") {- writer.uint32(34).string(message.keytab);+ if (message.keytab.length !== 0) {+ writer.uint32(34).bytes(message.keytab);}if (message.kdcHost !== "") {writer.uint32(42).string(message.kdcHost);@@ -1187,7 +1195,7 @@ export const KerberosConfig = {break;}- message.keytab = reader.string();+ message.keytab = reader.bytes();continue;case 5:if (tag !== 42) {@@ -1224,7 +1232,7 @@ export const KerberosConfig = {primary: isSet(object.primary) ? globalThis.String(object.primary) : "",instance: isSet(object.instance) ? globalThis.String(object.instance) : "",realm: isSet(object.realm) ? globalThis.String(object.realm) : "",- keytab: isSet(object.keytab) ? globalThis.String(object.keytab) : "",+ keytab: isSet(object.keytab) ? bytesFromBase64(object.keytab) : new Uint8Array(0),kdcHost: isSet(object.kdcHost) ? globalThis.String(object.kdcHost) : "",kdcPort: isSet(object.kdcPort) ? globalThis.String(object.kdcPort) : "",kdcTransportProtocol: isSet(object.kdcTransportProtocol) ? globalThis.String(object.kdcTransportProtocol) : "",@@ -1242,8 +1250,8 @@ export const KerberosConfig = {if (message.realm !== "") {obj.realm = message.realm;}- if (message.keytab !== "") {- obj.keytab = message.keytab;+ if (message.keytab.length !== 0) {+ obj.keytab = base64FromBytes(message.keytab);}if (message.kdcHost !== "") {obj.kdcHost = message.kdcHost;@@ -1265,7 +1273,7 @@ export const KerberosConfig = {message.primary = object.primary ?? "";message.instance = object.instance ?? "";message.realm = object.realm ?? "";- message.keytab = object.keytab ?? "";+ message.keytab = object.keytab ?? new Uint8Array(0);message.kdcHost = object.kdcHost ?? "";message.kdcPort = object.kdcPort ?? "";message.kdcTransportProtocol = object.kdcTransportProtocol ?? "";@@ -1273,6 +1281,31 @@ export const KerberosConfig = {},};+function bytesFromBase64(b64: string): Uint8Array {+ if (globalThis.Buffer) {+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));+ } else {+ const bin = globalThis.atob(b64);+ const arr = new Uint8Array(bin.length);+ for (let i = 0; i < bin.length; ++i) {+ arr[i] = bin.charCodeAt(i);+ }+ return arr;+ }+}++function base64FromBytes(arr: Uint8Array): string {+ if (globalThis.Buffer) {+ return globalThis.Buffer.from(arr).toString("base64");+ } else {+ const bin: string[] = [];+ arr.forEach((byte) => {+ bin.push(globalThis.String.fromCharCode(byte));+ });+ return globalThis.btoa(bin.join(""));+ }+}+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;export type DeepPartial<T> = T extends Builtin ? Tdiff --git a/frontend/src/types/proto/v1/instance_service.ts b/frontend/src/types/proto/v1/instance_service.tsindex 159a2e3e98..330cf67228 100644--- a/frontend/src/types/proto/v1/instance_service.ts+++ b/frontend/src/types/proto/v1/instance_service.ts@@ -640,7 +640,7 @@ export interface KerberosConfig {primary: string;instance: string;realm: string;- keytab: string;+ keytab: Uint8Array;kdcHost: string;kdcPort: string;kdcTransportProtocol: string;@@ -3221,7 +3221,15 @@ export const SASLConfig = {};function createBaseKerberosConfig(): KerberosConfig {- return { primary: "", instance: "", realm: "", keytab: "", kdcHost: "", kdcPort: "", kdcTransportProtocol: "" };+ return {+ primary: "",+ instance: "",+ realm: "",+ keytab: new Uint8Array(0),+ kdcHost: "",+ kdcPort: "",+ kdcTransportProtocol: "",+ };}export const KerberosConfig = {@@ -3235,8 +3243,8 @@ export const KerberosConfig = {if (message.realm !== "") {writer.uint32(26).string(message.realm);}- if (message.keytab !== "") {- writer.uint32(34).string(message.keytab);+ if (message.keytab.length !== 0) {+ writer.uint32(34).bytes(message.keytab);}if (message.kdcHost !== "") {writer.uint32(42).string(message.kdcHost);@@ -3283,7 +3291,7 @@ export const KerberosConfig = {break;}- message.keytab = reader.string();+ message.keytab = reader.bytes();continue;case 5:if (tag !== 42) {@@ -3320,7 +3328,7 @@ export const KerberosConfig = {primary: isSet(object.primary) ? globalThis.String(object.primary) : "",instance: isSet(object.instance) ? globalThis.String(object.instance) : "",realm: isSet(object.realm) ? globalThis.String(object.realm) : "",- keytab: isSet(object.keytab) ? globalThis.String(object.keytab) : "",+ keytab: isSet(object.keytab) ? bytesFromBase64(object.keytab) : new Uint8Array(0),kdcHost: isSet(object.kdcHost) ? globalThis.String(object.kdcHost) : "",kdcPort: isSet(object.kdcPort) ? globalThis.String(object.kdcPort) : "",kdcTransportProtocol: isSet(object.kdcTransportProtocol) ? globalThis.String(object.kdcTransportProtocol) : "",@@ -3338,8 +3346,8 @@ export const KerberosConfig = {if (message.realm !== "") {obj.realm = message.realm;}- if (message.keytab !== "") {- obj.keytab = message.keytab;+ if (message.keytab.length !== 0) {+ obj.keytab = base64FromBytes(message.keytab);}if (message.kdcHost !== "") {obj.kdcHost = message.kdcHost;@@ -3361,7 +3369,7 @@ export const KerberosConfig = {message.primary = object.primary ?? "";message.instance = object.instance ?? "";message.realm = object.realm ?? "";- message.keytab = object.keytab ?? "";+ message.keytab = object.keytab ?? new Uint8Array(0);message.kdcHost = object.kdcHost ?? "";message.kdcPort = object.kdcPort ?? "";message.kdcTransportProtocol = object.kdcTransportProtocol ?? "";@@ -4177,6 +4185,31 @@ export const InstanceServiceDefinition = {},} as const;+function bytesFromBase64(b64: string): Uint8Array {+ if (globalThis.Buffer) {+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));+ } else {+ const bin = globalThis.atob(b64);+ const arr = new Uint8Array(bin.length);+ for (let i = 0; i < bin.length; ++i) {+ arr[i] = bin.charCodeAt(i);+ }+ return arr;+ }+}++function base64FromBytes(arr: Uint8Array): string {+ if (globalThis.Buffer) {+ return globalThis.Buffer.from(arr).toString("base64");+ } else {+ const bin: string[] = [];+ arr.forEach((byte) => {+ bin.push(globalThis.String.fromCharCode(byte));+ });+ return globalThis.btoa(bin.join(""));+ }+}+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;export type DeepPartial<T> = T extends Builtin ? Tdiff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yamlindex c0bf139fbd..e94ba37c3c 100644--- a/proto/gen/grpc-doc/openapi.yaml+++ b/proto/gen/grpc-doc/openapi.yaml@@ -10571,6 +10571,7 @@ components:type: stringkeytab:type: string+ format: byteskdcHost:type: stringkdcPort:diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex 437487fac3..7a4b98cc97 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -1794,7 +1794,7 @@ PostgreSQL: RANGE, LIST, HASH (https://www.postgresql.org/docs/current/ddl-parti| primary | [string](#string) | | || instance | [string](#string) | | || realm | [string](#string) | | |-| keytab | [string](#string) | | |+| keytab | [bytes](#bytes) | | || kdc_host | [string](#string) | | || kdc_port | [string](#string) | | || kdc_transport_protocol | [string](#string) | | |diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.htmlindex 88f0a9ca52..fd3f85864d 100644--- a/proto/gen/grpc-doc/store/index.html+++ b/proto/gen/grpc-doc/store/index.html@@ -5058,7 +5058,7 @@ Used for authentication when connecting to the data source. </p></td><tr><td>keytab</td>- <td><a href="#string">string</a></td>+ <td><a href="#bytes">bytes</a></td><td></td><td><p> </p></td></tr>diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex f3edb0b31c..7c6bd69f06 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -1817,7 +1817,7 @@ InstanceOptions is the option for instances.| primary | [string](#string) | | || instance | [string](#string) | | || realm | [string](#string) | | |-| keytab | [string](#string) | | |+| keytab | [bytes](#bytes) | | || kdc_host | [string](#string) | | || kdc_port | [string](#string) | | || kdc_transport_protocol | [string](#string) | | |diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.htmlindex 958d9ae677..3580b998fd 100644--- a/proto/gen/grpc-doc/v1/index.html+++ b/proto/gen/grpc-doc/v1/index.html@@ -5839,7 +5839,7 @@ The default is 10 if the value is unset or zero. </p></td><tr><td>keytab</td>- <td><a href="#string">string</a></td>+ <td><a href="#bytes">bytes</a></td><td></td><td><p> </p></td></tr>diff --git a/proto/generated-go/store/data_source.pb.go b/proto/generated-go/store/data_source.pb.goindex 54fae16e9c..eead380a5c 100644--- a/proto/generated-go/store/data_source.pb.go+++ b/proto/generated-go/store/data_source.pb.go@@ -642,7 +642,7 @@ type KerberosConfig struct {Primary string `protobuf:"bytes,1,opt,name=primary,proto3" json:"primary,omitempty"`Instance string `protobuf:"bytes,2,opt,name=instance,proto3" json:"instance,omitempty"`Realm string `protobuf:"bytes,3,opt,name=realm,proto3" json:"realm,omitempty"`- Keytab string `protobuf:"bytes,4,opt,name=keytab,proto3" json:"keytab,omitempty"`+ Keytab []byte `protobuf:"bytes,4,opt,name=keytab,proto3" json:"keytab,omitempty"`KdcHost string `protobuf:"bytes,5,opt,name=kdc_host,json=kdcHost,proto3" json:"kdc_host,omitempty"`KdcPort string `protobuf:"bytes,6,opt,name=kdc_port,json=kdcPort,proto3" json:"kdc_port,omitempty"`KdcTransportProtocol string `protobuf:"bytes,7,opt,name=kdc_transport_protocol,json=kdcTransportProtocol,proto3" json:"kdc_transport_protocol,omitempty"`@@ -701,11 +701,11 @@ func (x *KerberosConfig) GetRealm() string {return ""}-func (x *KerberosConfig) GetKeytab() string {+func (x *KerberosConfig) GetKeytab() []byte {if x != nil {return x.Keytab}- return ""+ return nil}func (x *KerberosConfig) GetKdcHost() string {@@ -1000,7 +1000,7 @@ var file_store_data_source_proto_rawDesc = []byte{0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,0x05, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x74, 0x61, 0x62,- 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6b, 0x65, 0x79, 0x74, 0x61, 0x62, 0x12, 0x19,+ 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6b, 0x65, 0x79, 0x74, 0x61, 0x62, 0x12, 0x19,0x0a, 0x08, 0x6b, 0x64, 0x63, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,0x52, 0x07, 0x6b, 0x64, 0x63, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x64, 0x63,0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x64, 0x63,diff --git a/proto/generated-go/v1/instance_service.pb.go b/proto/generated-go/v1/instance_service.pb.goindex 5cc568de1a..34d44313e5 100644--- a/proto/generated-go/v1/instance_service.pb.go+++ b/proto/generated-go/v1/instance_service.pb.go@@ -2010,7 +2010,7 @@ type KerberosConfig struct {Primary string `protobuf:"bytes,1,opt,name=primary,proto3" json:"primary,omitempty"`Instance string `protobuf:"bytes,2,opt,name=instance,proto3" json:"instance,omitempty"`Realm string `protobuf:"bytes,3,opt,name=realm,proto3" json:"realm,omitempty"`- Keytab string `protobuf:"bytes,4,opt,name=keytab,proto3" json:"keytab,omitempty"`+ Keytab []byte `protobuf:"bytes,4,opt,name=keytab,proto3" json:"keytab,omitempty"`KdcHost string `protobuf:"bytes,5,opt,name=kdc_host,json=kdcHost,proto3" json:"kdc_host,omitempty"`KdcPort string `protobuf:"bytes,6,opt,name=kdc_port,json=kdcPort,proto3" json:"kdc_port,omitempty"`KdcTransportProtocol string `protobuf:"bytes,7,opt,name=kdc_transport_protocol,json=kdcTransportProtocol,proto3" json:"kdc_transport_protocol,omitempty"`@@ -2069,11 +2069,11 @@ func (x *KerberosConfig) GetRealm() string {return ""}-func (x *KerberosConfig) GetKeytab() string {+func (x *KerberosConfig) GetKeytab() []byte {if x != nil {return x.Keytab}- return ""+ return nil}func (x *KerberosConfig) GetKdcHost() string {@@ -2548,7 +2548,7 @@ var file_v1_instance_service_proto_rawDesc = []byte{0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12,0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,0x72, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x74, 0x61, 0x62, 0x18,- 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6b, 0x65, 0x79, 0x74, 0x61, 0x62, 0x12, 0x19, 0x0a,+ 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6b, 0x65, 0x79, 0x74, 0x61, 0x62, 0x12, 0x19, 0x0a,0x08, 0x6b, 0x64, 0x63, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,0x07, 0x6b, 0x64, 0x63, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x64, 0x63, 0x5f,0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x64, 0x63, 0x50,diff --git a/proto/store/data_source.proto b/proto/store/data_source.protoindex 0b2dd08205..fac758b8b7 100644--- a/proto/store/data_source.proto+++ b/proto/store/data_source.proto@@ -125,7 +125,7 @@ message KerberosConfig {string primary = 1;string instance = 2;string realm = 3;- string keytab = 4;+ bytes keytab = 4;string kdc_host = 5;string kdc_port = 6;string kdc_transport_protocol = 7;diff --git a/proto/v1/instance_service.proto b/proto/v1/instance_service.protoindex b3e38250c8..049653e4ae 100644--- a/proto/v1/instance_service.proto+++ b/proto/v1/instance_service.proto@@ -455,7 +455,7 @@ message KerberosConfig {string primary = 1;string instance = 2;string realm = 3;- string keytab = 4;+ bytes keytab = 4;string kdc_host = 5;string kdc_port = 6;string kdc_transport_protocol = 7;