Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update auth.go: Remove Imports & Disable #66

Closed
Feyzanrs opened this issue May 17, 2024 · 0 comments
Closed

Update auth.go: Remove Imports & Disable #66

Feyzanrs opened this issue May 17, 2024 · 0 comments
Assignees
Labels
Be development Issues or tasks currently in active development refactor Improvements or restructuring of existing functionality

Comments

@Feyzanrs
Copy link
Member

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.

@Feyzanrs Feyzanrs changed the title Update authorization.go: Remove Imports & Disable Code Update auth.go: Remove Imports & Disable May 17, 2024
@Feyzanrs Feyzanrs added refactor Improvements or restructuring of existing functionality development Issues or tasks currently in active development labels May 18, 2024
@Feyzanrs Feyzanrs assigned Feyzanrs and Smnrgcl and unassigned Feyzanrs May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Be development Issues or tasks currently in active development refactor Improvements or restructuring of existing functionality
Projects
None yet
Development

No branches or pull requests

4 participants