projauth

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var NotImplemented = errors.New("not implemented")

Functions

func GetInt64FromClaims

func GetInt64FromClaims(claims *map[string]interface{}, key string) int64

Get the clain value as an int64.

func GetStringFromClaims

func GetStringFromClaims(claims *map[string]interface{}, key string) string

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

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

create a new project role type

func (*ProjAuth) CreateStatusType added in v0.9.2

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

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

delete an existing project role type

func (*ProjAuth) DeleteStatusType added in v0.9.2

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

delete an existing team member

func (*ProjAuth) GetJwtFromContext added in v0.9.2

func (s *ProjAuth) GetJwtFromContext(ctx context.Context) (*map[string]interface{}, error)

Get the JWT from the gRPC request context.

func (*ProjAuth) GetProjectById added in v0.9.2

get project entity by id

func (*ProjAuth) GetProjectByName added in v0.9.2

get project entity by name

func (*ProjAuth) GetProjectNames added in v0.9.2

get list of project names for this mservice id

func (*ProjAuth) GetProjectRoleType added in v0.9.2

get a project role type by id

func (*ProjAuth) GetProjectRoleTypes added in v0.9.2

get all project role types for an mservice id

func (*ProjAuth) GetProjectWrapperById added in v0.9.2

get project entity wrapper by id

func (*ProjAuth) GetProjectWrapperByName added in v0.9.2

get project entity wrapper by name

func (*ProjAuth) GetServerVersion added in v0.9.2

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

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

get a task with asspciations by id

func (*ProjAuth) GetTasksByProject added in v0.9.2

get list of tasks in project

func (*ProjAuth) GetTeamMemberById added in v0.9.2

get team member by id

func (*ProjAuth) GetTeamMemberByProject added in v0.9.2

get team members by project

func (*ProjAuth) GetTeamMemberByTask added in v0.9.2

get team members by task

func (*ProjAuth) NewApiServer added in v0.9.2

func (s *ProjAuth) NewApiServer(gServer *grpc.Server) error

Bind our ProjAuth as the gRPC api server.

func (*ProjAuth) RemoveTeamMemberFromTask added in v0.9.2

remove a team member from a task

func (*ProjAuth) ReorderChildTasks added in v0.9.2

reorder the positions of child tasks

func (*ProjAuth) SetDatabaseConnection added in v0.9.2

func (s *ProjAuth) SetDatabaseConnection(sqlDB *sql.DB)

Set the database connection for the ProjAuth instance.

func (*ProjAuth) SetLogger added in v0.9.2

func (s *ProjAuth) SetLogger(logger log.Logger)

Set the logger for the ProjAuth instance.

func (*ProjAuth) SetPublicKey added in v0.9.2

func (s *ProjAuth) SetPublicKey(publicKeyFile string) error

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

update an existing project role type

func (*ProjAuth) UpdateStatusType added in v0.9.2

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

update an existing team member

Jump to

Keyboard shortcuts

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