Documentation ¶
Index ¶
- Constants
- func MethodRequiresAdmin(ctx context.Context) (bool, error)
- type AuthClaims
- type LDAPManagerService
- func (s *LDAPManagerService) AddGroupMember(ctx context.Context, req *pb.GroupMember) (*pb.Empty, error)
- func (s *LDAPManagerService) Authenticate(ctx context.Context) (*AuthClaims, error)
- func (s *LDAPManagerService) ChangePassword(ctx context.Context, req *pb.ChangePasswordRequest) (*pb.Empty, error)
- func (s *LDAPManagerService) DeleteGroup(ctx context.Context, req *pb.DeleteGroupRequest) (*pb.Empty, error)
- func (s *LDAPManagerService) DeleteUser(ctx context.Context, req *pb.DeleteUserRequest) (*pb.Empty, error)
- func (s *LDAPManagerService) GetGroup(ctx context.Context, req *pb.GetGroupRequest) (*pb.Group, error)
- func (s *LDAPManagerService) GetGroupList(ctx context.Context, req *pb.GetGroupListRequest) (*pb.GroupList, error)
- func (s *LDAPManagerService) GetUser(ctx context.Context, req *pb.GetUserRequest) (*pb.User, error)
- func (s *LDAPManagerService) GetUserGroups(ctx context.Context, req *pb.GetUserGroupsRequest) (*pb.GroupList, error)
- func (s *LDAPManagerService) GetUserList(ctx context.Context, req *pb.GetUserListRequest) (*pb.UserList, error)
- func (s *LDAPManagerService) IsGroupMember(ctx context.Context, req *pb.IsGroupMemberRequest) (*pb.GroupMemberStatus, error)
- func (s *LDAPManagerService) Login(ctx context.Context, req *pb.LoginRequest) (*pb.Token, error)
- func (s *LDAPManagerService) NewGroup(ctx context.Context, req *pb.NewGroupRequest) (*pb.Empty, error)
- func (s *LDAPManagerService) NewUser(ctx context.Context, req *pb.NewUserRequest) (*pb.Empty, error)
- func (s *LDAPManagerService) RemoveGroupMember(ctx context.Context, req *pb.GroupMember) (*pb.Empty, error)
- func (s *LDAPManagerService) Serve(listener net.Listener) error
- func (s *LDAPManagerService) SetHealthy(healthy bool)
- func (s *LDAPManagerService) Shutdown()
- func (s *LDAPManagerService) SignUserToken(claims *AuthClaims) (*pb.Token, error)
- func (s *LDAPManagerService) UpdateGroup(ctx context.Context, req *pb.UpdateGroupRequest) (*pb.Empty, error)
- func (s *LDAPManagerService) UpdateUser(ctx context.Context, req *pb.UpdateUserRequest) (*pb.Token, error)
Constants ¶
const ServiceName = "ldap-manager"
ServiceName is the name of the service used for health checking
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthClaims ¶
type AuthClaims struct { Username string `json:"username"` UID int32 `json:"uid"` IsAdmin bool `json:"is_admin"` DisplayName string `json:"display_name"` jwt.RegisteredClaims }
AuthClaims encode authentication JWT claims
func (*AuthClaims) GetRegisteredClaims ¶ added in v0.0.27
func (claims *AuthClaims) GetRegisteredClaims() *jwt.RegisteredClaims
GetRegisteredClaims returns the common registered claims
type LDAPManagerService ¶ added in v0.0.27
type LDAPManagerService struct { pb.UnimplementedLDAPManagerServer // contains filtered or unexported fields }
LDAPManagerService implements the GRPC service
func NewLDAPManagerService ¶ added in v0.0.27
func NewLDAPManagerService(ctx context.Context, manager ldapmanager.LDAPManager, authenticator auth.Authenticator) LDAPManagerService
NewLDAPManagerService builds the service
func (*LDAPManagerService) AddGroupMember ¶ added in v0.0.27
func (s *LDAPManagerService) AddGroupMember(ctx context.Context, req *pb.GroupMember) (*pb.Empty, error)
AddGroupMember adds a new member to a group
func (*LDAPManagerService) Authenticate ¶ added in v0.0.27
func (s *LDAPManagerService) Authenticate(ctx context.Context) (*AuthClaims, error)
Authenticate attempts to authenticate a user. It checks if a token is supplied in the request context
func (*LDAPManagerService) ChangePassword ¶ added in v0.0.27
func (s *LDAPManagerService) ChangePassword(ctx context.Context, req *pb.ChangePasswordRequest) (*pb.Empty, error)
ChangePassword changes the password for an account
func (*LDAPManagerService) DeleteGroup ¶ added in v0.0.27
func (s *LDAPManagerService) DeleteGroup(ctx context.Context, req *pb.DeleteGroupRequest) (*pb.Empty, error)
DeleteGroup deletes a group
func (*LDAPManagerService) DeleteUser ¶ added in v0.0.27
func (s *LDAPManagerService) DeleteUser(ctx context.Context, req *pb.DeleteUserRequest) (*pb.Empty, error)
DeleteUser deletes an account
func (*LDAPManagerService) GetGroup ¶ added in v0.0.27
func (s *LDAPManagerService) GetGroup(ctx context.Context, req *pb.GetGroupRequest) (*pb.Group, error)
GetGroup gets a group
func (*LDAPManagerService) GetGroupList ¶ added in v0.0.27
func (s *LDAPManagerService) GetGroupList(ctx context.Context, req *pb.GetGroupListRequest) (*pb.GroupList, error)
GetGroupList returns a list of groups
func (*LDAPManagerService) GetUser ¶ added in v0.0.27
func (s *LDAPManagerService) GetUser(ctx context.Context, req *pb.GetUserRequest) (*pb.User, error)
GetUser gets a user
func (*LDAPManagerService) GetUserGroups ¶ added in v0.0.27
func (s *LDAPManagerService) GetUserGroups(ctx context.Context, req *pb.GetUserGroupsRequest) (*pb.GroupList, error)
GetUserGroups gets the groups an account is member of
func (*LDAPManagerService) GetUserList ¶ added in v0.0.27
func (s *LDAPManagerService) GetUserList(ctx context.Context, req *pb.GetUserListRequest) (*pb.UserList, error)
GetUserList gets a list of users
func (*LDAPManagerService) IsGroupMember ¶ added in v0.0.27
func (s *LDAPManagerService) IsGroupMember(ctx context.Context, req *pb.IsGroupMemberRequest) (*pb.GroupMemberStatus, error)
IsGroupMember checks if an account is member of a group
func (*LDAPManagerService) Login ¶ added in v0.0.27
func (s *LDAPManagerService) Login(ctx context.Context, req *pb.LoginRequest) (*pb.Token, error)
Login logs in a user
func (*LDAPManagerService) NewGroup ¶ added in v0.0.27
func (s *LDAPManagerService) NewGroup(ctx context.Context, req *pb.NewGroupRequest) (*pb.Empty, error)
NewGroup adds a new LDAP group
func (*LDAPManagerService) NewUser ¶ added in v0.0.27
func (s *LDAPManagerService) NewUser(ctx context.Context, req *pb.NewUserRequest) (*pb.Empty, error)
NewUser creates a new user
func (*LDAPManagerService) RemoveGroupMember ¶ added in v0.0.27
func (s *LDAPManagerService) RemoveGroupMember(ctx context.Context, req *pb.GroupMember) (*pb.Empty, error)
RemoveGroupMember removes a member of a group
func (*LDAPManagerService) Serve ¶ added in v0.0.27
func (s *LDAPManagerService) Serve(listener net.Listener) error
Serve serves the service on a listener
func (*LDAPManagerService) SetHealthy ¶ added in v0.0.29
func (s *LDAPManagerService) SetHealthy(healthy bool)
SetHealthy sets the health state for the service
func (*LDAPManagerService) Shutdown ¶ added in v0.0.27
func (s *LDAPManagerService) Shutdown()
Shutdown gracefully stops the service
func (*LDAPManagerService) SignUserToken ¶ added in v0.0.27
func (s *LDAPManagerService) SignUserToken(claims *AuthClaims) (*pb.Token, error)
SignUserToken signs an authentication claim and returns it as a JWT token
func (*LDAPManagerService) UpdateGroup ¶ added in v0.0.27
func (s *LDAPManagerService) UpdateGroup(ctx context.Context, req *pb.UpdateGroupRequest) (*pb.Empty, error)
UpdateGroup updates an LDAP group
func (*LDAPManagerService) UpdateUser ¶ added in v0.0.27
func (s *LDAPManagerService) UpdateUser(ctx context.Context, req *pb.UpdateUserRequest) (*pb.Token, error)
UpdateUser updates a user