-
Notifications
You must be signed in to change notification settings - Fork 185
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
Verify v2 #1392
Merged
+669
−168
Merged
Verify v2 #1392
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
6bd05a3
add VerifyServerPubKeyManager, remove verify .com fallback
llbartekll d3b80b3
savepoint
llbartekll 94dd258
fix build
llbartekll 601a01b
savepoint
llbartekll e98962b
savepoint
llbartekll dffbf64
update verify on auth request
llbartekll 66104b1
savepoint
llbartekll f23fc74
store verify context in session object
llbartekll 9814f95
fix tests
llbartekll 6e0167c
fix relay tests
llbartekll 85ffdde
print more descriptive error
llbartekll 7d8c2f4
remove ack check
llbartekll 572591d
update verify context creation
llbartekll d563f75
pubkey as jwk
llbartekll 1a5bba4
add AttestationJWTVerifierTests
llbartekll df44756
savepoint
llbartekll c54013a
savepoint
llbartekll 41afb9e
add isVerified property
llbartekll bd983cb
fix AttestationJWTVerifierTests
llbartekll a009088
savepoint
llbartekll a495480
fix redirect issue
llbartekll 8489f46
savepoint
llbartekll 83c7c63
savepoint
llbartekll 8d228bc
savepoint
llbartekll 4d8f292
fix unit tests
llbartekll ee030b5
fix auth package issue
llbartekll 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
Loading status checks…
savepoint
commit a00908828001f89587918697cd09eea272a728e1
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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
Unchanged files with check annotations Beta
This file contains 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
.filter { $0.0 == .connected && $0.1 == .connected } | ||
.setFailureType(to: NetworkError.self) | ||
.timeout(.seconds(defaultTimeout), scheduler: concurrentQueue, customError: { .connectionFailed }) | ||
.sink(receiveCompletion: { [unowned self] result in | ||
switch result { | ||
case .failure(let error): | ||
cancellable?.cancel() |
This file contains 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
var newEip155Actions: [String: [AnyCodable]] = [:] | ||
for method in supportedMethods { | ||
let actionKey = "request/\(method)" | ||
if let actions = eip155Actions[actionKey] { | ||
newEip155Actions[actionKey] = [AnyCodable(["chains": commonChains])] | ||
} | ||
} |
This file contains 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
func respondError(requestId: RPCID) async throws { | ||
do { | ||
try await walletErrorResponder.respondError(AuthError.userRejeted, requestId: requestId) | ||
} catch { | ||
throw error | ||
} |
This file contains 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
guard sessionRequestNotExpired(requestId: requestId) else { | ||
logger.debug("request expired") | ||
try await linkEnvelopesDispatcher.respondError( | ||
topic: topic, | ||
requestId: requestId, | ||
peerUniversalLink: peerUniversalLink, |
This file contains 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
Task(priority: .high) { | ||
do { | ||
try await envelopesDispatcher.respondError(topic: payload.topic, requestId: payload.id, peerUniversalLink: peerUniversalLink, reason: reason, envelopeType: .type0) | ||
} catch { | ||
logger.error("Respond Error failed with: \(error.localizedDescription)") | ||
} |
This file contains 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
self.object = object | ||
} | ||
public func request<T>(_ type: T.Type, at service: HTTPService) async throws -> T where T: Decodable { | ||
Check warning on line 11 in Tests/TestingUtils/Mocks/HTTPClientMock.swift GitHub Actions / prepare
|
||
return object as! T | ||
} | ||
This file contains 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
public var isActivateCalled: Bool = false | ||
public var isReceivedCalled: Bool = false | ||
public func register<RequestParams>(method: ProtocolMethod) -> AnyPublisher<RequestSubscriptionPayload<RequestParams>, Never> where RequestParams: Decodable, RequestParams: Encodable { | ||
Check warning on line 12 in Tests/TestingUtils/Mocks/PairingRegistererMock.swift GitHub Actions / prepare
|
||
subject.eraseToAnyPublisher() as! AnyPublisher<RequestSubscriptionPayload<RequestParams>, Never> | ||
} | ||
This file contains 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
let assertionId = payload.decryptedPayload.sha256().toHexString() | ||
do { | ||
let response = try await verifyClient.verify(.v1(assertionId: assertionId)) | ||
let verifyContext = verifyClient.createVerifyContext(origin: response.origin, domain: payload.request.payloadParams.domain, isScam: response.isScam) | ||
verifyContextStore.set(verifyContext, forKey: request.id.string) | ||
onRequest?((request, verifyContext)) | ||
} catch { |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see warning:
let assertionId = payload.decryptedPayload.sha256().toHexString()
👆