Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postman new collection format #45

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}
414 changes: 414 additions & 0 deletions CustomJWTGenerator/.factorypath

Large diffs are not rendered by default.

631 changes: 631 additions & 0 deletions CustomJWTTransformer/.factorypath

Large diffs are not rendered by default.

411 changes: 411 additions & 0 deletions XACML-handler/.factorypath

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package org.wso2.carbon.apimgt.tutorial.trainschedule;

import java.util.List;
import java.util.stream.Collector;
import java.util.stream.Collectors;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -9,6 +12,7 @@
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
Expand All @@ -22,8 +26,8 @@ public void handleHead() {
}

@GetMapping({ "/schedules" })
public List<ScheduleEntry> getSchedules() {
return this.manager.getAllSchedules();
public List<ScheduleEntry> getSchedules(@RequestParam(required = false) String to) {
return this.manager.getAllSchedules().subList(0, 1);
}

@PostMapping({ "/schedules" })
Expand Down
2 changes: 1 addition & 1 deletion apim-tutorial/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ services:
db:
image: mysql:8.0.23
ports:
- 8083:3306
- 8083:3306 #out/in
command: --init-file /data/application/init.sql
volumes:
- ./dockerfiles/database/init.sql:/data/application/init.sql
Expand Down
Binary file modified apim-tutorial/dockerfiles/backends/train-operations.war
Binary file not shown.
162 changes: 162 additions & 0 deletions apim-tutorial/resources/Access_Control_Demo.postman_collection2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
{
"info": {
"_postman_id": "5d61574b-b9c0-41a8-8006-18d092145385",
"name": "Access Control Demo",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
"name": "Jenny Access Token Request",
"request": {
"auth": {
"type": "basic",
"basic": {
"password": "{{client_secret}}",
"username": "{{client_id}}"
}
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "password",
"type": "text"
},
{
"key": "username",
"value": "[email protected]",
"type": "text"
},
{
"key": "password",
"value": "user123",
"type": "text"
},
{
"key": "scope",
"value": "schedule_admin",
"type": "text"
}
]
},
"url": "https://{{host}}:9443/oauth2/token"
},
"response": []
},
{
"name": "George Access Token Request",
"request": {
"auth": {
"type": "basic",
"basic": {
"password": "{{client_secret}}",
"username": "{{client_id}}"
}
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "password",
"type": "text"
},
{
"key": "username",
"value": "[email protected]",
"type": "text"
},
{
"key": "password",
"value": "user123",
"type": "text"
},
{
"key": "scope",
"value": "schedule_admin",
"type": "text"
}
]
},
"url": "https://{{host}}:9443/oauth2/token"
},
"response": []
},
{
"name": "Invoke API",
"request": {
"auth": {
"type": "bearer",
"bearer": {
"token": "eyJ4NXQiOiJZems0WkRZMk5XTTRNVGN5TlRZMU1URTFZemMyWlRZeVlURmtZemt5WTJZMlpERTBNbU5pTjJaaFlUVTFNalEyT1RBd00yUXlNV05qWkdVeFpUTXdZdyIsImtpZCI6Ill6azRaRFkyTldNNE1UY3lOVFkxTVRFMVl6YzJaVFl5WVRGa1l6a3lZMlkyWkRFME1tTmlOMlpoWVRVMU1qUTJPVEF3TTJReU1XTmpaR1V4WlRNd1l3X1JTMjU2IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJqZW5ueSIsImF1dCI6IkFQUExJQ0FUSU9OX1VTRVIiLCJhdWQiOiJma0pvUkhQRDdPblRkZm5qaldGTWw4MGhkMDhhIiwibmJmIjoxNjE4OTk2NjgwLCJhenAiOiJma0pvUkhQRDdPblRkZm5qaldGTWw4MGhkMDhhIiwic2NvcGUiOiJzY2hlZHVsZV9hZG1pbiIsImlzcyI6Imh0dHBzOlwvXC8zNS4yMzEuNzkuMzo5NDQzXC9vYXV0aDJcL3Rva2VuIiwiZXhwIjoxNjE5MDAwMjgwLCJpYXQiOjE2MTg5OTY2ODAsImp0aSI6IjY2YjQzMzc1LWU5MmUtNDVlMy1hNmM2LTcwMjRhNTExZjVjZiJ9.JywJ9KzQLrHdE-cuu4opS6xZLcNOkP8-8mLKMZO_uUDkIzmfu1T4qM5bJEWEd5cDrldbRs0m4mo1Gb7AkHkk4YcnTLCqK6Vp0BAs4QeHwa_l0eAluEEW8RTKD5o8Cye2_9TggBU67MqdJL5K7QUTlJI4_05bMdc_gThXBTmYsi-yWmomPyWnmlVXRF1saF2K5mes3Sg5HhMcWO6PKqwoPCSLyDjf-4WARbybLqBn6KUpnzs2_bqwNE5KMtIyVAEUpdPvYutkO-U9MIYLeR7jXH9teKrEwkVyHvAeMwfVK0U5fSFjt3avnrxQlPbzFzW9irnwaE3Vv0e7pdRh7XtfQw"
}
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"entryId\":\"10\",\n \"startTime\":\"18:30\",\n \"endTime\":\"20.30\",\n \"from\":\"London\",\n \"to\":\"Oxford\",\n \"trainType\":\"Standard\"\n}\n"
},
"url": "https://{{host}}:8243/t/coltrain.com/coltrain-schedule/1.0.0/schedules"
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "host",
"value": "35.231.79.3",
"type": "string"
},
{
"key": "client_id",
"value": "fkJoRHPD7OnTdfnjjWFMl80hd08a",
"type": "string"
},
{
"key": "client_secret",
"value": "e5rhfTwykc0EQmsQStf1lSRqHw4a",
"type": "string"
}
]
}
9 changes: 5 additions & 4 deletions apim-tutorial/resources/sdk-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wso2</groupId>
<artifactId>org.wso2.client.QuantisTrainAPI</artifactId>
<version>1.0.0</version>
</dependency>
<groupId>org.wso2</groupId>
<artifactId>org.wso2.client.QuantisTrainAPI</artifactId>
<version>1.0.0</version>
</dependency>

</dependencies>
<build>
<finalName>sdk-demo-${project.version}</finalName>
Expand Down