Giter Club home page Giter Club logo

storead-api's Introduction

๐Ÿ‘‹ ์•ˆ๋…•ํ•˜์„ธ์š”




Typing SVG


storead-api's People

Contributors

leejuhwan avatar

Stargazers

 avatar

Watchers

 avatar

storead-api's Issues

๐ŸŽซ [Feat] - <Table of contents crawling>

Which area of this project could be most improved?

๐Ÿ”— Features

Details about changes

์ฑ… ๋ชฉ์ฐจ ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘ ํฌ๋กค๋Ÿฌ ๊ฐœ๋ฐœ

  1. ์‹œ๊ทธ๋„๋กœ ์ •ํ˜•ํ™” ๋˜์ง€ ์•Š์€ ํ…์ŠคํŠธ ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘ ํŒŒ์ดํ”„๋ผ์ธ ํ˜ธ์ถœ
  2. ์…€๋Ÿฌ๋ฆฌ๋กœ ๋น„๋™๊ธฐ ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘ ํŒŒ์ดํ”„๋ผ์ธ ํ˜ธ์ถœ

์ฑ… ๊ฒ€์ƒ‰ API์—์„œ ๋ฐ˜ํ™˜ ๋˜์ง€ ์•Š๋Š” ๋ชฉ์ฐจ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์„ ํƒ ํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘ ํŒŒ์ดํ”„๋ผ์ธ ์ž‘์„ฑ

  • Chapter Section๊ณผ ๊ฐ™์€ ๋ณ„๋„ ๋ชจ๋ธ๋ง ํ•„์š”

Required

  • Assigee ์„ค์ •
  • Issue label ์„ค์ •
  • ๊ฐœ์„ ์‚ฌํ•ญ ๋‚ด์šฉ ์ž‘์„ฑ

[feature] - <Book list pagination>

Feature

https://github.com/LeeJuHwan/booklog-api/blob/8b257f6b3297e3b571201f00c4d75826effc81e2/booklog/core_apps/books/views.py#L12

๋ชจ๋“  ์‚ฌ์šฉ์ž๊ฐ€ ์ž‘์„ฑํ•œ ์ฑ… ๋ชฉ๋ก์„ ๋ถˆ๋Ÿฌ์˜ฌ ๋•Œ ํŽ˜์ด์ง€๋„ค์ด์…˜์ด ์—†๋‹ค๋ฉด ๋ฐ์ดํ„ฐ ์–‘์ด ์ปค์กŒ์„ ๋•Œ ๋ฒ„ํผ๊ฐ€ ์ƒ๊ธฐ๋Š” ๊ฒƒ์„ ๋ฐฉ์ง€

[fix] - <Customizing jwt authentication rule>

Fix

์ด์Šˆ ๋‚ด์šฉ

REST_FRAMEWORK = {
"DEFAULT_PERMISSION_CLASSES": [
'rest_framework_simplejwt.authentication.JWTAuthentication',

์œ„์™€ ๊ฐ™์€ ์‹ค์ˆ˜๋กœ ์ธํ•ด ์ •์ƒ์ ์ธ ํ† ํฐ ์ ‘๊ทผ์ด ์•ˆ๋˜์–ด ์ˆ˜์ • ํ•ด๋ณด๋‹ˆ ์†Œ์…œ ์œ ์ € ๋ชจ๋ธ์— ์ ‘๊ทผ ํ•˜์ง€ ์•Š์Œ

๋ณ€๊ฒฝ์ด ํ•„์š”ํ•œ ๋ผ์ธ

SIMPLE_JWT = {
"ACCESS_TOKEN_LIFETIME": timedelta(minutes=30),
"REFRESH_TOKEN_LIFETIME": timedelta(days=1),
"SIGNING_KEY": SECRET_KEY,
"USER_ID_FIELD": "pkid",
"USER_ID_CLAIM": "pkid",
}

๊ด€๋ จ ์„ค๋ช…

simplejwt๋Š” ๊ธฐ๋ณธ authentication rule์„ ์ ์šฉ ํ•˜๊ณ  ์žˆ์œผ๋ฉฐ, ์ด ๋‚ด๋ถ€์ ์ธ ์ฝ”๋“œ์—๋Š” ์„ค์ • ํŒŒ์ผ์—์„œ ์ง€์ •ํ•œ ๊ธฐ์ดˆ ์œ ์ € ๋ชจ๋ธ ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.

AUTH_USER_MODEL = "social_users.Admin"

์ด ๋ชจ๋ธ ๋ณ€์ˆ˜๊ฐ€ ๊ฐ–๊ณ  ์žˆ๋Š” ์–ดํŠธ๋ฆฌ๋ทฐํŠธ(model fields)๋กœ simple_jwt๋ฅผ ๊ตฌ์„ฑ ํ•ด์•ผ ํ•˜๋Š”๋ฐ, ๊ด€๋ฆฌ์ž ๊ณ„์ • ๋ชจ๋ธ๊ณผ ์†Œ์…œ ์œ ์ € ๋ชจ๋ธ์ด ๋ถ„๋ฆฌ ๋˜์–ด ์‚ฌ์šฉ๋˜๋Š” ํ˜„์žฌ ์ƒํ™ฉ์— ๋ถ€์ ํ•ฉํ•˜๋‹ค.

  • ์—ฌ๊ธฐ์„œ ๋ถ€์ ํ•ฉ ํ•˜๋‹ค๋Š” ๊ฒƒ์€ Social User๋Š” pkid๋ฅผ ์‚ฌ์šฉํ•˜์ง€๋งŒ ๊ธฐ๋ณธ ์œ ์ € ๋ชจ๋ธ๋กœ ์ง€์ •๋œ Admin ๋ชจ๋ธ์€ id๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์— pkid๋ฅผ ํ™œ์šฉํ•  ์ˆ˜ ์—†๋Š” ์ƒํ™ฉ์ด๋‹ค.

์‹œ๋„ ํ•ด๋ณผ๋งŒํ•œ ๊ฐœ์„  ๋ฐฉ์•ˆ

base.py

SIMPLE_JWT = {
    "ACCESS_TOKEN_LIFETIME": timedelta(minutes=30),
    "REFRESH_TOKEN_LIFETIME": timedelta(days=1),
    "SIGNING_KEY": SECRET_KEY,
    "USER_ID_FIELD": "pkid",  # TODO: uuid๋กœ ๋ณ€๊ฒฝ
    "USER_ID_CLAIM": "pkid",  # TODO: uuid๋กœ ๋ณ€๊ฒฝ
    "USER_AUTHENTICATION_RULE": "utils.social_users.authentication.SocialAuthenticationRule",
}

authentication.py

from rest_framework_simplejwt.authentication import AuthenticationRule

class SocialAuthenticationRule(AuthenticationRule):
    def authenticate(self, header, payload):
        user_id = payload.get("uuid")
        if user_id is not None:
            try:
                # ์†Œ์…œ ์œ ์ € ์ธ์ฆ
                user = SocialUser.objects.get(pkid=user_id)  # TODO: uuid๋กœ ๋ณ€๊ฒฝ
            except SocialUser.DoesNotExist:
                    user = None
        else:
            user = None
        return user

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.