-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecuritytest.aml
67 lines (54 loc) · 1.63 KB
/
securitytest.aml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
fun id x = x
fun id2 x = x
fun id3 x = x
fun id4 x = x
fun id5 x = x
fun id6 x = x
fun id7 x = x
fun test1 x =
let
val _ = print "logging debug info to good location \"tests/security/debug.txt\"\n"
val _ = print "this should be allowed\n"
in
startLoggerFile (#id#, "tests/security/debug.txt")
end
fun test2 x =
let
val _ = print "logging debug info to bad location \"private/debug.txt\"\n"
val _ = print "this should NOT be allowed"
in
startLoggerFile (#id2#, "private/debug.txt")
end
fun test3 x =
let
val _ = print "reading debug config info from default location\n"
val _ = print "this should be allowed\n"
in
startLoggerConfig #id3#
end
fun test4 x =
let
val _ = print "reading config info from good location \"tests/security/debug.config\"\n"
val _ = print "config says to log to good location \"tests/security/debug.txt\"\n"
val _ = print "this should be allowed\n"
in
startLoggerConfigFile (#id4#, "tests/security/debug.config")
end
fun test5 x =
let
val _ = print "reading config info from bad location \"private/debug.config\"\n"
val _ = print "this should NOT be allowed\n"
in
startLoggerConfigFile (#id5#, "private/debug.config")
end
fun test6 x =
let
val _ = print "reading config info from good location \"tests/security/debug.config\"\n"
val _ = print "config says to log to baddebug location \"private/debug.txt\"\n"
val _ = print "this should NOT be allowed\n"
in
startLoggerConfigFile (#id6#, "tests/security/debug2.config")
end
fun getTempFile (x:Unit):String =
"private/debug.txt"
import "library/securitytest.aml";