Skip to content

Commit

Permalink
Merge pull request #18 from stfbk/api
Browse files Browse the repository at this point in the history
Add support for API
  • Loading branch information
mattebit authored Nov 11, 2024
2 parents 41bc054 + e24342c commit 3b430f5
Show file tree
Hide file tree
Showing 10 changed files with 864 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store

# dev env
**/*.http
tool/.devcontainer/*
76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,79 @@ Some parts of the tool that manages SAML certificates has been built by using po

Parts of the tool that manage JWTs has been built using nimbus-jose-jwt
<https://connect2id.com/products/nimbus-jose-jwt>

# MIG-T API Documentation

Explore the API endpoints and documentation here: <https://app.swaggerhub.com/apis-docs/PGSENO02/MIG-TAPIs/1.0.0#/>

### API Endpoints

MIG-T supports both GUI and API interaction. Two endpoints are available for API interaction:

#### /execute [POST]

Check the validity of the test and run the test.

Input:
```json
{
"test": "test content",
"sessions": {
"session_name_1": "session content",
"session_name_2": "session content"
}
}
```

Output:
- HTTP status code 200 (ok)

#### /result [GET]

Checks whether the test is finished and returns the result.

Output:
- If the test is not finished:
```json
{
"finished": false
}
```
- If the test is finished:
```json
{
"finished": true,
"tests": [
{
"references": "",
"test name": "",
"description": "",
"type": "",
"mitigations": "",
"result": ""
}
]
}
```
A verbose parameter is available (`/result?verbose=true`) to retrieve data from requests. For example:
```json
{
"finished": true,
"tests": [
{
"references": "",
"test name": "Does the OP release Access Tokens with the use of refresh tokens",
"description": "In this test the offline access flow is accomplished and a refresh token is obtained. After this, a new token request is done with \"grant_type\u003drefresh_token\" and the refresh token inserted in the \"refresh_token\" parameter. The response must include the Access Token",
"type": "active",
"mitigations": "",
"result": "success",
"details": [
{
"message type": "Authentication request",
"request": "base64_of_the_request"
}
]
}
]
}
```
8 changes: 8 additions & 0 deletions tool/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion tool/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 49 additions & 9 deletions tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20231013</version>
<version>20240303</version>
</dependency>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>9.38-rc3</version>
<version>9.41.2</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
Expand All @@ -27,17 +27,17 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.16.1</version>
<version>4.25.0</version>
</dependency>
<dependency>
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
</dependency>
<dependency>
<groupId>com.sun.xml.security</groupId>
Expand All @@ -47,7 +47,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.10.1</version>
<version>5.11.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -58,7 +58,7 @@
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>2.5.0</version>
<version>2.5.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand All @@ -73,12 +73,44 @@
<dependency>
<groupId>com.networknt</groupId>
<artifactId>json-schema-validator</artifactId>
<version>1.2.0</version>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.11.0</version>
<version>1.12.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>11.0.24</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>11.0.24</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<version>0.12.6</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-impl</artifactId>
<version>0.12.6</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>
<version>0.12.6</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-crypto</artifactId>
<version>6.3.3</version>
</dependency>
</dependencies>

Expand All @@ -88,6 +120,14 @@
</properties>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Loading

0 comments on commit 3b430f5

Please sign in to comment.