Skip to content

Conversation

janmasrovira
Copy link
Collaborator

@janmasrovira janmasrovira commented Sep 17, 2025

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.

@janmasrovira janmasrovira self-assigned this Sep 17, 2025
@janmasrovira janmasrovira force-pushed the authorization branch 4 times, most recently from d1b2ab4 to 82e19b9 Compare September 21, 2025 21:40
@janmasrovira janmasrovira changed the title Simple authorization for class members feat: Add simple authorization for class members Sep 22, 2025
@janmasrovira janmasrovira force-pushed the authorization branch 3 times, most recently from d3fffd6 to e85f3aa Compare September 22, 2025 17:01
@janmasrovira janmasrovira marked this pull request as ready for review September 22, 2025 17:03
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
@janmasrovira janmasrovira marked this pull request as draft September 23, 2025 07:41
@janmasrovira janmasrovira marked this pull request as ready for review September 23, 2025 07:58
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
Copy link
Collaborator

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)
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants