Skip to content

Commit

Permalink
debug useauth
Browse files Browse the repository at this point in the history
  • Loading branch information
ddl-rliu committed Mar 20, 2024
1 parent b48bbe6 commit 7556640
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions flyteadmin/pkg/server/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func serveGatewayInsecure(ctx context.Context, pluginRegistry *plugins.Registry,
authCfg *authConfig.Config, storageConfig *storage.Config,
additionalHandlers map[string]func(http.ResponseWriter, *http.Request),
scope promutils.Scope) error {
logger.Infof(ctx, "Serving Flyte Admin Insecure !")
logger.Infof(ctx, "Serving Flyte Admin Insecure !!")

// This will parse configuration and create the necessary objects for dealing with auth
var authCtx interfaces.AuthenticationContext
Expand All @@ -320,14 +320,15 @@ func serveGatewayInsecure(ctx context.Context, pluginRegistry *plugins.Registry,
// Envoy does the SSL termination. The final hop is made over localhost only on a trusted machine.
// Warning: Running authentication without SSL in any other topology is a severe security flaw.
// See the auth.Config object for additional settings as well.
logger.Infof(ctx, "! %v", cfg)
logger.Infof(ctx, "! %v", cfg.Security.UseAuth)
logger.Infof(ctx, "!! %v", cfg)
logger.Infof(ctx, "!! %v", cfg.Security.UseAuth)
if cfg.Security.UseAuth {
sm := secretmanager.NewFileEnvSecretManager(secretmanager.GetConfig())
var oauth2Provider interfaces.OAuth2Provider
var oauth2ResourceServer interfaces.OAuth2ResourceServer
logger.Infof(ctx, "! %v", authCfg.AppAuth.AuthServerType)
logger.Infof(ctx, "! %v", authCfg)
logger.Infof(ctx, "!! %v", authCfg.AppAuth.AuthServerType)
logger.Infof(ctx, "!! %v", authConfig.AuthorizationServerTypeSelf)
logger.Infof(ctx, "!! %v", authCfg)
if authCfg.AppAuth.AuthServerType == authConfig.AuthorizationServerTypeSelf {
oauth2Provider, err = authzserver.NewProvider(ctx, authCfg.AppAuth.SelfAuthServer, sm)
if err != nil {
Expand All @@ -347,6 +348,7 @@ func serveGatewayInsecure(ctx context.Context, pluginRegistry *plugins.Registry,
oauth2MetadataProvider := authzserver.NewService(authCfg)
oidcUserInfoProvider := auth.NewUserInfoProvider()

logger.Infof(ctx, "! %v", oauth2Provider)
authCtx, err = auth.NewAuthenticationContext(ctx, sm, oauth2Provider, oauth2ResourceServer, oauth2MetadataProvider, oidcUserInfoProvider, authCfg)
if err != nil {
logger.Errorf(ctx, "Error creating auth context %s", err)
Expand Down

0 comments on commit 7556640

Please sign in to comment.