File tree Expand file tree Collapse file tree 2 files changed +69
-12
lines changed
Expand file tree Collapse file tree 2 files changed +69
-12
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,46 @@ paths:
125125 $ref : ' #/components/responses/BadRequest'
126126 " 401 " :
127127 $ref : ' #/components/responses/Unauthorized'
128-
128+ /auth/refresh :
129+ post :
130+ tags :
131+ - Authentication
132+ summary : Refreshes the access token
133+ description : " "
134+ operationId : refreshToken
135+ security :
136+ - refreshToken : []
137+ responses :
138+ " 409 " :
139+ description : Unauthorized error, token revoked.
140+ content :
141+ application/json :
142+ schema :
143+ type : object
144+ properties :
145+ msg :
146+ type : string
147+ example : Token has been revoked
148+ default : Token has been revoked
149+ " 200 " :
150+ description : Token successfully refreshed
151+ content :
152+ application/json :
153+ schema :
154+ type : object
155+ properties :
156+ success :
157+ type : boolean
158+ description : If the request is a success
159+ example : true
160+ code :
161+ type : integer
162+ description : The status code
163+ example : 200
164+ access_token :
165+ type : string
166+ description : The new and fresh access token
167+ example : eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MDAzMjYzMjksIm5iZiI6MTYwMDMyNjMyOSwianRpIjoiZTA0ZWQ3NmMtMTcxMC00ZjQ4LWFkNzMtZDBmOTMxZTkxNzM0IiwiZXhwIjoxNjAwMzI3MjI5LCJpZGVudGl0eSI6eyJpZCI6MSwiZW1haWwiOiJmb29AZXhhbXBsZS5vcmciLCJ1c2VybmFtZSI6ImZvbyIsImlzX29ubGluZSI6MCwiZGF0ZV9sYXN0c2VlbiI6IldlZCwgMTYgU2VwIDIwMjAgMTU6Mzk6MDQgR01UIn0sImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyJ9.dFJMy-04thKA9Q268bgQhiqLDrkqnCOCaiwHJ1XXook
129168
130169servers :
131170 - url : https://api.matcha.com
@@ -228,6 +267,11 @@ components:
228267 type : http
229268 scheme : bearer
230269 bearerFormat : JWT
270+ refreshToken :
271+ type : http
272+ scheme : bearer
273+ bearerFormat : JWT
274+ description : Refresh token
231275 schemas :
232276 CreateUser :
233277 type : object
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ version: '3.3'
22
33services :
44 mysql :
5+ container_name : mysql
56 image : mysql
67 restart : always
78 environment :
@@ -10,10 +11,10 @@ services:
1011 MYSQL_ALLOW_EMPTY_PASSWORD : 1
1112 env_file :
1213 - .env
13- ports :
14- - ' 3306:3306'
15- expose :
16- - ' 3306'
14+ # ports:
15+ # - '3306:3306'
16+ # expose:
17+ # - '3306'
1718 volumes :
1819 - mysql:/var/lib/mysql
1920 networks :
@@ -25,6 +26,7 @@ services:
2526 retries : 5
2627
2728 redis :
29+ container_name : redi
2830 image : redis:4.0.5-alpine
2931 command : ["redis-server", "--appendonly", "yes"]
3032 hostname : redis
@@ -35,7 +37,8 @@ services:
3537 volumes :
3638 - redis-data:/data
3739
38- worker :
40+ workers :
41+ container_name : workers
3942 build :
4043 context : .
4144 dockerfile : ./Dockerfile
@@ -49,7 +52,7 @@ services:
4952 - .env
5053 entrypoint : celery worker --workdir . -A PyMatcha.celery -B --loglevel=info
5154 volumes :
52- - app:/app
55+ - backend:/backend
5356 depends_on :
5457 - redis
5558 - mysql
@@ -60,7 +63,8 @@ services:
6063 - mysql-net
6164 restart : always
6265
63- app :
66+ backend :
67+ container_name : backend
6468 restart : always
6569 build :
6670 context : .
@@ -75,15 +79,15 @@ services:
7579 ports :
7680 - " 8080:5000"
7781 volumes :
78- - app:/app
82+ - backend:/backend
7983 depends_on :
8084 - mysql
8185 - redis
82- - worker
86+ - workers
8387 links :
8488 - mysql
8589 - redis
86- - worker
90+ - workers
8791 networks :
8892 - redis-net
8993 - mysql-net
@@ -103,11 +107,20 @@ services:
103107 networks :
104108 - mysql-net
105109
110+ swagger_ui :
111+ container_name : docs
112+ environment :
113+ - API_URL=/swagger.yaml
114+ image : " swaggerapi/swagger-ui"
115+ volumes : ["./backend/schemas/swagger.yaml:/usr/share/nginx/html/swagger.yaml"]
116+ restart : always
117+ ports : ["9000:8080"]
118+
106119networks :
107120 redis-net :
108121 mysql-net :
109122
110123volumes :
111124 redis-data :
112125 mysql :
113- app :
126+ backend :
You can’t perform that action at this time.
0 commit comments