1
0
mirror of https://github.com/lxc/incus.git synced 2026-02-05 09:46:19 +01:00

[lxd-import] client: Replaces 'oidc' string with constant.

Signed-off-by: Mark Laing <mark.laing@canonical.com>
This commit is contained in:
Mark Laing
2023-10-24 12:58:36 +01:00
committed by Stéphane Graber
parent 2753c5f0b3
commit 7cd2924a7d

View File

@@ -14,6 +14,7 @@ import (
"github.com/gorilla/websocket"
"github.com/zitadel/oidc/v2/pkg/oidc"
"github.com/lxc/incus/shared/api"
"github.com/lxc/incus/shared/logger"
"github.com/lxc/incus/shared/simplestreams"
"github.com/lxc/incus/shared/util"
@@ -336,7 +337,7 @@ func httpsIncus(ctx context.Context, requestURL string, args *ConnectionArgs) (I
eventListeners: make(map[string][]*EventListener),
}
if util.ValueInSlice(args.AuthType, []string{"oidc"}) {
if util.ValueInSlice(args.AuthType, []string{api.AuthenticationMethodOIDC}) {
server.RequireAuthenticated(true)
}
@@ -351,7 +352,7 @@ func httpsIncus(ctx context.Context, requestURL string, args *ConnectionArgs) (I
}
server.http = httpClient
if args.AuthType == "oidc" {
if args.AuthType == api.AuthenticationMethodOIDC {
server.setupOIDCClient(args.OIDCTokens)
}