Documentation
¶
Index ¶
- type Backend
- type Cache
- type Service
- func (s *Service) CreateUser(ctx context.Context, req *userspb.CreateUserRequest) (*userspb.CreateUserResponse, error)
- func (s *Service) DeleteUser(ctx context.Context, req *userspb.DeleteUserRequest) (*emptypb.Empty, error)
- func (s *Service) GetUser(ctx context.Context, req *userspb.GetUserRequest) (*userspb.GetUserResponse, error)
- func (s *Service) ListUsers(ctx context.Context, req *userspb.ListUsersRequest) (*userspb.ListUsersResponse, error)
- func (s *Service) UpdateUser(ctx context.Context, req *userspb.UpdateUserRequest) (*userspb.UpdateUserResponse, error)
- func (s *Service) UpsertUser(ctx context.Context, req *userspb.UpsertUserRequest) (*userspb.UpsertUserResponse, error)
- type ServiceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { // CreateUser creates user, only if the user entry does not exist CreateUser(ctx context.Context, user types.User) (types.User, error) // UpdateUser updates an existing user if revisions match. UpdateUser(ctx context.Context, user types.User) (types.User, error) // UpsertUser creates a new user or forcefully updates an existing user. UpsertUser(ctx context.Context, user types.User) (types.User, error) // DeleteRole deletes a role by name. DeleteRole(ctx context.Context, name string) error // DeleteUser deletes a user and all associated objects. DeleteUser(ctx context.Context, user string) error }
Backend is the subset of the backend resources that the Service modifies.
type Cache ¶
type Cache interface { // GetUser returns a user by name. GetUser(ctx context.Context, user string, withSecrets bool) (types.User, error) // ListUsers returns a page of users. ListUsers(ctx context.Context, pageSize int, nextToken string, withSecrets bool) ([]types.User, string, error) // GetRole returns a role by name. GetRole(ctx context.Context, name string) (types.Role, error) }
Cache is the subset of the cached resources that the Service queries.
type Service ¶
type Service struct { userspb.UnimplementedUsersServiceServer // contains filtered or unexported fields }
Service implements the teleport.users.v1.UsersService RPC service.
func NewService ¶
func NewService(cfg ServiceConfig) (*Service, error)
NewService returns a new users gRPC service.
func (*Service) CreateUser ¶
func (s *Service) CreateUser(ctx context.Context, req *userspb.CreateUserRequest) (*userspb.CreateUserResponse, error)
func (*Service) DeleteUser ¶
func (*Service) GetUser ¶
func (s *Service) GetUser(ctx context.Context, req *userspb.GetUserRequest) (*userspb.GetUserResponse, error)
func (*Service) ListUsers ¶
func (s *Service) ListUsers(ctx context.Context, req *userspb.ListUsersRequest) (*userspb.ListUsersResponse, error)
func (*Service) UpdateUser ¶
func (s *Service) UpdateUser(ctx context.Context, req *userspb.UpdateUserRequest) (*userspb.UpdateUserResponse, error)
func (*Service) UpsertUser ¶
func (s *Service) UpsertUser(ctx context.Context, req *userspb.UpsertUserRequest) (*userspb.UpsertUserResponse, error)
type ServiceConfig ¶
type ServiceConfig struct { Authorizer authz.Authorizer Cache Cache Backend Backend Logger logrus.FieldLogger Emitter apievents.Emitter Reporter usagereporter.UsageReporter Clock clockwork.Clock }
ServiceConfig holds configuration options for the users gRPC service.
Click to show internal directories.
Click to hide internal directories.