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

Apiv2 #1128

Merged
merged 50 commits into from
Nov 14, 2024
Merged

Apiv2 #1128

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
45ffc99
Add compression support
Oct 25, 2023
112b864
WIP: Add extra development tooling
Nov 7, 2023
a3d5554
WIP: Start conversion of hashtopolis to new JSON:API standard
Nov 7, 2023
516d0e1
WIP: Start of GET of JSON:API implementation
Nov 7, 2023
afbacf2
Merge branch '1018-feature-convert-homebrew-apiv2-interface-to-jsonap…
Nov 7, 2023
729db02
Fix ensure consistent composer packages get installed.
rixvet Nov 27, 2023
63f9f8f
Fix expansion parameter not working.
rixvet Nov 27, 2023
cda1899
Cosmetic: Rename variables to match new meaning
rixvet Nov 27, 2023
3068cd4
Add interactive debugging of pytest unit files
rixvet Nov 27, 2023
cd85fd9
WIP: Start working on delete and creation actions
rixvet Nov 27, 2023
8328a41
Fix 500 returned when page is not found
rixvet Nov 29, 2023
4a7222c
WIP: Innitial support for PATCH/CREATE operations
rixvet Nov 29, 2023
ca60fd9
WIP: All unit tests complete. GET mostly implemented
rixvet Nov 29, 2023
e5f405f
WIP: Need ER relations for CREATE
rixvet Dec 4, 2023
127c7a0
WIP: Example model for CREATE in client
rixvet Jan 10, 2024
fda84d9
Updated PHP dependencies
jessevz Sep 15, 2024
66a3bae
Refactor pagination to adhere to JSON:API standards
Oct 2, 2024
273f855
Refactored links object to adhere to JSON:API standard
Oct 2, 2024
c5fef6a
feat: Add support for limit queries in ORM
jessevz Oct 10, 2024
75374ec
Made pagination and sorting working by fixing some logic bugs
jessevz Oct 10, 2024
fd17f06
Merge remote-tracking branch 'origin/apiv2' into apiv2
jessevz Oct 10, 2024
0da86c4
Added more input filtering for the Limit filter
jessevz Oct 11, 2024
22755a7
Fixed the location header to comply to the JSON API standard in case …
Oct 14, 2024
c627301
WIP: Made start to link first and last attribute in json response to …
Oct 14, 2024
e5253bc
Merge branch 'apiv2' of github.com:jessevz/server into apiv2
Oct 14, 2024
67bf3c2
Added page size exceeded error handling and started implementing link…
jessevz Oct 14, 2024
ee35c4e
Merge branch 'apiv2' of github.com:jessevz/server into apiv2
jessevz Oct 15, 2024
913e6e8
FEAT: Implemented first and last in paginated json response
jessevz Oct 15, 2024
25ea97b
FEAT: Implemented previous and next within JSON pagination response
jessevz Oct 15, 2024
d137775
FEAT: Made PATCH request compliant to JSON API 1.1
jessevz Oct 16, 2024
8a7f97f
FEAT made patch To-One relationship compliant to JSON API standard
jessevz Oct 17, 2024
f75d7d1
FEAT made get request to relationship working also throught intermedi…
jessevz Oct 22, 2024
0455bdd
FEAT made pagination in to many relationships work
jessevz Oct 22, 2024
c28309b
FEAT implemented patching to many relationships
jessevz Oct 24, 2024
2be9783
FEAT added to many relationship from cracker to task in API
jessevz Oct 24, 2024
9d00426
FEAT added to many relationship from crackerType to task in API
jessevz Oct 24, 2024
373aad5
FEAT implemented delete to many relationship link and fixed bug in pa…
jessevz Oct 24, 2024
4df6248
FEAT fixed bug in PATCH to many relation and implemented POST to many…
jessevz Oct 28, 2024
06a3f0e
FEAT made patchOne compliant to JSON API 1.1 standard
jessevz Oct 29, 2024
8cc1802
FEAT fix a bug withing pagination and ordering and made Post one comp…
jessevz Oct 31, 2024
db9d203
FEAT updated the tests to adhere to JSON API spec
jessevz Nov 4, 2024
b67d909
FEAT added tests for pagination
jessevz Nov 7, 2024
2d0241c
clean up pagination test
jessevz Nov 7, 2024
98f07d0
Added range validation to validating data
jessevz Nov 7, 2024
0ccef46
Added a json response moduel for the responses
jessevz Nov 11, 2024
c3e4509
Added function to validate if its allowed to mutate DBA fields
jessevz Nov 12, 2024
b0beaf2
Fixed inconsitency in color len in task feautures
jessevz Nov 12, 2024
9c3b524
Added test that will verify database size constraint
jessevz Nov 13, 2024
044c4ce
Merge branch 'dev' into apiv2
jessevz Nov 13, 2024
628bea7
FEAT: made helper API endpoints compliant to json API standard, by pu…
jessevz Nov 13, 2024
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
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"xdebug.php-debug",
"bmewburn.vscode-intelephense-client",
"editorconfig.editorconfig",
"eamodio.gitlens",
"github.vscode-pull-request-github",
"ms-python.python",
"ms-python.flake8",
Expand Down
1,800 changes: 900 additions & 900 deletions .editorconfig

Large diffs are not rendered by default.

37 changes: 32 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,38 @@
}
},
{
"name": "Python: File",
"type": "python",
"request": "launch",
"program": "${file}",
"justMyCode": true
"name": "Python: htcli (list Users with Include)",
"type": "python",
"request": "launch",
"program": "./ci/apiv2/htcli.py",
"args": ["list", "Users", "-v", "DEBUG", "--include", "globalPermissionGroup"],
"justMyCode": true
},
{
"name": "Python: htcli run delete-test-data",
"type": "python",
"request": "launch",
"program": "./ci/apiv2/htcli.py",
"args": ["run", "delete-test-data", "--commit"],
"justMyCode": true
},
{
"name": "Python: Debug pytest file",
"type": "python",
"request": "launch",
"module": "pytest",
"args": ["${file}", "--exitfirst"],
"justMyCode": true,
"env": {
"_PYTEST_RAISE": "1"
},
},
{
"name": "Python: File",
"type": "python",
"request": "launch",
"program": "${file}",
"justMyCode": true
}
],
"inputs": [
Expand Down
8 changes: 7 additions & 1 deletion ci/apiv2/HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOKEN=$(curl -X POST --user admin:hashtopolis http://localhost:8080/api/v2/auth/

Fetch object:
```
curl --header "Content-Type: application/json" -X GET --header "Authorization: Bearer $TOKEN" 'http://localhost:8080/api/v2/ui/hashlists/1?expand=hashes' -d '{}'
curl --compressed --header "Authorization: Bearer $TOKEN" -g 'http://localhost:8080/api/v2/ui/hashtypes?page[size]=5'
```

Access database:
Expand All @@ -23,6 +23,12 @@ docker exec $(docker ps -aqf "ancestor=mysql:8.0") mysql -u root -phashtopolis -
docker exec $(docker ps -aqf "ancestor=mysql:8.0") tail -f /tmp/mysql_all.log
```

Shortcut for testing within development setup:
```
cd ~/src/hashtopolis/server/ci/apiv2
pytest --exitfirst --last-failed
```

### paper flipchart scribbles

#### v2 beta
Expand Down
12 changes: 12 additions & 0 deletions ci/apiv2/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os
import pytest

if os.getenv('_PYTEST_RAISE', "0") != "0":

@pytest.hookimpl(tryfirst=True)
def pytest_exception_interact(call):
raise call.excinfo.value

@pytest.hookimpl(tryfirst=True)
def pytest_internalerror(excinfo):
raise excinfo.value
2 changes: 1 addition & 1 deletion ci/apiv2/create_crackertype_001.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"typeName": "generic",
"typeName": "generic2",
"isChunkingAvailable": true
}
14 changes: 14 additions & 0 deletions ci/apiv2/dummy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
components:
schemas:
Hash:
type: object
properties:
id:
type: integer
minimum: 1
readOnly: true
userMembers:
type: array
items:
$ref: #/components/schemas/User
uniqueItems: true
Loading
Loading