aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/control/security/integrity.lux (renamed from stdlib/source/lux/control/security/taint.lux)0
-rw-r--r--stdlib/source/lux/world/console.lux6
-rw-r--r--stdlib/source/lux/world/environment.jvm.lux4
-rw-r--r--stdlib/source/lux/world/file.lux4
-rw-r--r--stdlib/source/lux/world/net/http.lux2
-rw-r--r--stdlib/source/lux/world/net/http/request.lux24
-rw-r--r--stdlib/source/lux/world/net/http/route.lux22
-rw-r--r--stdlib/source/lux/world/net/tcp.jvm.lux4
-rw-r--r--stdlib/source/lux/world/net/udp.jvm.lux4
-rw-r--r--stdlib/test/test/lux/control/security/integrity.lux (renamed from stdlib/test/test/lux/control/security/taint.lux)2
-rw-r--r--stdlib/test/test/lux/world/file.lux8
-rw-r--r--stdlib/test/test/lux/world/net/udp.lux6
-rw-r--r--stdlib/test/tests.lux344
13 files changed, 219 insertions, 211 deletions
diff --git a/stdlib/source/lux/control/security/taint.lux b/stdlib/source/lux/control/security/integrity.lux
index b78351b38..b78351b38 100644
--- a/stdlib/source/lux/control/security/taint.lux
+++ b/stdlib/source/lux/control/security/integrity.lux
diff --git a/stdlib/source/lux/world/console.lux b/stdlib/source/lux/world/console.lux
index 5c0aff910..b02f0f69d 100644
--- a/stdlib/source/lux/world/console.lux
+++ b/stdlib/source/lux/world/console.lux
@@ -6,7 +6,7 @@
[concurrency
["." promise (#+ Promise)]]
[security
- ["." taint (#+ Dirty taint)]
+ ["." integrity (#+ Dirty)]
[capability (#+ Capability)]]]
[data
["." error (#+ Error)]
@@ -87,12 +87,12 @@
(def: (read _)
(|> jvm-input
InputStream::read
- (:: io.Functor<Process> map (|>> .nat taint))))
+ (:: io.Functor<Process> map (|>> .nat integrity.taint))))
(def: (read-line _)
(|> jvm-console
java/io/Console::readLine
- (:: io.Functor<Process> map taint)))
+ (:: io.Functor<Process> map integrity.taint)))
(def: (write message)
(PrintStream::print message jvm-output))
diff --git a/stdlib/source/lux/world/environment.jvm.lux b/stdlib/source/lux/world/environment.jvm.lux
index 57ffcd465..1a373ba8c 100644
--- a/stdlib/source/lux/world/environment.jvm.lux
+++ b/stdlib/source/lux/world/environment.jvm.lux
@@ -2,7 +2,7 @@
[lux #*
[control
[security
- ["." taint (#+ Dirty taint)]]]
+ ["." integrity (#+ Dirty)]]]
[data
["." text]
[format
@@ -53,4 +53,4 @@
Set::iterator
(consume-iterator entry-to-kv)
(dictionary.from-list text.Hash<Text>)
- taint)))
+ integrity.taint)))
diff --git a/stdlib/source/lux/world/file.lux b/stdlib/source/lux/world/file.lux
index f0269e52c..4793f2fa2 100644
--- a/stdlib/source/lux/world/file.lux
+++ b/stdlib/source/lux/world/file.lux
@@ -6,7 +6,7 @@
[concurrency
["." promise (#+ Promise)]]
[security
- ["." taint (#+ Dirty taint)]
+ ["." integrity (#+ Dirty)]
["." capability (#+ Capability)]]]
[data
["." maybe]
@@ -246,7 +246,7 @@
bytes-read (InputStream::read data stream)
_ (AutoCloseable::close stream)]
(if (i/= size bytes-read)
- (wrap (taint data))
+ (wrap (integrity.taint data))
(io.io (ex.throw cannot-read-all-data path)))))
(def: (size _)
diff --git a/stdlib/source/lux/world/net/http.lux b/stdlib/source/lux/world/net/http.lux
index 7fcdb5244..d063d75ac 100644
--- a/stdlib/source/lux/world/net/http.lux
+++ b/stdlib/source/lux/world/net/http.lux
@@ -5,7 +5,7 @@
[promise (#+ Promise)]
[frp (#+ Channel)]]
[security
- [taint (#+ Dirty)]]]
+ [integrity (#+ Dirty)]]]
[data
[format
[context (#+ Context)]]]
diff --git a/stdlib/source/lux/world/net/http/request.lux b/stdlib/source/lux/world/net/http/request.lux
index 9db7e6973..03c78fca8 100644
--- a/stdlib/source/lux/world/net/http/request.lux
+++ b/stdlib/source/lux/world/net/http/request.lux
@@ -7,7 +7,7 @@
["." promise (#+ Promise)]
["." frp]]
[security
- ["." taint (#+ Dirty)]]]
+ ["." integrity (#+ Dirty)]]]
[data
["." maybe]
["." error (#+ Error)]
@@ -54,14 +54,14 @@
(def: #export (json server)
(-> (-> (Dirty JSON) Server) Server)
(function (_ request)
- (let [[identification protocol resource message] (taint.trust request)]
+ (let [[identification protocol resource message] (integrity.trust request)]
(do promise.Monad<Promise>
[?raw (read-text-body (get@ #//.body message))]
(case (do error.Monad<Error>
[raw ?raw]
(:: json.Codec<Text,JSON> decode raw))
(#error.Success content)
- (server (taint.taint content) request)
+ (server (integrity.taint content) request)
(#error.Failure error)
(promise.resolved ..failure))))))
@@ -69,12 +69,12 @@
(def: #export (text server)
(-> (-> (Dirty Text) Server) Server)
(function (_ request)
- (let [[identification protocol resource message] (taint.trust request)]
+ (let [[identification protocol resource message] (integrity.trust request)]
(do promise.Monad<Promise>
[?raw (read-text-body (get@ #//.body message))]
(case ?raw
(#error.Success content)
- (server (taint.taint content) request)
+ (server (integrity.taint content) request)
(#error.Failure error)
(promise.resolved ..failure))))))
@@ -82,7 +82,7 @@
(def: #export (query property server)
(All [a] (-> (Property a) (-> (Dirty a) Server) Server))
(function (_ request)
- (let [[identification protocol resource message] (taint.trust request)
+ (let [[identification protocol resource message] (integrity.trust request)
full (get@ #//.uri resource)
[uri query] (|> full
(text.split-with "?")
@@ -90,10 +90,10 @@
(case (do error.Monad<Error>
[query (//query.parameters query)
input (context.run query property)]
- (wrap [(taint.taint [identification protocol (set@ #//.uri uri resource) message])
+ (wrap [(integrity.taint [identification protocol (set@ #//.uri uri resource) message])
input]))
(#error.Success [request input])
- (server (taint.taint input) request)
+ (server (integrity.taint input) request)
(#error.Failure error)
(promise.resolved ..failure)))))
@@ -101,7 +101,7 @@
(def: #export (form property server)
(All [a] (-> (Property a) (-> (Dirty a) Server) Server))
(function (_ request)
- (let [[identification protocol resource message] (taint.trust request)]
+ (let [[identification protocol resource message] (integrity.trust request)]
(do promise.Monad<Promise>
[?body (read-text-body (get@ #//.body message))]
(case (do error.Monad<Error>
@@ -109,7 +109,7 @@
form (//query.parameters body)]
(context.run form property))
(#error.Success input)
- (server (taint.taint input) request)
+ (server (integrity.taint input) request)
(#error.Failure error)
(promise.resolved ..failure))))))
@@ -117,7 +117,7 @@
(def: #export (cookies property server)
(All [a] (-> (Property a) (-> (Dirty a) Server) Server))
(function (_ request)
- (let [[identification protocol resource message] (taint.trust request)]
+ (let [[identification protocol resource message] (integrity.trust request)]
(case (do error.Monad<Error>
[cookies (|> (get@ #//.headers message)
(dictionary.get "Cookie")
@@ -125,7 +125,7 @@
//cookie.get)]
(context.run cookies property))
(#error.Success input)
- (server (taint.taint input) request)
+ (server (integrity.taint input) request)
(#error.Failure error)
(promise.resolved ..failure)))))
diff --git a/stdlib/source/lux/world/net/http/route.lux b/stdlib/source/lux/world/net/http/route.lux
index e430b9739..1825b2795 100644
--- a/stdlib/source/lux/world/net/http/route.lux
+++ b/stdlib/source/lux/world/net/http/route.lux
@@ -5,7 +5,7 @@
[concurrency
["." promise]]
[security
- ["." taint]]]
+ ["." integrity]]]
[data
["." maybe]
["." text ("text/." Equivalence<Text>)]]]
@@ -17,7 +17,7 @@
[(def: #export (<name> server)
(-> Server Server)
(function (_ request)
- (let [[identification protocol resource message] (taint.trust request)]
+ (let [[identification protocol resource message] (integrity.trust request)]
(case (get@ #//.scheme protocol)
<scheme>
(server request)
@@ -33,7 +33,7 @@
[(def: #export (<name> server)
(-> Server Server)
(function (_ request)
- (let [[identification protocol resource message] (taint.trust request)]
+ (let [[identification protocol resource message] (integrity.trust request)]
(case (get@ #//.method resource)
<method>
(server request)
@@ -55,7 +55,7 @@
(def: #export (uri path server)
(-> URI Server Server)
(function (_ request)
- (let [[identification protocol resource message] (taint.trust request)]
+ (let [[identification protocol resource message] (integrity.trust request)]
(if (text/= path (get@ #//.uri resource))
(server request)
(promise.resolved //response.not-found)))))
@@ -63,14 +63,14 @@
(def: #export (sub path server)
(-> URI Server Server)
(function (_ request)
- (let [[identification protocol resource message] (taint.trust request)]
+ (let [[identification protocol resource message] (integrity.trust request)]
(if (text.starts-with? path (get@ #//.uri resource))
- (server (taint.taint [identification
- protocol
- (update@ #//.uri
- (|>> (text.clip' (text.size path)) maybe.assume)
- resource)
- message]))
+ (server (integrity.taint [identification
+ protocol
+ (update@ #//.uri
+ (|>> (text.clip' (text.size path)) maybe.assume)
+ resource)
+ message]))
(promise.resolved //response.not-found)))))
(def: #export (or primary alternative)
diff --git a/stdlib/source/lux/world/net/tcp.jvm.lux b/stdlib/source/lux/world/net/tcp.jvm.lux
index cd8543f3a..de1d9ffef 100644
--- a/stdlib/source/lux/world/net/tcp.jvm.lux
+++ b/stdlib/source/lux/world/net/tcp.jvm.lux
@@ -7,7 +7,7 @@
[task (#+ Task)]
["." frp]]
[security
- ["." taint (#+ Dirty taint)]]]
+ ["." integrity (#+ Dirty)]]]
[data
["." error (#+ Error)]]
[world
@@ -73,7 +73,7 @@
[#let [data (binary.create size)]
bytes-read (InputStream::read data +0 (.int size) input)]
(wrap [(.nat bytes-read)
- (taint data)])))
+ (integrity.taint data)])))
(def: (write data)
(do io.Monad<Process>
diff --git a/stdlib/source/lux/world/net/udp.jvm.lux b/stdlib/source/lux/world/net/udp.jvm.lux
index 3e9015b56..c474c5c79 100644
--- a/stdlib/source/lux/world/net/udp.jvm.lux
+++ b/stdlib/source/lux/world/net/udp.jvm.lux
@@ -7,7 +7,7 @@
["." promise (#+ Promise)]
[task (#+ Task)]]
[security
- ["." taint (#+ Dirty taint)]]]
+ ["." integrity (#+ Dirty)]]]
[data
["." error (#+ Error)]
["." maybe]
@@ -94,7 +94,7 @@
(wrap [bytes-read
{#//.address (|> packet DatagramPacket::getAddress InetAddress::getHostAddress)
#//.port (.nat (DatagramPacket::getPort packet))}
- (taint data)]))))
+ (integrity.taint data)]))))
(def: (write [location data])
(do io.Monad<Process>
diff --git a/stdlib/test/test/lux/control/security/taint.lux b/stdlib/test/test/lux/control/security/integrity.lux
index 81b17d407..8b1da6780 100644
--- a/stdlib/test/test/lux/control/security/taint.lux
+++ b/stdlib/test/test/lux/control/security/integrity.lux
@@ -4,7 +4,7 @@
[hash (#+ Hash)]
[monad (#+ do)]
[security
- ["@" taint]]]
+ ["@" integrity]]]
[data
["." error]
["." text ("text/." Equivalence<Text>)
diff --git a/stdlib/test/test/lux/world/file.lux b/stdlib/test/test/lux/world/file.lux
index d87ea7fc5..ab1406475 100644
--- a/stdlib/test/test/lux/world/file.lux
+++ b/stdlib/test/test/lux/world/file.lux
@@ -4,7 +4,7 @@
[control
[monad (#+ do)]
[security
- ["." taint (#+ Dirty)]]]
+ ["." integrity (#+ Dirty)]]]
[concurrency
["." promise]]
[data
@@ -58,7 +58,7 @@
_ (:: file over-write data)
content (:: file content [])
_ (:: file delete [])]
- (wrap (:: binary.Equivalence<Binary> = data (taint.trust content)))))]
+ (wrap (:: binary.Equivalence<Binary> = data (integrity.trust content)))))]
(assert "Can write/read files."
(error.default #0 result)))))
@@ -99,11 +99,11 @@
(:: binary.Equivalence<Binary> =
dataL
(error.assume (binary.slice 0 (dec file-size)
- (taint.trust content))))
+ (integrity.trust content))))
(:: binary.Equivalence<Binary> =
dataR
(error.assume (binary.slice file-size (dec read-size)
- (taint.trust content))))))))]
+ (integrity.trust content))))))))]
(assert "Can append to files."
(error.default #0 result))))
(wrap (do promise.Monad<Promise>
diff --git a/stdlib/test/test/lux/world/net/udp.lux b/stdlib/test/test/lux/world/net/udp.lux
index e41082d35..9e0079211 100644
--- a/stdlib/test/test/lux/world/net/udp.lux
+++ b/stdlib/test/test/lux/world/net/udp.lux
@@ -3,7 +3,7 @@
[control
[monad (#+ do)]
[security
- ["." taint]]]
+ ["." integrity]]]
[concurrency
["." promise]]
[data
@@ -45,12 +45,12 @@
_ (:: client write [[localhost port] from])
[bytes-from [from-address from-port] temp] (:: server read size)
#let [from-worked? (and (n/= size bytes-from)
- (:: binary.Equivalence<Binary> = from (taint.trust temp)))]
+ (:: binary.Equivalence<Binary> = from (integrity.trust temp)))]
####################
_ (:: server write [[from-address from-port] to])
[bytes-to [to-address to-port] temp] (:: client read size)
#let [to-worked? (and (n/= size bytes-to)
- (:: binary.Equivalence<Binary> = to (taint.trust temp))
+ (:: binary.Equivalence<Binary> = to (integrity.trust temp))
(n/= port to-port))]
####################
_ (:: client close [])
diff --git a/stdlib/test/tests.lux b/stdlib/test/tests.lux
index 572a69e02..6d99d905a 100644
--- a/stdlib/test/tests.lux
+++ b/stdlib/test/tests.lux
@@ -3,177 +3,185 @@
[cli (#+ program:)]
["." test]
## TODO: Test these modules
- [control
- ["._" contract]
- ["._" concatenative]
- ["._" predicate]
- [monad
- ["._" free]]]
- [data
- ["._" env]
- ["._" trace]
- ["._" store]
- ["._" tainted]
- [format
- ["._" context]
- ["._" html]
- ["._" css]
- ["._" binary]]
- [collection
- [tree
- [rose
- ["._" parser]]]
- [dictionary
- ["._" plist]]
- [set
- ["._" multi]]]
- [text
- ["._" buffer]]]
- ["._" macro
- [poly
- ["._" json]]]
- [type
- ["._" unit]
- ["._" refinement]
- ["._" quotient]]
- [world
- ["._" environment]
- ["._" console]]
- [compiler
- [host
- [".H" scheme]]
- ["._" cli]
- ["._" default
- ["._" evaluation]
- [phase
- ["._" translation
- [scheme
- ["._scheme" primitive]
- ["._scheme" structure]
- ["._scheme" reference]
- ["._scheme" function]
- ["._scheme" loop]
- ["._scheme" case]
- ["._scheme" extension]
- ["._scheme" extension/common]
- ["._scheme" expression]]]
- [extension
- ["._" statement]]]
- ["._default" cache]]
- [meta
- ["._meta" io
- ["._meta_io" context]
- ["._meta_io" archive]]
- ["._meta" archive]
- ["._meta" cache]]]
- ["._" interpreter
- ["._interpreter" type]]]
+ ## [control
+ ## ["._" contract]
+ ## ["._" concatenative]
+ ## ["._" predicate]
+ ## [monad
+ ## ["._" free]]]
+ ## [data
+ ## ["._" env]
+ ## ["._" trace]
+ ## ["._" store]
+ ## [format
+ ## ["._" context]
+ ## ["._" html]
+ ## ["._" css]
+ ## ["._" binary]]
+ ## [collection
+ ## [tree
+ ## [rose
+ ## ["._" parser]]]
+ ## [dictionary
+ ## ["._" plist]]
+ ## [set
+ ## ["._" multi]]]
+ ## [text
+ ## ["._" buffer]]]
+ ## ["._" macro
+ ## [poly
+ ## ["._" json]]]
+ ## [type
+ ## ["._" unit]
+ ## ["._" refinement]
+ ## ["._" quotient]]
+ ## [world
+ ## ["._" environment]
+ ## ["._" console]]
+ ## [compiler
+ ## [host
+ ## [".H" scheme]]
+ ## ["._" cli]
+ ## ["._" default
+ ## ["._" evaluation]
+ ## [phase
+ ## ["._" translation
+ ## [scheme
+ ## ["._scheme" primitive]
+ ## ["._scheme" structure]
+ ## ["._scheme" reference]
+ ## ["._scheme" function]
+ ## ["._scheme" loop]
+ ## ["._scheme" case]
+ ## ["._scheme" extension]
+ ## ["._scheme" extension/common]
+ ## ["._scheme" expression]]]
+ ## [extension
+ ## ["._" statement]]]
+ ## ["._default" cache]]
+ ## [meta
+ ## ["._meta" io
+ ## ["._meta_io" context]
+ ## ["._meta_io" archive]]
+ ## ["._meta" archive]
+ ## ["._meta" cache]]]
+ ## ["._" interpreter
+ ## ["._interpreter" type]]
+ ]
## TODO: Must have 100% coverage on tests.
[test
- ["_." lux]
+ ## ["_." lux]
[lux
- ["_." cli]
- ["_." host]
- ["_." io]
- [time
- ["_." instant]
- ["_." duration]
- ["_." date]]
- [concurrency
- ["_." actor]
- ["_." atom]
- ["_." frp]
- ["_." promise]
- ["_." stm]
- ["_." semaphore]]
- [control
- ["_." exception]
- ["_." interval]
- ["_." pipe]
- ["_." continuation]
- ["_." reader]
- ["_." writer]
- ["_." state]
- ["_." parser]
- ["_." thread]
- ["_." region]]
- [data
- ["_." bit]
- ["_." color]
- ["_." error]
- ["_." name]
- ["_." identity]
- ["_." lazy]
- ["_." maybe]
- ["_." product]
- ["_." sum]
- [number
- ## "_." number ## TODO: FIX Specially troublesome...
- ["_." i64]
- ["_." ratio]
- ["_." complex]]
- ["_." text
- ["_." format]
- ["_." lexer]
- ["_." regex]]
- [format
- ["_." json]
- ["_." xml]]
- [collection
- ["_." array]
- ["_." bits]
- ["_." list]
- ["_." stack]
- ["_." row]
- ["_." sequence]
- ["_." dictionary
- ["dictionary_." ordered]]
- ["_." set
- ["set_." ordered]]
- ["_." queue
- ["_." priority]]
- [tree
- ["_." rose
- ["_." zipper]]]]]
- ["_." math
- ["_." random]
- ["_." modular]
- [logic
- ["_." continuous]
- ["_." fuzzy]]]
- [macro
- ["_." code]
- ["_." syntax]
- [poly
- ["poly_." equivalence]
- ["poly_." functor]]]
- ["_." type
- ["_." check]
- ## ["_." implicit] ## TODO: FIX Specially troublesome...
- ["_." resource]]
- [compiler
- [default
- ["_default/." syntax]
- [phase
- [analysis
- ["_.A" primitive]
- ["_.A" structure]
- ["_.A" reference]
- ["_.A" case]
- ["_.A" function]
- [procedure
- ["_.A" common]]]
- [synthesis
- ["_.S" primitive]
- ["_.S" structure]
- ["_.S" case]
- ["_.S" function]]]]]
- [world
- ["_." binary]
- ## ["_." file] ## TODO: FIX Specially troublesome...
- [net
- ["_." tcp]
- ["_." udp]]]]]
+ ## ["_." cli]
+ ## ["_." host]
+ [host
+ [jvm (#+)]]
+ ## ["_." io]
+ ## [time
+ ## ["_." instant]
+ ## ["_." duration]
+ ## ["_." date]]
+ ## [control
+ ## ## ["_." exception]
+ ## ## ["_." interval]
+ ## ## ["_." pipe]
+ ## ## ["_." continuation]
+ ## ## ["_." reader]
+ ## ## ["_." writer]
+ ## ## ["_." state]
+ ## ## ["_." parser]
+ ## ## ["_." thread]
+ ## ## ["_." region]
+ ## ## [security
+ ## ## ["_." privacy]
+ ## ## ["._" integrity]]
+ ## [concurrency
+ ## ["_." actor]
+ ## ["_." atom]
+ ## ["_." frp]
+ ## ["_." promise]
+ ## ["_." stm]
+ ## ## ["_." semaphore]
+ ## ]]
+ ## [data
+ ## ["_." bit]
+ ## ["_." color]
+ ## ["_." error]
+ ## ["_." name]
+ ## ["_." identity]
+ ## ["_." lazy]
+ ## ["_." maybe]
+ ## ["_." product]
+ ## ["_." sum]
+ ## [number
+ ## ## "_." number ## TODO: FIX Specially troublesome...
+ ## ["_." i64]
+ ## ["_." ratio]
+ ## ["_." complex]]
+ ## ["_." text
+ ## ## ["_." format]
+ ## ["_." lexer]
+ ## ["_." regex]]
+ ## [format
+ ## ## ["_." json]
+ ## ["_." xml]]
+ ## ## [collection
+ ## ## ["_." array]
+ ## ## ["_." bits]
+ ## ## ["_." list]
+ ## ## ["_." stack]
+ ## ## ["_." row]
+ ## ## ["_." sequence]
+ ## ## ["_." dictionary
+ ## ## ["dictionary_." ordered]]
+ ## ## ["_." set
+ ## ## ["set_." ordered]]
+ ## ## ["_." queue
+ ## ## ["_." priority]]
+ ## ## [tree
+ ## ## ["_." rose
+ ## ## ["_." zipper]]]]
+ ## ]
+ ## ["_." math
+ ## ["_." random]
+ ## ["_." modular]
+ ## [logic
+ ## ["_." continuous]
+ ## ["_." fuzzy]]]
+ ## [macro
+ ## ["_." code]
+ ## ["_." syntax]
+ ## [poly
+ ## ["poly_." equivalence]
+ ## ["poly_." functor]]]
+ ## ["_." type
+ ## ["_." check]
+ ## ## ["_." implicit] ## TODO: FIX Specially troublesome...
+ ## ["_." resource]]
+ ## [compiler
+ ## [default
+ ## ["_default/." syntax]
+ ## [phase
+ ## [analysis
+ ## ["_.A" primitive]
+ ## ["_.A" structure]
+ ## ["_.A" reference]
+ ## ["_.A" case]
+ ## ["_.A" function]
+ ## [procedure
+ ## ["_.A" common]]]
+ ## [synthesis
+ ## ["_.S" primitive]
+ ## ["_.S" structure]
+ ## ["_.S" case]
+ ## ["_.S" function]]]]]
+ ## [world
+ ## ["_." binary]
+ ## ["_." file]
+ ## [net
+ ## ["_." tcp]
+ ## ["_." udp]]]
+ ]]
)
(program: args