Nats Native Behaviors + Peer is Stateless

This commit is contained in:
mr
2026-02-18 14:25:56 +01:00
parent fa5c3a3c60
commit 0b41e2505e
7 changed files with 280 additions and 42 deletions

View File

@@ -99,8 +99,10 @@ func GenericUpdateOne(set DBObject, id string, a Accessor, new DBObject) (DBObje
}
set = newSet
r.UpToDate(a.GetUser(), a.GetPeerID(), false)
r.Unsign()
r.Sign()
if a.GetPeerID() == r.GetCreatorID() {
r.Unsign()
r.Sign()
}
if a.ShouldVerifyAuth() && !r.VerifyAuth("update", a.GetRequest()) {
return nil, 403, errors.New("you are not allowed to access :" + a.GetType().String())
}