mirror of
https://github.com/j93es/oauth-backend.git
synced 2026-06-04 05:41:52 +09:00
README.md 파일 업데이트: 기여 방법 및 예제 코드 추가
This commit is contained in:
parent
bcef4133d2
commit
f28fbc42dd
1 changed files with 42 additions and 1 deletions
41
README.md
41
README.md
|
|
@ -17,3 +17,44 @@ uv run main.py
|
|||
```
|
||||
|
||||
이러면 http(s)://localhost:11080로 서버가 열리게 됩니다.
|
||||
|
||||
# 기여 방법
|
||||
|
||||
`./addon/init.py`
|
||||
```py
|
||||
from example_check import Example
|
||||
|
||||
class LoggerAddon:
|
||||
def __init__(self):
|
||||
self.checker = Example()
|
||||
|
||||
def request(self, flow: http.HTTPFlow): # 비동기가 필요할 경우 async def로 할 것
|
||||
self.checker.test(flow)
|
||||
def response(self, flow: http.HTTPFlow): # 비동기가 필요할 경우 async def로 할 것
|
||||
self.checker.test(flow)
|
||||
|
||||
```
|
||||
|
||||
`./addon/example.py`
|
||||
```py
|
||||
import lib.target as target
|
||||
from lib.report import save_report
|
||||
|
||||
class Example:
|
||||
async def test(self, flow):
|
||||
req = flow.request
|
||||
method = req.method
|
||||
url = req.pretty_url
|
||||
|
||||
# data/report.csv에 저장
|
||||
report_data = [{
|
||||
'target': target.load(),
|
||||
'status': "CRITICAL",
|
||||
'title': "PKCE Downgrade Vulnerability",
|
||||
'description': "PKCE downgrade vulnerability detected! Both URLs returned authorization code.",
|
||||
'uri': f"Original: {url}\nDowngraded: {downgraded_url}"
|
||||
}]
|
||||
save_report(report_data)
|
||||
```
|
||||
|
||||
이러한 예제를 참고하여 작성하여주세요.
|
||||
Loading…
Add table
Add a link
Reference in a new issue