MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / UpdateUser

Method UpdateUser

internal/grpcsrv/handlers/admin.go:98–120  ·  view source on GitHub ↗

UpdateUser delegates to service.UpdateUser and projects the updated user. Optional proto fields map 1:1 onto the model's nullable pointers. Requires super-admin auth.

(ctx context.Context, req *authorizerv1.UpdateUserRequest)

Source from the content-addressed store, hash-verified

96// Optional proto fields map 1:1 onto the model's nullable pointers. Requires
97// super-admin auth.
98func (h *AdminHandler) UpdateUser(ctx context.Context, req *authorizerv1.UpdateUserRequest) (*authorizerv1.UpdateUserResponse, error) {
99 res, _, err := h.Service.UpdateUser(ctx, transport.MetaFromGRPC(ctx), &model.UpdateUserRequest{
100 ID: req.GetId(),
101 Email: req.Email,
102 EmailVerified: req.EmailVerified,
103 GivenName: req.GivenName,
104 FamilyName: req.FamilyName,
105 MiddleName: req.MiddleName,
106 Nickname: req.Nickname,
107 Gender: req.Gender,
108 Birthdate: req.Birthdate,
109 PhoneNumber: req.PhoneNumber,
110 PhoneNumberVerified: req.PhoneNumberVerified,
111 Picture: req.Picture,
112 Roles: protoToModelStringSlice(req.GetRoles()),
113 IsMultiFactorAuthEnabled: req.IsMultiFactorAuthEnabled,
114 AppData: appDataToMap(req.GetAppData()),
115 })
116 if err != nil {
117 return nil, err
118 }
119 return &authorizerv1.UpdateUserResponse{User: projectUser(res)}, nil
120}
121
122// DeleteUser delegates to service.DeleteUser. Requires super-admin auth.
123func (h *AdminHandler) DeleteUser(ctx context.Context, req *authorizerv1.DeleteUserRequest) (*authorizerv1.DeleteUserResponse, error) {

Callers

nothing calls this directly

Calls 8

MetaFromGRPCFunction · 0.92
protoToModelStringSliceFunction · 0.85
appDataToMapFunction · 0.85
projectUserFunction · 0.85
UpdateUserMethod · 0.65
GetIdMethod · 0.45
GetRolesMethod · 0.45
GetAppDataMethod · 0.45

Tested by

no test coverage detected