add authentication endpoints and Redis integration

This commit is contained in:
2025-08-06 02:58:15 +03:00
parent deab475eab
commit 416fefdb6b
14 changed files with 340 additions and 530 deletions

View File

@ -0,0 +1,28 @@
package hydra_client
import (
"git.logidex.ru/fakz9/logidex-id/internal/config"
hydraApi "github.com/ory/hydra-client-go"
"sync"
)
var (
client *hydraApi.APIClient
initClient sync.Once
)
func InitClient() {
cfg := hydraApi.NewConfiguration()
cfg.AddDefaultHeader("X-Secret", config.Cfg.Hydra.Password)
cfg.Servers = []hydraApi.ServerConfiguration{
{
URL: config.Cfg.Hydra.Host,
},
}
client = hydraApi.NewAPIClient(cfg)
}
func GetClient() *hydraApi.APIClient {
initClient.Do(InitClient)
return client
}