From dedeb1074592081a3f9b1f113ff8dfc79d9d5136 Mon Sep 17 00:00:00 2001 From: Artem Date: Tue, 24 Sep 2024 12:52:23 +0300 Subject: [PATCH] Feature: add header api key to datasource config --- config/credentials.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/credentials.go b/config/credentials.go index a0df8d2..6f52fbe 100644 --- a/config/credentials.go +++ b/config/credentials.go @@ -2,7 +2,8 @@ package config // Credentials - type Credentials struct { - User *UserCredentials `yaml:"user,omitempty" validate:"omitempty"` + User *UserCredentials `yaml:"user,omitempty" validate:"omitempty"` + ApiKey *ApiKey `yaml:"api_key,omitempty" validate:"omitempty"` } // UserCredentials - @@ -10,3 +11,8 @@ type UserCredentials struct { Name string `yaml:"name" validate:"required"` Password string `yaml:"password" validate:"required"` } + +type ApiKey struct { + Header string `yaml:"header" validate:"required"` + Key string `yaml:"key" validate:"required"` +}