Skip to content

Commit

Permalink
Merge pull request #1 from joshtwist/zup-2022-5-6-1757
Browse files Browse the repository at this point in the history
test
  • Loading branch information
joshtwist authored Jun 7, 2022
2 parents b77cb55 + 74c4cdc commit e7e048a
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 1 deletion.
90 changes: 89 additions & 1 deletion config/routes.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
{
"routes": [
{
"methods": [
"GET",
"POST"
],
"path": "/hi-mom",
"summary": "Hello This new route",
"description": "Lorem ipsum dolor sit amet, **consectetur adipiscing** elit, sed do `eiusmod tempor` incididunt ut labore et dolore magna aliqua.",
"version": "v1",
"corsPolicy": "none",
"handler": {
"export": "urlRewriteHandler",
"module": "$import(@zuplo/runtime)",
"options": {
"rewritePattern": "https://welcome.zuplo.io/"
}
},
"policies": {
"inbound": []
}
},
{
"methods": [
"GET"
Expand All @@ -18,7 +39,8 @@
"policies": {
"inbound": [
"api-key-auth-inbound",
"set-headers-inbound"
"set-headers-inbound",
"basic-auth-inbound"
]
}
},
Expand Down Expand Up @@ -90,6 +112,28 @@
"custom-code-inbound"
]
}
},
{
"methods": [
"POST"
],
"path": "/chad-mountain-rescue",
"summary": "",
"description": "Lorem ipsum dolor sit amet, **consectetur adipiscing** elit, sed do `eiusmod tempor` incididunt ut labore et dolore magna aliqua.",
"version": "v1",
"corsPolicy": "none",
"handler": {
"export": "urlRewriteHandler",
"module": "$import(@zuplo/runtime)",
"options": {
"rewritePattern": "https://welcome.zuplo.io/"
}
},
"policies": {
"inbound": [
"validate-json-schema-inbound-1"
]
}
}
],
"versions": [
Expand Down Expand Up @@ -173,6 +217,50 @@
},
"name": "set-headers-inbound",
"policyType": "set-headers-inbound"
},
{
"handler": {
"export": "Auth0JwtInboundPolicy",
"module": "$import(@zuplo/runtime)",
"options": {
"allowUnauthenticatedRequests": false,
"auth0Domain": "$env(AUTH0_DOMAIN)",
"audience": "$env(AUTH0_AUDIENCE)"
}
},
"name": "auth0-jwt-auth-inbound",
"policyType": "auth0-jwt-auth-inbound"
},
{
"handler": {
"export": "BasicAuthInboundPolicy",
"module": "$import(@zuplo/runtime)",
"options": {
"accounts": [
{
"data": {
"number": 1
},
"password": "PASSWORD",
"username": "USERNAME"
}
],
"allowUnauthenticatedRequests": false
}
},
"name": "basic-auth-inbound",
"policyType": "basic-auth-inbound"
},
{
"handler": {
"export": "ValidateJsonSchemaInbound",
"module": "$import(@zuplo/runtime)",
"options": {
"validator": "$import(./schemas/example-schema.json)"
}
},
"name": "validate-json-schema-inbound-1",
"policyType": "validate-json-schema-inbound"
}
]
}
2 changes: 2 additions & 0 deletions modules/jack-demo-policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export default async function (
return request;
}

context.log.info('foo');

return new Response(`Nope, you gotta be an super-admin`, {
status: 401
});
Expand Down
8 changes: 8 additions & 0 deletions tests/logging.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"description" : "A simple POST to the initial route",
"pathname":"/",
"method":"GET",
"headers": {
"content-type": "application/json"
}
}

0 comments on commit e7e048a

Please sign in to comment.