-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Add simple authorization for class members #109
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
base: main
Are you sure you want to change the base?
Conversation
d1b2ab4
to
82e19b9
Compare
d3fffd6
to
e85f3aa
Compare
commit 35ebc97 Author: Jan Mas Rovira <[email protected]> Date: Mon Sep 22 17:28:56 2025 +0200 destructors commit 18fcdd3 Author: Jan Mas Rovira <[email protected]> Date: Mon Sep 22 13:39:48 2025 +0200 syntax commit 6df404c Author: Jan Mas Rovira <[email protected]> Date: Mon Sep 22 13:13:24 2025 +0200 constrs and destr commit 2165afe Author: Jan Mas Rovira <[email protected]> Date: Mon Sep 22 10:17:33 2025 +0200 sigs commit 82e19b9 Author: Jan Mas Rovira <[email protected]> Date: Sun Sep 21 23:39:58 2025 +0200 proofs commit 2e06fac Author: Jan Mas Rovira <[email protected]> Date: Fri Sep 19 16:33:54 2025 +0200 wip commit 72faad1 Author: Jan Mas Rovira <[email protected]> Date: Fri Sep 19 08:25:44 2025 +0200 noSignatures commit fb64072 Author: Jan Mas Rovira <[email protected]> Date: Thu Sep 18 15:23:58 2025 +0200 signatures wip commit 4a5495e Author: Jan Mas Rovira <[email protected]> Date: Wed Sep 17 17:29:26 2025 +0200 store owner commit dc14617 Author: Jan Mas Rovira <[email protected]> Date: Wed Sep 17 15:42:56 2025 +0200 basic authorization for class members
e85f3aa
to
559b62c
Compare
call Counter.Methods.Incr rx (x.count * 2 + y.count) | ||
call Counter.Methods.Incr ry (y.count * 2 + x.count) | ||
call Counter.Methods.Incr rx (x.count * 2 + y.count) noSignatures | ||
call Counter.Methods.Incr ry (y.count * 2 + x.count) noSignatures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super annoying to be forced to specify these noSignatures
everywhere. Can we make signatures implicit, or at least leave call
etc. as they are and add new callSig
etc. with signatures?
def counterIncr : @Class.Method label .unit Methods.Incr := defMethod OwnedCounter | ||
(body := fun (self : OwnedCounter) (step : Nat) => ⟪return self.incrementBy step⟫) | ||
(invariant := fun (self : OwnedCounter) (_step : Nat) signatures => | ||
checkSignature (signatures .owner) self.owner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have this with every member. It would seem more natural to make this signature check a class invariant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as it stands, class invariants don't have access to signatures. Perhaps this could be an extension. We would define a SignatureId for the class, and all members would be able to provide that signature.
Member calls can be passed signatures. These signatures can then be checked in the invariant of the member. The signature ensures that the memberId and its arguments have been signed by some authorized entity.