aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/control/security
diff options
context:
space:
mode:
authorEduardo Julian2021-09-10 03:09:37 -0400
committerEduardo Julian2021-09-10 03:09:37 -0400
commit343fda007c09deb70917a4afda19891cacf54504 (patch)
treec20fab9561daf8753750b75c1cb81a9fdc50e044 /stdlib/source/library/lux/control/security
parentf71ec9cb4ead1e7f9573a37686c87e6a9206a415 (diff)
Undid the foolish re-design of "abstract:" and "actor:".
Diffstat (limited to 'stdlib/source/library/lux/control/security')
-rw-r--r--stdlib/source/library/lux/control/security/capability.lux74
-rw-r--r--stdlib/source/library/lux/control/security/policy.lux142
2 files changed, 108 insertions, 108 deletions
diff --git a/stdlib/source/library/lux/control/security/capability.lux b/stdlib/source/library/lux/control/security/capability.lux
index 4bdab69c1..2a49f4b51 100644
--- a/stdlib/source/library/lux/control/security/capability.lux
+++ b/stdlib/source/library/lux/control/security/capability.lux
@@ -26,44 +26,44 @@
(abstract: .public (Capability brand input output)
(-> input output)
- [(def: capability
- (All (_ brand input output)
- (-> (-> input output)
- (Capability brand input output)))
- (|>> :abstraction))
+ (def: capability
+ (All (_ brand input output)
+ (-> (-> input output)
+ (Capability brand input output)))
+ (|>> :abstraction))
- (def: .public (use capability input)
- (All (_ brand input output)
- (-> (Capability brand input output)
- input
- output))
- ((:representation capability) input))
+ (def: .public (use capability input)
+ (All (_ brand input output)
+ (-> (Capability brand input output)
+ input
+ output))
+ ((:representation capability) input))
- (syntax: .public (capability: [[export_policy declaration [forger input output]]
- (|export|.parser
- ($_ <>.and
- |declaration|.parser
- (<c>.form ($_ <>.and <c>.local_identifier <c>.any <c>.any))))])
- (macro.with_identifiers [g!_]
- (do [! meta.monad]
- [this_module meta.current_module_name
- .let [[name vars] declaration]
- g!brand (\ ! each (|>> %.code code.text)
- (macro.identifier (format (%.name [this_module name]))))
- .let [capability (` (..Capability (.primitive (~ g!brand)) (~ input) (~ output)))]]
- (in (list (` (type: (~ export_policy)
- (~ (|declaration|.format declaration))
- (~ capability)))
- (` (def: (~ (code.local_identifier forger))
- (All ((~ g!_) (~+ (list\each code.local_identifier vars)))
- (-> (-> (~ input) (~ output))
- (~ capability)))
- (~! ..capability)))
- )))))
+ (syntax: .public (capability: [[export_policy declaration [forger input output]]
+ (|export|.parser
+ ($_ <>.and
+ |declaration|.parser
+ (<c>.form ($_ <>.and <c>.local_identifier <c>.any <c>.any))))])
+ (macro.with_identifiers [g!_]
+ (do [! meta.monad]
+ [this_module meta.current_module_name
+ .let [[name vars] declaration]
+ g!brand (\ ! each (|>> %.code code.text)
+ (macro.identifier (format (%.name [this_module name]))))
+ .let [capability (` (..Capability (.primitive (~ g!brand)) (~ input) (~ output)))]]
+ (in (list (` (type: (~ export_policy)
+ (~ (|declaration|.format declaration))
+ (~ capability)))
+ (` (def: (~ (code.local_identifier forger))
+ (All ((~ g!_) (~+ (list\each code.local_identifier vars)))
+ (-> (-> (~ input) (~ output))
+ (~ capability)))
+ (~! ..capability)))
+ )))))
- (def: .public (async capability)
- (All (_ brand input output)
- (-> (Capability brand input (IO output))
- (Capability brand input (Async output))))
- (..capability (|>> ((:representation capability)) async.future)))]
+ (def: .public (async capability)
+ (All (_ brand input output)
+ (-> (Capability brand input (IO output))
+ (Capability brand input (Async output))))
+ (..capability (|>> ((:representation capability)) async.future)))
)
diff --git a/stdlib/source/library/lux/control/security/policy.lux b/stdlib/source/library/lux/control/security/policy.lux
index f0a55bdd4..7b15e4210 100644
--- a/stdlib/source/library/lux/control/security/policy.lux
+++ b/stdlib/source/library/lux/control/security/policy.lux
@@ -11,83 +11,83 @@
(abstract: .public (Policy brand value label)
value
- [(type: .public (Can_Upgrade brand label value)
- (-> value (Policy brand value label)))
-
- (type: .public (Can_Downgrade brand label value)
- (-> (Policy brand value label) value))
-
- (type: .public (Privilege brand label)
- (Record
- [#can_upgrade (Can_Upgrade brand label)
- #can_downgrade (Can_Downgrade brand label)]))
-
- (type: .public (Delegation brand from to)
- (All (_ value)
- (-> (Policy brand value from)
- (Policy brand value to))))
-
- (def: .public (delegation downgrade upgrade)
- (All (_ brand from to)
- (-> (Can_Downgrade brand from) (Can_Upgrade brand to)
- (Delegation brand from to)))
- (|>> downgrade upgrade))
-
- (type: .public (Context brand scope label)
- (-> (Privilege brand label)
- (scope label)))
-
- (def: privilege
- Privilege
- [#can_upgrade (|>> :abstraction)
- #can_downgrade (|>> :representation)])
-
- (def: .public (with_policy context)
- (All (_ brand scope)
- (Ex (_ label)
- (-> (Context brand scope label)
- (scope label))))
- (context ..privilege))
-
- (def: (of_policy constructor)
- (-> Type Type)
- (type (All (_ brand label)
- (constructor (All (_ value) (Policy brand value label))))))
-
- (implementation: .public functor
- (:~ (..of_policy Functor))
-
- (def: (each f fa)
- (|> fa :representation f :abstraction)))
-
- (implementation: .public apply
- (:~ (..of_policy Apply))
-
- (def: &functor ..functor)
-
- (def: (on fa ff)
- (:abstraction ((:representation ff) (:representation fa)))))
-
- (implementation: .public monad
- (:~ (..of_policy Monad))
-
- (def: &functor ..functor)
- (def: in (|>> :abstraction))
- (def: conjoint (|>> :representation)))]
+ (type: .public (Can_Upgrade brand label value)
+ (-> value (Policy brand value label)))
+
+ (type: .public (Can_Downgrade brand label value)
+ (-> (Policy brand value label) value))
+
+ (type: .public (Privilege brand label)
+ (Record
+ [#can_upgrade (Can_Upgrade brand label)
+ #can_downgrade (Can_Downgrade brand label)]))
+
+ (type: .public (Delegation brand from to)
+ (All (_ value)
+ (-> (Policy brand value from)
+ (Policy brand value to))))
+
+ (def: .public (delegation downgrade upgrade)
+ (All (_ brand from to)
+ (-> (Can_Downgrade brand from) (Can_Upgrade brand to)
+ (Delegation brand from to)))
+ (|>> downgrade upgrade))
+
+ (type: .public (Context brand scope label)
+ (-> (Privilege brand label)
+ (scope label)))
+
+ (def: privilege
+ Privilege
+ [#can_upgrade (|>> :abstraction)
+ #can_downgrade (|>> :representation)])
+
+ (def: .public (with_policy context)
+ (All (_ brand scope)
+ (Ex (_ label)
+ (-> (Context brand scope label)
+ (scope label))))
+ (context ..privilege))
+
+ (def: (of_policy constructor)
+ (-> Type Type)
+ (type (All (_ brand label)
+ (constructor (All (_ value) (Policy brand value label))))))
+
+ (implementation: .public functor
+ (:~ (..of_policy Functor))
+
+ (def: (each f fa)
+ (|> fa :representation f :abstraction)))
+
+ (implementation: .public apply
+ (:~ (..of_policy Apply))
+
+ (def: &functor ..functor)
+
+ (def: (on fa ff)
+ (:abstraction ((:representation ff) (:representation fa)))))
+
+ (implementation: .public monad
+ (:~ (..of_policy Monad))
+
+ (def: &functor ..functor)
+ (def: in (|>> :abstraction))
+ (def: conjoint (|>> :representation)))
)
(template [<brand> <value> <upgrade> <downgrade>]
[(abstract: .public <brand>
Any
- [(type: .public <value>
- (Policy <brand>))
-
- (type: .public <upgrade>
- (Can_Upgrade <brand>))
-
- (type: .public <downgrade>
- (Can_Downgrade <brand>))]
+ (type: .public <value>
+ (Policy <brand>))
+
+ (type: .public <upgrade>
+ (Can_Upgrade <brand>))
+
+ (type: .public <downgrade>
+ (Can_Downgrade <brand>))
)]
[Privacy Private Can_Conceal Can_Reveal]