-
Notifications
You must be signed in to change notification settings - Fork 1
code cleanup and openapi based route creation #14
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
4728c41
small changes & cleanup
bugmaschine 39e745e
use openapi file to parse, for easy route imports
bugmaschine 8df6259
fix gin crashing due to the format
bugmaschine bea14f1
Add openapi updater
bugmaschine f28dd38
Update readme and add development.md
bugmaschine 592f9cf
improved the openapi parsing, as posts.json was broken
bugmaschine 7582572
update typos
bugmaschine efa28e8
update concurency on s3
bugmaschine d83f959
made loading additional openapi definitions easier in the future
bugmaschine 046747a
reword the readme slightly
bugmaschine 731a063
Add copyright notice from e621 OpenAPI specification
bugmaschine cafeabc
small comment update for clarity
bugmaschine 6eb0d90
base64 is not encryption
bugmaschine d2c7bfe
add go test on push
bugmaschine 7905d60
try fixing go test
bugmaschine ef8b4dc
trying to fix the testing again
bugmaschine f091c3f
fix formatting
bugmaschine 6c5ed01
Potential fix for code scanning alert no. 3: Workflow does not contai…
bugmaschine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Upload Go test results | ||
| # https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-go | ||
| on: [push] | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| go-version: [ '1.24.3' ] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: ${{ matrix.go-version }} | ||
| - name: Install dependencies | ||
| run: go get . | ||
| working-directory: ./src | ||
| - name: Test with Go | ||
| run: go test -json > TestResults-${{ matrix.go-version }}.json | ||
| working-directory: ./src | ||
| - name: Upload Go test results | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: Go-results-${{ matrix.go-version }} | ||
| path: src/TestResults-${{ matrix.go-version }}.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Third Party Libraries / Assets | ||
|
|
||
| This project wouldn't be possible without the following third party libraries and assets: | ||
|
|
||
| - e621 OpenAPI Specification from [https://github.com/DonovanDMC/E621OpenAPI](https://github.com/DonovanDMC/E621OpenAPI) (License: MIT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
|
|
||
| ## Development | ||
| `e6-cache` works by forwarding the users request, which means that it should never require any client changes, and should work on anything that abides by the offical api. | ||
|
|
||
| ## Request Forwarding Process | ||
| The core concept of the implementation looks like this: | ||
|
|
||
| 1. Receive an api request | ||
| 2. Forward the request to the target e6-based service (While checking for the Proxy Auth for example) | ||
| 3. Capture the response | ||
| 4. Modify the response and save it in the DB (URIs dont change in the DB) | ||
| 5. Return the modified response to the client | ||
|
|
||
| ## File Proxying Process | ||
| File Proxying works like this: | ||
|
|
||
| 1. Check the Signature and decode the base64 encoded url | ||
| 2. Check in S3 if the file exists | ||
| 3. If not, then request it and save it while forwarding it to the client. If it exist than stream it to the client from S3. | ||
|
|
||
| ## OpenAPI Updates | ||
| The `update_openapi.sh` script: | ||
| - Updates the openai.yaml file from another repo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.