server

package
v0.0.0-...-d983439 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 29 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UsersConfigs = map[string]func() UsersConfig{
	"mock": func() UsersConfig { return new(mock.Config) },
	"dex":  func() UsersConfig { return new(dex.Config) },
}

UsersConfigs variable provides an easy way to return a config struct depending on the users adapter type.

Functions

This section is empty.

Types

type Config

type Config struct {
	A1UserData      string
	A1UserRolesData string
	Logger          *zap.Logger
	Users           UsersConfig
	ServiceCerts    *certs.ServiceCerts
	TeamsAddress    string
	AuthzAddress    string
}

Config holds the server's configuration options.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the top level object.

func NewServer

func NewServer(ctx context.Context, c Config) (*Server, error)

NewServer constructs a server from the provided config.

func (*Server) CreateUser

func (s *Server) CreateUser(ctx context.Context, req *local_user.CreateUserReq) (*local_user.User, error)

CreateUser adds a user with a generated UUID to dex

func (*Server) DeleteUser

func (s *Server) DeleteUser(ctx context.Context, req *local_user.Email) (*local_user.DeleteUserResp, error)

DeleteUser deletes user from dex

func (*Server) GRPC

func (s *Server) GRPC(addr string) error

GRPC serves the GRPC API for all services. On success, it never returns.

func (*Server) GetUser

func (s *Server) GetUser(ctx context.Context, req *local_user.Email) (*local_user.User, error)

GetUser fetches user by email, which dex uses as unique identifier

func (*Server) GetUsers

func (s *Server) GetUsers(ctx context.Context, _ *local_user.GetUsersReq) (*local_user.Users, error)

GetUsers fetches hash of users, implemented without wrapping usersAPI struct

func (*Server) MigrateA1UserRoles

func (s *Server) MigrateA1UserRoles(ctx context.Context) error

func (*Server) MigrateA1Users

func (s *Server) MigrateA1Users(ctx context.Context) error

func (*Server) NewGRPCServer

func (s *Server) NewGRPCServer() *grpc.Server

NewGRPCServer returns a server that provides our services: clients, users, and authentication requests.

func (*Server) UpdateSelf

func (s *Server) UpdateSelf(ctx context.Context, req *local_user.UpdateSelfReq) (*local_user.User, error)

UpdateSelf updates the user's name and, optionally, password. If password is updated, the user must provide the previous_password.

func (*Server) UpdateUser

func (s *Server) UpdateUser(ctx context.Context, req *local_user.UpdateUserReq) (*local_user.User, error)

UpdateUser updates the user's name and, optionally, password.

type UsersConfig

type UsersConfig interface {
	Open(*zap.Logger, *certs.ServiceCerts) (users.Adapter, error)
}

UsersConfig is a configuration that can open a users adapter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL