Add subscribe API for COSCUP-Volunteer and API Token management page#7
Open
orertrr wants to merge 9 commits intoCOSCUP:mainfrom
Open
Add subscribe API for COSCUP-Volunteer and API Token management page#7orertrr wants to merge 9 commits intoCOSCUP:mainfrom
orertrr wants to merge 9 commits intoCOSCUP:mainfrom
Conversation
Signed-off-by: orertrr <orertrr6207@gmail.com>
Signed-off-by: orertrr <orertrr6207@gmail.com>
Signed-off-by: orertrr <orertrr6207@gmail.com>
Signed-off-by: orertrr <orertrr6207@gmail.com>
Signed-off-by: orertrr <orertrr6207@gmail.com>
Signed-off-by: orertrr <orertrr6207@gmail.com>
Signed-off-by: orertrr <orertrr6207@gmail.com>
Signed-off-by: orertrr <orertrr6207@gmail.com>
toomore
requested changes
Jul 25, 2024
Comment on lines
+68
to
+77
| if request.path.startswith('/volunteer'): | ||
| token = request.headers.get('Authorization') | ||
| if token is None: | ||
| return make_response('Unauthorized', 401) | ||
|
|
||
| if APIToken.verify(token) is True: | ||
| return None | ||
|
|
||
| return make_response('Unauthorized', 401) | ||
|
|
Member
There was a problem hiding this comment.
@orertrr 這段移到 view/volunteer.py 的每一個 endpoint 去判斷,這裡想要單純的扮演 route 的節點。然後在 Line 78 加入 and not request.path.startswith('/volunteer')
Member
Author
There was a problem hiding this comment.
這部分如果包成 function 然後掛一個 VIEW_VOLUNTEER.before_request 的 decorator 上去可以嗎?
理論上這樣寫可以有同樣的效果,且之後 /volunteer 底下有要再加 Endpoint 時也不用再寫同樣的邏輯
Member
There was a problem hiding this comment.
這個檔案上方 import 好像沒有排序,APITokenDB().index() 應該可以移上去 Line 7。
main.py
Outdated
Comment on lines
44
to
45
| app.register_blueprint(VIEW_VOLUNTEER) | ||
| app.register_blueprint(VIEW_TOKEN) |
Signed-off-by: orertrr <orertrr6207@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull request type
Related Issue
What is the new behavior?
Other Informations
新增訂閱者 API
API Token management page