fix version 1

This commit is contained in:
2026-09-22 21:15:34 +08:00
parent 9f86366638
commit d63d7e8b3a
277 changed files with 9959 additions and 1514 deletions

View File

@@ -16,7 +16,7 @@ import (
// 获取一条地址
func Get(ctx context.Context, in *pb.IdentRequest) (reply *pb.AddressItem, err error) {
// parse authorization meta.
_, err = service.ParseMetaCtx(ctx, nil)
auth, err := service.ParseMetaCtx(ctx, nil)
if err != nil {
return nil, err
}
@@ -26,7 +26,8 @@ func Get(ctx context.Context, in *pb.IdentRequest) (reply *pb.AddressItem, err e
}
address := new(models.AddressLibrary)
err = impl.DBService.Where("id=?", in.Id).First(&address).Error
// 查询必须限定归属,避免越权读取他人地址
err = impl.DBService.Where("id=? and owner_identity=?", in.Id, auth.Identity).First(&address).Error
if err != nil {
if errors.Is(err, models.ErrNotFound) {