Documentation ¶
Overview ¶
Package projauth provides authorization for each GRPC method in MServiceProject. The JWT extracted from the GRPC request context is used for each delegating method.
Index ¶
- Variables
- func GetInt64FromClaims(claims *map[string]interface{}, key string) int64
- func GetStringFromClaims(claims *map[string]interface{}, key string) string
- type ProjAuth
- func (s *ProjAuth) AddTaskHours(ctx context.Context, req *pb.AddTaskHoursRequest) (*pb.AddTaskHoursResponse, error)
- func (s *ProjAuth) AddTeamMemberToTask(ctx context.Context, req *pb.AddTeamMemberToTaskRequest) (*pb.AddTeamMemberToTaskResponse, error)
- func (s *ProjAuth) CreateProject(ctx context.Context, req *pb.CreateProjectRequest) (*pb.CreateProjectResponse, error)
- func (s *ProjAuth) CreateProjectRoleType(ctx context.Context, req *pb.CreateProjectRoleTypeRequest) (*pb.CreateProjectRoleTypeResponse, error)
- func (s *ProjAuth) CreateStatusType(ctx context.Context, req *pb.CreateStatusTypeRequest) (*pb.CreateStatusTypeResponse, error)
- func (s *ProjAuth) CreateTask(ctx context.Context, req *pb.CreateTaskRequest) (*pb.CreateTaskResponse, error)
- func (s *ProjAuth) CreateTeamMember(ctx context.Context, req *pb.CreateTeamMemberRequest) (*pb.CreateTeamMemberResponse, error)
- func (s *ProjAuth) DeleteProject(ctx context.Context, req *pb.DeleteProjectRequest) (*pb.DeleteProjectResponse, error)
- func (s *ProjAuth) DeleteProjectRoleType(ctx context.Context, req *pb.DeleteProjectRoleTypeRequest) (*pb.DeleteProjectRoleTypeResponse, error)
- func (s *ProjAuth) DeleteStatusType(ctx context.Context, req *pb.DeleteStatusTypeRequest) (*pb.DeleteStatusTypeResponse, error)
- func (s *ProjAuth) DeleteTask(ctx context.Context, req *pb.DeleteTaskRequest) (*pb.DeleteTaskResponse, error)
- func (s *ProjAuth) DeleteTeamMember(ctx context.Context, req *pb.DeleteTeamMemberRequest) (*pb.DeleteTeamMemberResponse, error)
- func (s *ProjAuth) GetJwtFromContext(ctx context.Context) (*map[string]interface{}, error)
- func (s *ProjAuth) GetProjectById(ctx context.Context, req *pb.GetProjectByIdRequest) (*pb.GetProjectByIdResponse, error)
- func (s *ProjAuth) GetProjectByName(ctx context.Context, req *pb.GetProjectByNameRequest) (*pb.GetProjectByNameResponse, error)
- func (s *ProjAuth) GetProjectNames(ctx context.Context, req *pb.GetProjectNamesRequest) (*pb.GetProjectNamesResponse, error)
- func (s *ProjAuth) GetProjectRoleType(ctx context.Context, req *pb.GetProjectRoleTypeRequest) (*pb.GetProjectRoleTypeResponse, error)
- func (s *ProjAuth) GetProjectRoleTypes(ctx context.Context, req *pb.GetProjectRoleTypesRequest) (*pb.GetProjectRoleTypesResponse, error)
- func (s *ProjAuth) GetProjectWrapperById(ctx context.Context, req *pb.GetProjectWrapperByIdRequest) (*pb.GetProjectWrapperByIdResponse, error)
- func (s *ProjAuth) GetProjectWrapperByName(ctx context.Context, req *pb.GetProjectWrapperByNameRequest) (*pb.GetProjectWrapperByNameResponse, error)
- func (s *ProjAuth) GetServerVersion(ctx context.Context, req *pb.GetServerVersionRequest) (*pb.GetServerVersionResponse, error)
- func (s *ProjAuth) GetStatusType(ctx context.Context, req *pb.GetStatusTypeRequest) (*pb.GetStatusTypeResponse, error)
- func (s *ProjAuth) GetStatusTypes(ctx context.Context, req *pb.GetStatusTypesRequest) (*pb.GetStatusTypesResponse, error)
- func (s *ProjAuth) GetTaskById(ctx context.Context, req *pb.GetTaskByIdRequest) (*pb.GetTaskByIdResponse, error)
- func (s *ProjAuth) GetTaskWrapperById(ctx context.Context, req *pb.GetTaskWrapperByIdRequest) (*pb.GetTaskWrapperByIdResponse, error)
- func (s *ProjAuth) GetTasksByProject(ctx context.Context, req *pb.GetTasksByProjectRequest) (*pb.GetTasksByProjectResponse, error)
- func (s *ProjAuth) GetTeamMemberById(ctx context.Context, req *pb.GetTeamMemberByIdRequest) (*pb.GetTeamMemberByIdResponse, error)
- func (s *ProjAuth) GetTeamMemberByProject(ctx context.Context, req *pb.GetTeamMemberByProjectRequest) (*pb.GetTeamMemberByProjectResponse, error)
- func (s *ProjAuth) GetTeamMemberByTask(ctx context.Context, req *pb.GetTeamMemberByTaskRequest) (*pb.GetTeamMemberByTaskResponse, error)
- func (s *ProjAuth) NewApiServer(gServer *grpc.Server) error
- func (s *ProjAuth) RemoveTeamMemberFromTask(ctx context.Context, req *pb.RemoveTeamMemberFromTaskRequest) (*pb.RemoveTeamMemberFromTaskResponse, error)
- func (s *ProjAuth) ReorderChildTasks(ctx context.Context, req *pb.ReorderChildTasksRequest) (*pb.ReorderChildTasksResponse, error)
- func (s *ProjAuth) SetDatabaseConnection(sqlDB *sql.DB)
- func (s *ProjAuth) SetLogger(logger log.Logger)
- func (s *ProjAuth) SetPublicKey(publicKeyFile string) error
- func (s *ProjAuth) UpdateProject(ctx context.Context, req *pb.UpdateProjectRequest) (*pb.UpdateProjectResponse, error)
- func (s *ProjAuth) UpdateProjectRoleType(ctx context.Context, req *pb.UpdateProjectRoleTypeRequest) (*pb.UpdateProjectRoleTypeResponse, error)
- func (s *ProjAuth) UpdateStatusType(ctx context.Context, req *pb.UpdateStatusTypeRequest) (*pb.UpdateStatusTypeResponse, error)
- func (s *ProjAuth) UpdateTask(ctx context.Context, req *pb.UpdateTaskRequest) (*pb.UpdateTaskResponse, error)
- func (s *ProjAuth) UpdateTeamMember(ctx context.Context, req *pb.UpdateTeamMemberRequest) (*pb.UpdateTeamMemberResponse, error)
Constants ¶
This section is empty.
Variables ¶
var NotImplemented = errors.New("not implemented")
Functions ¶
func GetInt64FromClaims ¶
Get the clain value as an int64.
func GetStringFromClaims ¶
Get the claim value as a string.
Types ¶
type ProjAuth ¶ added in v0.9.2
type ProjAuth struct {
// contains filtered or unexported fields
}
func NewProjectAuth ¶
func NewProjectAuth(projService pb.MServiceProjectServer) *ProjAuth
Get a new ProjAuth instance.
func (*ProjAuth) AddTaskHours ¶ added in v0.9.2
func (s *ProjAuth) AddTaskHours(ctx context.Context, req *pb.AddTaskHoursRequest) (*pb.AddTaskHoursResponse, error)
add to existing task hours for task and member
func (*ProjAuth) AddTeamMemberToTask ¶ added in v0.9.2
func (s *ProjAuth) AddTeamMemberToTask(ctx context.Context, req *pb.AddTeamMemberToTaskRequest) (*pb.AddTeamMemberToTaskResponse, error)
add a team member to a task
func (*ProjAuth) CreateProject ¶ added in v0.9.2
func (s *ProjAuth) CreateProject(ctx context.Context, req *pb.CreateProjectRequest) (*pb.CreateProjectResponse, error)
create a new project
func (*ProjAuth) CreateProjectRoleType ¶ added in v0.9.2
func (s *ProjAuth) CreateProjectRoleType(ctx context.Context, req *pb.CreateProjectRoleTypeRequest) (*pb.CreateProjectRoleTypeResponse, error)
create a new project role type
func (*ProjAuth) CreateStatusType ¶ added in v0.9.2
func (s *ProjAuth) CreateStatusType(ctx context.Context, req *pb.CreateStatusTypeRequest) (*pb.CreateStatusTypeResponse, error)
create a new status type
func (*ProjAuth) CreateTask ¶ added in v0.9.2
func (s *ProjAuth) CreateTask(ctx context.Context, req *pb.CreateTaskRequest) (*pb.CreateTaskResponse, error)
create a new task
func (*ProjAuth) CreateTeamMember ¶ added in v0.9.2
func (s *ProjAuth) CreateTeamMember(ctx context.Context, req *pb.CreateTeamMemberRequest) (*pb.CreateTeamMemberResponse, error)
create a new team member for the project
func (*ProjAuth) DeleteProject ¶ added in v0.9.2
func (s *ProjAuth) DeleteProject(ctx context.Context, req *pb.DeleteProjectRequest) (*pb.DeleteProjectResponse, error)
delete an existing project
func (*ProjAuth) DeleteProjectRoleType ¶ added in v0.9.2
func (s *ProjAuth) DeleteProjectRoleType(ctx context.Context, req *pb.DeleteProjectRoleTypeRequest) (*pb.DeleteProjectRoleTypeResponse, error)
delete an existing project role type
func (*ProjAuth) DeleteStatusType ¶ added in v0.9.2
func (s *ProjAuth) DeleteStatusType(ctx context.Context, req *pb.DeleteStatusTypeRequest) (*pb.DeleteStatusTypeResponse, error)
delete a status type
func (*ProjAuth) DeleteTask ¶ added in v0.9.2
func (s *ProjAuth) DeleteTask(ctx context.Context, req *pb.DeleteTaskRequest) (*pb.DeleteTaskResponse, error)
delete an existing task
func (*ProjAuth) DeleteTeamMember ¶ added in v0.9.2
func (s *ProjAuth) DeleteTeamMember(ctx context.Context, req *pb.DeleteTeamMemberRequest) (*pb.DeleteTeamMemberResponse, error)
delete an existing team member
func (*ProjAuth) GetJwtFromContext ¶ added in v0.9.2
Get the JWT from the gRPC request context.
func (*ProjAuth) GetProjectById ¶ added in v0.9.2
func (s *ProjAuth) GetProjectById(ctx context.Context, req *pb.GetProjectByIdRequest) (*pb.GetProjectByIdResponse, error)
get project entity by id
func (*ProjAuth) GetProjectByName ¶ added in v0.9.2
func (s *ProjAuth) GetProjectByName(ctx context.Context, req *pb.GetProjectByNameRequest) (*pb.GetProjectByNameResponse, error)
get project entity by name
func (*ProjAuth) GetProjectNames ¶ added in v0.9.2
func (s *ProjAuth) GetProjectNames(ctx context.Context, req *pb.GetProjectNamesRequest) (*pb.GetProjectNamesResponse, error)
get list of project names for this mservice id
func (*ProjAuth) GetProjectRoleType ¶ added in v0.9.2
func (s *ProjAuth) GetProjectRoleType(ctx context.Context, req *pb.GetProjectRoleTypeRequest) (*pb.GetProjectRoleTypeResponse, error)
get a project role type by id
func (*ProjAuth) GetProjectRoleTypes ¶ added in v0.9.2
func (s *ProjAuth) GetProjectRoleTypes(ctx context.Context, req *pb.GetProjectRoleTypesRequest) (*pb.GetProjectRoleTypesResponse, error)
get all project role types for an mservice id
func (*ProjAuth) GetProjectWrapperById ¶ added in v0.9.2
func (s *ProjAuth) GetProjectWrapperById(ctx context.Context, req *pb.GetProjectWrapperByIdRequest) (*pb.GetProjectWrapperByIdResponse, error)
get project entity wrapper by id
func (*ProjAuth) GetProjectWrapperByName ¶ added in v0.9.2
func (s *ProjAuth) GetProjectWrapperByName(ctx context.Context, req *pb.GetProjectWrapperByNameRequest) (*pb.GetProjectWrapperByNameResponse, error)
get project entity wrapper by name
func (*ProjAuth) GetServerVersion ¶ added in v0.9.2
func (s *ProjAuth) GetServerVersion(ctx context.Context, req *pb.GetServerVersionRequest) (*pb.GetServerVersionResponse, error)
get current server version and uptime - health check
func (*ProjAuth) GetStatusType ¶ added in v0.9.2
func (s *ProjAuth) GetStatusType(ctx context.Context, req *pb.GetStatusTypeRequest) (*pb.GetStatusTypeResponse, error)
get status type by id
func (*ProjAuth) GetStatusTypes ¶ added in v0.9.2
func (s *ProjAuth) GetStatusTypes(ctx context.Context, req *pb.GetStatusTypesRequest) (*pb.GetStatusTypesResponse, error)
get all status types for this mservice id
func (*ProjAuth) GetTaskById ¶ added in v0.9.2
func (s *ProjAuth) GetTaskById(ctx context.Context, req *pb.GetTaskByIdRequest) (*pb.GetTaskByIdResponse, error)
get a task by id
func (*ProjAuth) GetTaskWrapperById ¶ added in v0.9.2
func (s *ProjAuth) GetTaskWrapperById(ctx context.Context, req *pb.GetTaskWrapperByIdRequest) (*pb.GetTaskWrapperByIdResponse, error)
get a task with asspciations by id
func (*ProjAuth) GetTasksByProject ¶ added in v0.9.2
func (s *ProjAuth) GetTasksByProject(ctx context.Context, req *pb.GetTasksByProjectRequest) (*pb.GetTasksByProjectResponse, error)
get list of tasks in project
func (*ProjAuth) GetTeamMemberById ¶ added in v0.9.2
func (s *ProjAuth) GetTeamMemberById(ctx context.Context, req *pb.GetTeamMemberByIdRequest) (*pb.GetTeamMemberByIdResponse, error)
get team member by id
func (*ProjAuth) GetTeamMemberByProject ¶ added in v0.9.2
func (s *ProjAuth) GetTeamMemberByProject(ctx context.Context, req *pb.GetTeamMemberByProjectRequest) (*pb.GetTeamMemberByProjectResponse, error)
get team members by project
func (*ProjAuth) GetTeamMemberByTask ¶ added in v0.9.2
func (s *ProjAuth) GetTeamMemberByTask(ctx context.Context, req *pb.GetTeamMemberByTaskRequest) (*pb.GetTeamMemberByTaskResponse, error)
get team members by task
func (*ProjAuth) NewApiServer ¶ added in v0.9.2
Bind our ProjAuth as the gRPC api server.
func (*ProjAuth) RemoveTeamMemberFromTask ¶ added in v0.9.2
func (s *ProjAuth) RemoveTeamMemberFromTask(ctx context.Context, req *pb.RemoveTeamMemberFromTaskRequest) (*pb.RemoveTeamMemberFromTaskResponse, error)
remove a team member from a task
func (*ProjAuth) ReorderChildTasks ¶ added in v0.9.2
func (s *ProjAuth) ReorderChildTasks(ctx context.Context, req *pb.ReorderChildTasksRequest) (*pb.ReorderChildTasksResponse, error)
reorder the positions of child tasks
func (*ProjAuth) SetDatabaseConnection ¶ added in v0.9.2
Set the database connection for the ProjAuth instance.
func (*ProjAuth) SetPublicKey ¶ added in v0.9.2
Set the public RSA key for the ProjAuth instance, used to validate JWT.
func (*ProjAuth) UpdateProject ¶ added in v0.9.2
func (s *ProjAuth) UpdateProject(ctx context.Context, req *pb.UpdateProjectRequest) (*pb.UpdateProjectResponse, error)
update an existing project
func (*ProjAuth) UpdateProjectRoleType ¶ added in v0.9.2
func (s *ProjAuth) UpdateProjectRoleType(ctx context.Context, req *pb.UpdateProjectRoleTypeRequest) (*pb.UpdateProjectRoleTypeResponse, error)
update an existing project role type
func (*ProjAuth) UpdateStatusType ¶ added in v0.9.2
func (s *ProjAuth) UpdateStatusType(ctx context.Context, req *pb.UpdateStatusTypeRequest) (*pb.UpdateStatusTypeResponse, error)
update a status type
func (*ProjAuth) UpdateTask ¶ added in v0.9.2
func (s *ProjAuth) UpdateTask(ctx context.Context, req *pb.UpdateTaskRequest) (*pb.UpdateTaskResponse, error)
update an existing task
func (*ProjAuth) UpdateTeamMember ¶ added in v0.9.2
func (s *ProjAuth) UpdateTeamMember(ctx context.Context, req *pb.UpdateTeamMemberRequest) (*pb.UpdateTeamMemberResponse, error)
update an existing team member