github.com/avenga/couper@v1.12.2/server/testdata/integration/config/11_couper.hcl (about) 1 server { 2 files { 3 document_root = "../files/htdocs_a" 4 5 cors { 6 allowed_origins = ["*"] 7 } 8 } 9 10 spa { 11 bootstrap_file = "../files/htdocs_a/index.html" 12 paths = ["/app/**"] 13 14 cors { 15 allowed_origins = ["*"] 16 } 17 } 18 19 api { 20 base_path = "/api1" 21 22 cors { 23 allowed_origins = ["*"] 24 } 25 26 endpoint "/unrestricted" { 27 access_control = ["token"] 28 required_permission = { 29 get = "foo" 30 head = "foo" 31 post = "foo" 32 put = "foo" 33 patch = "foo" 34 # no delete, no options, no trace 35 brew = "foo" 36 } 37 response { 38 body = "a" 39 } 40 } 41 42 endpoint "/restricted" { 43 access_control = ["token"] 44 allowed_methods = ["GET", "Post", "delete", "BREW"] 45 required_permission = { 46 get = "foo" 47 head = "foo" 48 post = "foo" 49 put = "foo" 50 patch = "foo" 51 # no delete, no options, no trace 52 brew = "foo" 53 } 54 55 response { 56 body = "a" 57 } 58 } 59 60 endpoint "/wildcard" { 61 allowed_methods = ["*"] 62 required_permission = "" 63 64 response { 65 body = "a" 66 } 67 } 68 69 endpoint "/wildcardAndMore" { 70 allowed_methods = ["get", "*", "PuT", "brew"] 71 required_permission = "" 72 73 response { 74 body = "a" 75 } 76 } 77 78 endpoint "/blocked" { 79 allowed_methods = [] 80 disable_access_control = ["token"] 81 82 response { 83 body = "a" 84 } 85 } 86 } 87 88 api { 89 base_path = "/api2" 90 allowed_methods = ["PUT"] 91 92 endpoint "/restricted" { 93 allowed_methods = ["GET", "Post", "delete", "BREW"] 94 95 response { 96 body = "a" 97 } 98 } 99 100 endpoint "/restrictedByApiOnly" { 101 response { 102 body = "a" 103 } 104 } 105 } 106 } 107 108 definitions { 109 jwt "token" { 110 signature_algorithm = "HS256" 111 key = "asdf" 112 permissions_claim = "scope" 113 } 114 }