From 388a1480b040245db57176c3e45cf668d16c3a20 Mon Sep 17 00:00:00 2001 From: andig Date: Wed, 1 Apr 2026 19:32:08 +0200 Subject: [PATCH] chore: minor --- plugin/auth/config.go | 7 +++++++ plugin/auth/registry.go | 12 ------------ 2 files changed, 7 insertions(+), 12 deletions(-) delete mode 100644 plugin/auth/registry.go diff --git a/plugin/auth/config.go b/plugin/auth/config.go index 38f8abf86..087241da3 100644 --- a/plugin/auth/config.go +++ b/plugin/auth/config.go @@ -6,9 +6,16 @@ import ( "strings" "github.com/evcc-io/evcc/util" + reg "github.com/evcc-io/evcc/util/registry" "golang.org/x/oauth2" ) +var registry = reg.New[oauth2.TokenSource]("auth") + +func Register(typ string, fun func(map[string]any) (oauth2.TokenSource, error)) { + registry.Add(typ, fun) +} + // NewFromConfig creates auth from configuration func NewFromConfig(ctx context.Context, typ string, other map[string]any) (oauth2.TokenSource, error) { factory, err := registry.Get(strings.ToLower(typ)) diff --git a/plugin/auth/registry.go b/plugin/auth/registry.go deleted file mode 100644 index 63c694370..000000000 --- a/plugin/auth/registry.go +++ /dev/null @@ -1,12 +0,0 @@ -package auth - -import ( - reg "github.com/evcc-io/evcc/util/registry" - "golang.org/x/oauth2" -) - -var registry = reg.New[oauth2.TokenSource]("auth") - -func Register(typ string, fun func(map[string]any) (oauth2.TokenSource, error)) { - registry.Add(typ, fun) -}