Skip to content

feat: cli 세팅 및 깃허브 로그인 테스트 - #7

Open
farmer0010 wants to merge 4 commits into
mainfrom
feat/github-oauth-login
Open

feat: cli 세팅 및 깃허브 로그인 테스트#7
farmer0010 wants to merge 4 commits into
mainfrom
feat/github-oauth-login

Conversation

@farmer0010

Copy link
Copy Markdown
Owner

No description provided.

Comment thread cli/mylog.py Outdated
print("이미 로그아웃된 상태거나 삭제할 토큰이 없습니다.")


def send_to_aws(content):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def send_to_aws(content):
def save(content):

가 어떨까.

aws 클로우드 서비스로 보낸다는 표현이 너무 과하게 특정된 느낌인거같음.
cli가 aws에 올라가있는 서버에 보낸다는것 까지 알아야하나

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵! 이 부분에 대해서 수정해두겠습니다~

@losnuyh

losnuyh commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

cli 프로그램도 헥사고날로 변경해봐.

Comment thread cli/dependencies.py
Comment on lines +11 to +15
self.token_storage = KeyringTokenAdapter()
self.memo_repo = HttpMemoRepositoryAdapter(api_base_url=settings.API_BASE_URL)
self.auth_repo = GitHubDeviceAuthAdapter(
client_id=settings.GITHUB_CLIENT_ID,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

container.memo_repo

라는 접근이 안되는게 좋을 듯
바로 service 객체에 넘겨줘도 될 거 같은데?

container에 저장하는 이유가 있음?

        self.memo_service: MemoUseCase = MemoService(
          memo_repo=HttpMemoRepositoryAdapter(api_base_url=settings.API_BASE_URL),
            token_storage= KeyringTokenAdapter(),
        )

이런식으로하면?

공부해볼 것: 맹글링

Comment thread cli/config.py
Comment on lines +11 to +13
self.GITHUB_CLIENT_ID = os.getenv("GITHUB_CLIENT_ID")

self.validate()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 변수 늘어날때마다 if + raise 문 계속 쓸거임?

개선해바

Comment thread cli/dependencies.py
Comment on lines +11 to +12
self.token_storage = KeyringTokenAdapter()
self.memo_repo = HttpMemoRepositoryAdapter(api_base_url=settings.API_BASE_URL)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repo, storage
어떤 기준으로 네이밍 한거야?


class KeyringTokenAdapter(TokenStoragePort):
def __init__(
self, service_name: str = "mylog-app", username: str = "user_secure_token"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self, service_name: str = "mylog-app", username: str = "user_secure_token"

상수로 박거나, 외부에서 주입만 받거나.

하는게 더 좋지 않을까?

상수로 박으면, 의미적으로

이 어떠한 경우에도 이 값이구나

인데

저렇게하면

일단 객체 생성하려면 service_name, username이 필요한데 없으면, 제공해주는 구나

라는 의미같음

response.raise_for_status()
return response.json()

def poll_for_token(self, device_code: str, interval: int = 5) -> dict:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def poll_for_token(self, device_code: str, interval: int = 5) -> dict:
def poll_for_token(self, device_code: str, interval: int) -> dict:

default value 왜케 좋아해 ..

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5에서 3으로 바꿔야하면 저 디폴트 값을 바꿔야할지?
실제로 저 메소드를 호출하는 곳에서 5를 넘겨주고 있는지?

착각하기 딱 좋음.

디폴트 밸류는 언제써야할까? 다 쓰면 좋은걸까?
고민해봐.

언제쓰는것이 적절한 케이스 인건지?

}

while True:
time.sleep(interval)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

근데 처음에 바로 5초 쉬어야함?

table_name = os.getenv("DYNAMODB_TABLE")
if not table_name:
raise ValueError("DYNAMODB_TABLE 환경변수가 설정되지 않았습니다")
TOKEN_CACHE = cast(TTLCache[str, str, float], TTLCache(maxsize=100, ttl=300))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TOKEN_CACHE = cast(TTLCache[str, str, float], TTLCache(maxsize=100, ttl=300))
GITHUB_USER_ID_CACHE = cast(TTLCache[str, str, float], TTLCache(maxsize=100, ttl=300))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants