-
Notifications
You must be signed in to change notification settings - Fork 0
추천기능 API를 연동합니다. #331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
추천기능 API를 연동합니다. #331
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c03a8e6
feat/#330: tooltip 표기
dongglehada e1b0ccc
fix/#330: 레이아웃 충돌 문제 frame + snapkit 에서 snapkit 단일사용으로 변경
dongglehada 5f8f0ab
fix/#330: tagChip, CardList 레이아웃 충돌 해결
dongglehada 0a02142
feat/#330: api 연동 (추천, 내 정보, 직업)
dongglehada 5a1944e
Merge branch 'dev' of https://github.com/Team-Maple/MLS-iOS into feat…
dongglehada dd09800
feat/#330: 추천 탭 본앱 연동
dongglehada f8ffdfe
style/#330: Apply SwiftLint autocorrect
github-actions[bot] 40635df
fix/#330: 리뷰 반영
dongglehada 46ee4cb
fix/#330: 임시 코드 제거
dongglehada File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| excluded: | ||
| - "**/.build" | ||
| - "**/SourcePackages" | ||
|
|
||
| # 기본(default) 룰이 아닌 룰들을 활성화 | ||
| opt_in_rules: | ||
| - sorted_imports | ||
|
|
||
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
32 changes: 32 additions & 0 deletions
32
MLS/MLSCore/Sources/MLSCore/Network/TokenInterceptor.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import Foundation | ||
| import Security | ||
|
|
||
| public final class TokenInterceptor: Interceptor { | ||
|
|
||
| public init() {} | ||
|
|
||
| public func adapt(_ request: URLRequest) -> URLRequest { | ||
| guard let token = fetchAccessToken() else { return request } | ||
| var adapted = request | ||
| adapted.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization") | ||
| return adapted | ||
| } | ||
|
|
||
| public func retry(data: Data?, response: URLResponse?, error: Error?) -> Bool { | ||
| return false | ||
| } | ||
|
|
||
| private func fetchAccessToken() -> String? { | ||
| let query: NSDictionary = [ | ||
| kSecClass: kSecClassGenericPassword, | ||
| kSecAttrService: "keyChain", | ||
| kSecAttrAccount: "accessToken", | ||
| kSecReturnData: true, | ||
| kSecMatchLimit: kSecMatchLimitOne | ||
| ] | ||
| var ref: AnyObject? | ||
| guard SecItemCopyMatching(query, &ref) == errSecSuccess, | ||
| let data = ref as? Data else { return nil } | ||
| return String(data: data, encoding: .utf8) | ||
| } | ||
| } | ||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.