-
Notifications
You must be signed in to change notification settings - Fork 87
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
CAIP-222/ReCaps #1272
CAIP-222/ReCaps #1272
Conversation
…inV2 into sign_2.5_recaps
…inV2 into sign_2.5_recaps
…inV2 into sign_2.5_recaps
…inV2 into sign_2.5_recaps
…inV2 into sign_2.5_recaps
Qodana Community for Android42 new problems were found
View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/[email protected]
with:
upload-result: true Contact Qodana teamContact us at [email protected]
|
if (resources?.find { r -> r.startsWith(RECAPS_PREFIX) } != null) message += "\nI further authorize the stated URI to perform the following actions on my behalf: (1) $actionsString for '${ | ||
Issuer(iss).namespace | ||
}'\n" |
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.
I think the part where you only specify (1)
resource might be wrong. It only works if there is one resource.
Could there be multiple namespaces defined for one cacao? If yes then this will generate invalid statement
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.
We support for now only a single namespace that's why (1) is hardcoded
// multi-namespace should error
const { uri, response } = await dapp.sessionAuthenticate({
chains: ["eip155:1", "cosmos:1"],
domain: "localhost",
nonce: "1",
aud: "aud",
methods: ["personal_sign", "eth_signTypedData_v4"],
});
// this is fine
const { uri, response } = await dapp.sessionAuthenticate({
chains: ["eip155:1", "eip155:137"],
domain: "localhost",
nonce: "1",
aud: "aud",
methods: ["personal_sign", "eth_signTypedData_v4"],
});
// this is fine
const { uri, response } = await dapp.sessionAuthenticate({
chains: ["cosmos:1", "cosmos:2"],
domain: "localhost",
nonce: "1",
aud: "aud",
methods: ["personal_sign", "eth_signTypedData_v4"],
});
if (statement != null) message += "$statement\n" | ||
if (resources?.find { r -> r.startsWith(RECAPS_PREFIX) } != null) message += "\nI further authorize the stated URI to perform the following actions on my behalf: (1) $actionsString for '${ | ||
Issuer(iss).namespace | ||
}'\n" |
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.
As per specs statement part of the SIWE MUST NOT contain \n
source. Current code results too many new lines.
Cacao.Payload statement is not the same as SIWE statement
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.
Currenlty it generates:
service.invalid wants you to sign in with your Ethereum account:
0x15bca56b6e2728aec2532df9d436bd1600e86688
I accept the ServiceOrg Terms of Service: https://service.invalid/tos
I further authorize the stated URI to perform the following actions on my behalf: (1) 'request': 'eth_signTypedData_v4', 'personal_sign' for 'eip155'
URI: https://service.invalid/login
Version: 1
Chain ID: 1
Nonce: 32891756
Wheras it should be:
service.invalid wants you to sign in with your Ethereum account:
0x15bca56b6e2728aec2532df9d436bd1600e86688
I accept the ServiceOrg Terms of Service: https://service.invalid/tos I further authorize the stated URI to perform the following actions on my behalf: (1) 'request': 'eth_signTypedData_v4', 'personal_sign' for 'eip155'
URI: https://service.invalid/login
Version: 1
Chain ID: 1
Nonce: 32891756
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.
Good catch, ty
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.
There is a lot new todos, make sure you really want to leave them all
product/web3wallet/src/main/kotlin/com/walletconnect/web3/wallet/client/Wallet.kt
Outdated
Show resolved
Hide resolved
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.
Verify that all public methods are backwards compatible. Instead of changing the function names, create new functions and deprecate old.
@Json(name = "caip222Response") | ||
val caip222Response: List<Cacao>, |
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.
Should we still keep this for backwards compatibility?
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.
No, it's a new method that has changed during development
val actions: MutableMap<String, MutableList<String>> = mutableMapOf() | ||
|
||
for (i in 0 until requests.length()) { | ||
val actionString = requests.getJSONObject(i).keys().next() as String |
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.
regarding the Qodana warning, can we just do next().toString()
instead?
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.
Yup
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.
please address lint warnings on this file
val payloadParams: PayloadAuthRequestParams, | ||
) : Model() | ||
|
||
data class Participant( |
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.
can this be a child class of SessionAuthenticated
?
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.
Yup
) | ||
|
||
data class Participant( |
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.
same question, can this be moved to SessionAuthenticate
?
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.
instead of just renaming the functions, we should deprecate the old functions and then create the new ones. Otherwise current implementers will see crashes in their apps
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.
These are not on production
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.
make internal
Also, try to address as many of the linter wanrings |
…nV2 into sign_2.5_recaps # Conflicts: # core/android/src/main/kotlin/com/walletconnect/android/internal/utils/Expiration.kt # product/walletconnectmodal/src/main/kotlin/com/walletconnect/wcmodal/client/ClientMapper.kt # product/walletconnectmodal/src/main/kotlin/com/walletconnect/wcmodal/client/Modal.kt # product/walletconnectmodal/src/main/kotlin/com/walletconnect/wcmodal/client/WalletConnectModal.kt # product/walletconnectmodal/src/main/kotlin/com/walletconnect/wcmodal/domain/WalletConnectModalDelegate.kt # product/web3modal/src/main/kotlin/com/walletconnect/web3/modal/client/ClientMapper.kt # product/web3modal/src/main/kotlin/com/walletconnect/web3/modal/client/Web3Modal.kt # product/web3modal/src/main/kotlin/com/walletconnect/web3/modal/domain/delegate/Web3ModalDelegate.kt # protocol/sign/src/androidTest/kotlin/com/walletconnect/sign/test/utils/dapp/DappDelegate.kt # protocol/sign/src/androidTest/kotlin/com/walletconnect/sign/test/utils/hybrid/HybridDelegate.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/client/SignInterface.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/client/SignProtocol.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/common/exceptions/SignExceptions.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/common/model/vo/clientsync/session/params/SignParams.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/di/CallsModule.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/di/EngineModule.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/engine/domain/SignEngine.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/engine/model/mapper/EngineMapper.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/engine/use_case/calls/ApproveSessionUseCase.kt # protocol/sign/src/main/sqldelight/databases/8.db # sample/dapp/src/main/kotlin/com/walletconnect/sample/dapp/domain/DappDelegate.kt # sample/modal/src/main/kotlin/com/walletconnect/sample/modal/ModalSampleDelegate.kt
Qodana Community for Android56 new problems were found
View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/[email protected]
with:
upload-result: true Contact Qodana teamContact us at [email protected]
|
…nV2 into sign_2.5_recaps # Conflicts: # product/web3modal/src/main/kotlin/com/walletconnect/web3/modal/client/Modal.kt # product/web3modal/src/main/kotlin/com/walletconnect/web3/modal/client/Web3Modal.kt
…inV2 into sign_2.5_recaps # Conflicts: # product/walletconnectmodal/src/main/kotlin/com/walletconnect/wcmodal/client/ClientMapper.kt # product/walletconnectmodal/src/main/kotlin/com/walletconnect/wcmodal/client/WalletConnectModal.kt # product/walletconnectmodal/src/main/kotlin/com/walletconnect/wcmodal/domain/WalletConnectModalDelegate.kt # product/web3modal/src/main/kotlin/com/walletconnect/web3/modal/client/ClientMapper.kt # product/web3modal/src/main/kotlin/com/walletconnect/web3/modal/domain/delegate/Web3ModalDelegate.kt # product/web3modal/src/main/kotlin/com/walletconnect/web3/modal/engine/Web3ModalEngine.kt # protocol/sign/src/androidTest/kotlin/com/walletconnect/sign/test/utils/hybrid/HybridDelegate.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/client/SignInterface.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/client/SignProtocol.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/common/exceptions/SignExceptions.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/common/model/vo/clientsync/session/params/SignParams.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/engine/model/mapper/EngineMapper.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/engine/use_case/calls/ApproveSessionAuthenticateUseCase.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/engine/use_case/calls/SessionAuthenticateUseCase.kt # protocol/sign/src/main/kotlin/com/walletconnect/sign/engine/use_case/responses/OnSessionAuthenticateResponseUseCase.kt # sample/dapp/src/main/kotlin/com/walletconnect/sample/dapp/domain/DappDelegate.kt
Yeah I do, we're merging to a feature branch so before merging this feature branch to develop, all the TODOs will be resolved |
ReCaps: https://eips.ethereum.org/EIPS/eip-5573
Specs: https://github.com/WalletConnect/walletconnect-specs/pull/171/files#diff-0f26e2a5f5b0afc129a0d37185d8c037ecb5d4583e15ead76ac6d6332b570aa7