Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Module("app", repos.NewFxMongoRepo[*entities.Account]("accounts", "acc", entities.AccountIndices), repos.NewFxMongoRepo[*entities.Invitation]("invitations", "invite", entities.InvitationIndices), fx.Provide(func(client AuthCacheClient) kv.Repo[*entities.Invitation] { return kv.NewRepo[*entities.Invitation](client) }), fx.Provide(func(conn ConsoleClient) console.ConsoleClient { return console.NewConsoleClient(conn) }), fx.Provide(func(conn IAMClient) iam.IAMClient { return iam.NewIAMClient(conn) }), fx.Provide(func(conn CommsClient) comms.CommsClient { return comms.NewCommsClient(conn) }), fx.Provide(func(conn AuthClient) auth.AuthClient { return auth.NewAuthClient(conn) }), fx.Provide(func(conn ContainerRegistryClient) container_registry.ContainerRegistryClient { return container_registry.NewContainerRegistryClient(conn) }), fx.Provide(func(d domain.Domain) accounts.AccountsServer { return &accountsGrpcServer{d: d} }), fx.Invoke(func(d domain.Domain, gserver AccountsGrpcServer) { registerAccountsGRPCServer(gserver, d) }), domain.Module, fx.Invoke( func(server httpServer.Server, d domain.Domain, env *env.Env, sessionRepo kv.Repo[*common.AuthSession]) { gqlConfig := generated.Config{Resolvers: graph.NewResolver(d)} gqlConfig.Directives.IsLoggedInAndVerified = func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) { sess := httpServer.GetSession[*common.AuthSession](ctx) if sess == nil { return nil, fiber.ErrUnauthorized } if !sess.UserVerified { return nil, fiber.ErrForbidden } return next(context.WithValue(ctx, "kloudlite-user-session", *sess)) } schema := generated.NewExecutableSchema(gqlConfig) server.SetupGraphqlServer(schema, httpServer.NewSessionMiddleware( sessionRepo, constants.CookieName, env.CookieDomain, constants.CacheSessionPrefix, ), ) }, ), )
Functions ¶
This section is empty.
Types ¶
type AccountsGrpcServer ¶
type AuthCacheClient ¶
type AuthClient ¶
type CommsClient ¶
type ConsoleClient ¶
type ContainerRegistryClient ¶
Click to show internal directories.
Click to hide internal directories.