Implement basic unit/instance attestation#419
Conversation
d2b806c to
d774927
Compare
d774927 to
ee64144
Compare
5a582a0 to
f057199
Compare
shared/src/commonMain/kotlin/at/asitplus/wallet/app/common/WalletConfig.kt
Show resolved
Hide resolved
shared/src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/UnitAttestationHelper.kt
Outdated
Show resolved
Hide resolved
shared/src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/UnitAttestationHelper.kt
Show resolved
Hide resolved
|
Can we also add a configuration property and screen for the URL of the Wallet Provider Backendd? |
ab29586 to
86cbc46
Compare
shared/src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/Constants.kt
Outdated
Show resolved
Hide resolved
...src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/InstanceAttestationHelper.kt
Outdated
Show resolved
Hide resolved
shared/src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/UnitAttestationHelper.kt
Outdated
Show resolved
Hide resolved
shared/src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/UnitAttestationHelper.kt
Outdated
Show resolved
Hide resolved
...src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/InstanceAttestationHelper.kt
Outdated
Show resolved
Hide resolved
...src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/InstanceAttestationHelper.kt
Outdated
Show resolved
Hide resolved
shared/src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/UnitAttestationHelper.kt
Show resolved
Hide resolved
shared/src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/UnitAttestationHelper.kt
Outdated
Show resolved
Hide resolved
shared/src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/UnitAttestationHelper.kt
Outdated
Show resolved
Hide resolved
shared/src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/UnitAttestationHelper.kt
Outdated
Show resolved
Hide resolved
shared/src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/UnitAttestationHelper.kt
Outdated
Show resolved
Hide resolved
shared/src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/UnitAttestationHelper.kt
Show resolved
Hide resolved
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d15d43b8d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
cc69c21 to
a505ac0
Compare
shared/src/commonMain/kotlin/at/asitplus/wallet/app/common/ProvisioningService.kt
Outdated
Show resolved
Hide resolved
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Pipeline failing until https://github.com/a-sit-plus/valera/tree/fix/build-issues merged |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c65fdad93
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
shared/src/commonMain/kotlin/ui/views/AttestationSettingsView.kt
Outdated
Show resolved
Hide resolved
6c65fda to
48723c5
Compare
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
shared/src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/UnitAttestationHelper.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8cd05d66a5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
...src/commonMain/kotlin/at/asitplus/wallet/app/common/attestation/InstanceAttestationHelper.kt
Show resolved
Hide resolved
| LabeledText(text = "${it.payload.expiration}", label = stringResource(Res.string.text_label_attestation_expiration)) | ||
| LabeledText(text = "${it.payload.eudiWalletInfo?.keyStorageInfo?.storageType}", label = stringResource(Res.string.text_label_attestation_storage_type)) | ||
| } | ||
| if (bufferedUnitAttestation.value == null && bufferedInstanceAttestation.value == null) { |
There was a problem hiding this comment.
Allow retry when only one attestation preload succeeds
The load button is shown only when both buffers are null, but preloadAttestation() writes instance attestation before requesting unit attestation. If the unit call fails after instance succeeds, the screen ends up with instance != null and unit == null, which hides the button and leaves no in-screen way to retry fetching the missing unit attestation.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Changed to an "or" logic for now. But i think this whole processing of the attestations gets a major overhaul with a proper wallet provider in place.
| val instanceAttestation = requestInstanceAttestation() | ||
| val pop = instanceAttestationHelper.buildProofOfPossession() | ||
|
|
||
| return unitAttestationHelper.requestUnitAttestation(instanceAttestation, pop) |
There was a problem hiding this comment.
Cache newly requested unit attestations before returning
requestUnitAttestation() checks bufferedUnitAttestation for reuse, but when it fetches a fresh unit attestation it returns it directly without storing it. That means subsequent calls in the same process (for example repeated POP generation without an explicit preload) always re-hit the network instead of reusing the valid token, increasing latency and failure risk under provider throttling.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Proper key management is part of a subsequent PR
There was a problem hiding this comment.
I try to optimize it during the testing now
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Rebased the branch and i am going to retest the whole procedure |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b90b3b1593
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
|
|
||
| fun getWalletProviderHost() = config.walletProviderHost | ||
| fun setWalletProviderHost(host: String) = config.set(walletProviderHost = host) |
There was a problem hiding this comment.
Clear attestation cache when wallet-provider host changes
Updating the wallet-provider host currently only persists the new URL, but both attestation caches remain valid and are reused solely by expiration checks. If a user preloads attestations for host A, switches to host B in settings, and then runs attestation-dependent flows, requestInstanceAttestation/requestUnitAttestation can still return host-A tokens until they expire, which can cause mismatched-provider failures (and the settings screen may keep the reload button hidden because buffers are still non-null).
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Seems like a valid improvement
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Wallet provider configuration screen:


Related:
a-sit-plus/vck#487
a-sit-plus/signum#400