Skip to content

Commit

Permalink
Misc Fixes #8 #9 #10
Browse files Browse the repository at this point in the history
  • Loading branch information
pointlander committed Nov 14, 2018
1 parent 58099f2 commit c32abe4
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 7 deletions.
2 changes: 1 addition & 1 deletion activity/anomaly/examples/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ A 1024 payloads have been fed into the anomaly detection service, and zero anoma

Now run the following to feed one more payload into the anomaly detection service:
```
curl http://localhost:9096/test --upload-file anomaly-payload.json
curl -H "Content-Type:application/json" http://localhost:9096/test --upload-file anomaly-payload.json
```

You should see the following response:
Expand Down
2 changes: 1 addition & 1 deletion activity/anomaly/examples/json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ A 1024 payloads have been fed into the anomaly detection service, and zero anoma

Now run the following to feed one more payload into the anomaly detection service:
```
curl http://localhost:9096/test --upload-file anomaly-payload.json
curl -H "Content-Type:application/json" http://localhost:9096/test --upload-file anomaly-payload.json
```

You should see the following response:
Expand Down
21 changes: 21 additions & 0 deletions activity/jwt/examples/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@ cd microgateway/activity/jwt/examples/api
```

## Testing

Generate a JWT token using the below information:
(You may use http://jwtbuilder.jamiekurtz.com/)

```
{
"issuer": "Mashling",
"audience": "www.mashling.io",
"subject": "tempuser@mail.com",
"id": "XX",
"signingMethod": "HMAC"
}
{
"key": "qwertyuiopasdfghjklzxcvbnm789101"
}
```
Note: The id in the above payload is the pet Id.

Start the gateway:
```
go run main.go
Expand All @@ -22,6 +40,7 @@ and test below scenario.
Now run the following in a new terminal:
```
curl --request GET http://localhost:9096/pets -H "Authorization: Bearer <Access_Token>"
```

You should see the following response:
```json
Expand All @@ -46,6 +65,7 @@ You should see the following response:
]
}
}
```


### Token Invalid
Expand All @@ -66,3 +86,4 @@ You should see the following response:
},
"pet":null
}
```
21 changes: 21 additions & 0 deletions activity/jwt/examples/json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@ cd microgateway/activity/jwt/examples/json
Place the Downloaded Mashling-Gateway binary in circuit-breaker-gateway folder.

## Testing

Generate a JWT token using the below information:
(You may use http://jwtbuilder.jamiekurtz.com/)

```
{
"issuer": "Mashling",
"audience": "www.mashling.io",
"subject": "tempuser@mail.com",
"id": "XX",
"signingMethod": "HMAC"
}
{
"key": "qwertyuiopasdfghjklzxcvbnm789101"
}
```
Note: The id in the above payload is the pet Id.

Create the gateway:
```
flogo create -f flogo.json
Expand All @@ -31,6 +49,7 @@ and test below scenario.
Now run the following in a new terminal:
```
curl --request GET http://localhost:9096/pets -H "Authorization: Bearer <Access_Token>"
```

You should see the following response:
```json
Expand All @@ -55,6 +74,7 @@ You should see the following response:
]
}
}
```


### Token Invalid
Expand All @@ -75,3 +95,4 @@ You should see the following response:
},
"pet":null
}
```
3 changes: 2 additions & 1 deletion activity/jwt/examples/json/flogo.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"output": {
"code": 401,
"data": {
"error": "=$.PetStorePets.outputs"
"error": "=$.jwtService.outputs",
"pet": "=$.PetStorePets.outputs.data"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions activity/sqld/examples/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ and test below scenarios.
### Payload without SQL injection attack
Run the following command:
```
curl http://localhost:9096/pets --upload-file payload.json
curl -H "Content-Type:application/json" http://localhost:9096/pets --upload-file payload.json
```

You should see the following response:
Expand All @@ -47,7 +47,7 @@ You should see the following response:

### Payload with SQL injection attack
```
curl http://localhost:9096/pets --upload-file attack-payload.json
curl -H "Content-Type:application/json" http://localhost:9096/pets --upload-file attack-payload.json
```

You should see the following response:
Expand Down
4 changes: 2 additions & 2 deletions activity/sqld/examples/json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ and test below scenarios.
### Payload without SQL injection attack
Run the following command:
```
curl http://localhost:9096/pets --upload-file payload.json
curl -H "Content-Type:application/json" http://localhost:9096/pets --upload-file payload.json
```

You should see the following response:
Expand All @@ -55,7 +55,7 @@ You should see the following response:

### Payload with SQL injection attack
```
curl http://localhost:9096/pets --upload-file attack-payload.json
curl -H "Content-Type:application/json" http://localhost:9096/pets --upload-file attack-payload.json
```

You should see the following response:
Expand Down

0 comments on commit c32abe4

Please sign in to comment.