In order to align with current project requirements, we need to refactor the authorization.go file located in pkg/infrastructure/adapter/service/authorization.go. The primary task is to temporarily disable the CheckAuth function and clean up the imports that are no longer necessary due to this change. This update will help streamline the code and reduce dependencies.
The new version of the code:
package infrastructure
// CheckAuth returns true if the user is authorized to perform the action.
// func (a ServiceAdapter) CheckAuth(ctx context.Context, authRequest *pb.AuthRequest) (*pb.AuthResponse, error) {
// conn, err := grpc.Dial(tconfig.GetInternalConfigInstance().Grpc.AuthorizationHost+":"+tconfig.GetInternalConfigInstance().Grpc.AuthorizationPort, grpc.WithTransportCredentials(insecure.NewCredentials()))
// if err != nil {
// userId, _ := ctx.Value(smodel.QueryKeyUid).(string)
// go a.Log(context.Background(), me.NewLogData().GenerateLogData(pb_logging.LogType_LogTypeERROR, "Login", userId, err.Error()))
// return &pb.AuthResponse{IsAuthorized: false}, err
// }
// pbResult, err := pb.NewAuthorizationSvcClient(conn).CheckAuth(ctx, authRequest)
// if err != nil {
// userId, _ := ctx.Value(smodel.QueryKeyUid).(string)
// go a.Log(context.Background(), me.NewLogData().GenerateLogData(pb_logging.LogType_LogTypeERROR, "Login", userId, err.Error()))
// return &pb.AuthResponse{IsAuthorized: false}, err
// }
// return pbResult, nil
// }
Additionally, please make sure to push all changes to the feature/hsm/58/auth-service branch.
In order to align with current project requirements, we need to refactor the authorization.go file located in
pkg/infrastructure/adapter/service/authorization.go
. The primary task is to temporarily disable the CheckAuth function and clean up the imports that are no longer necessary due to this change. This update will help streamline the code and reduce dependencies.The new version of the code:
Additionally, please make sure to push all changes to the feature/hsm/58/auth-service branch.