Closed yzhang666 closed 2 years ago
Hello @yzhang666
Recently, I found that the data in the two APIs are unable to align. Here is the example [...]
There is no API issue or abnormity...
Instead, you should better read the code - check VerifierRepositoryImpl.kt in the SDK repository - and understand what functions/calls are doing.
if (response.isSuccessful && response.code() == HttpURLConnection.HTTP_OK) {
val headers = response.headers()
val responseKid = headers[HEADER_KID]
val newResumeToken = headers[HEADER_RESUME_TOKEN]
val responseStr =
response.body()?.stringSuspending(dispatcherProvider) ?: return@execute false
if (validCertList.contains(responseKid)) {
Log.i(VerifierRepositoryImpl::class.java.simpleName, "Cert KID verified")
val key = Key(kid = responseKid!!, key = keyStoreCryptor.encrypt(responseStr)!!)
db.keyDao().insert(key)
preferences.resumeToken = resumeToken
newResumeToken?.let {
val newToken = it.toLong()
fetchCertificate(newToken)
FetchCertificate (without the final s) checks & retrieves indeed the KID updates, so it's returning right the next values, also the right KID country batches.
Hello @yzhang666
Recently, I found that the data in the two APIs are unable to align. Here is the example [...]
There is no API issue or abnormity...
Instead, you should better read the code - check VerifierRepositoryImpl.kt in the SDK repository - and understand what functions/calls are doing.
if (response.isSuccessful && response.code() == HttpURLConnection.HTTP_OK) { val headers = response.headers() val responseKid = headers[HEADER_KID] val newResumeToken = headers[HEADER_RESUME_TOKEN] val responseStr = response.body()?.stringSuspending(dispatcherProvider) ?: return@execute false if (validCertList.contains(responseKid)) { Log.i(VerifierRepositoryImpl::class.java.simpleName, "Cert KID verified") val key = Key(kid = responseKid!!, key = keyStoreCryptor.encrypt(responseStr)!!) db.keyDao().insert(key) preferences.resumeToken = resumeToken newResumeToken?.let { val newToken = it.toLong() fetchCertificate(newToken)
FetchCertificate (without the final s) checks & retrieves indeed the KID updates, so it's returning right the next values, also the right KID country batches.
Hi, many thanks for your help.
Hello @yzhang666
Recently, I found that the data in the two APIs are unable to align. Here is the example [...]
There is no API issue or abnormity...
Instead, you should better read the code - check VerifierRepositoryImpl.kt in the SDK repository - and understand what functions/calls are doing.
if (response.isSuccessful && response.code() == HttpURLConnection.HTTP_OK) { val headers = response.headers() val responseKid = headers[HEADER_KID] val newResumeToken = headers[HEADER_RESUME_TOKEN] val responseStr = response.body()?.stringSuspending(dispatcherProvider) ?: return@execute false if (validCertList.contains(responseKid)) { Log.i(VerifierRepositoryImpl::class.java.simpleName, "Cert KID verified") val key = Key(kid = responseKid!!, key = keyStoreCryptor.encrypt(responseStr)!!) db.keyDao().insert(key) preferences.resumeToken = resumeToken newResumeToken?.let { val newToken = it.toLong() fetchCertificate(newToken)
FetchCertificate (without the final s) checks & retrieves indeed the KID updates, so it's returning right the next values, also the right KID country batches.
And may I ask, how to solve the duplicate results issue? Because if I just fetch the response headers, I still get a lot of duplicate results.
Hello @yzhang666
many thanks for your help.
You're welcome.
And may I ask, how to solve the duplicate results issue? Because if I just fetch the response headers, I still get a lot of duplicate results.
Just read&use the officially provided code for SDK = VerifierRepositoryImpl.kt includes the related checks/actions too in order to right arrange KID DB with the signer updates.
I am currently working with the Italian APIs v1/dgc/signercertificate/update and v1/dgc/signercertificate/status. Recently, I found that the data in the two APIs are unable to align. Here is the example:
For the kid "zrMytIH40Rk=", the order of kid in the API v1/dgc/signercertificate/status is 233![image](https://user-images.githubusercontent.com/94878995/142959609-fc715a35-9558-4ebe-a5aa-61f8731caf20.png)
However, when you call the API v1/dgc/signercertificate/update by using the order 233,234 or 232 as the x-resume-token, none of the returned response header data is correct: Test1:![image](https://user-images.githubusercontent.com/94878995/142959933-17c73b44-56f8-4789-963d-10392347d8a2.png)
Test2:![image](https://user-images.githubusercontent.com/94878995/142959984-9e521394-6f84-467f-a2ac-f63adce8b06d.png)
It seems that the Italian APIs put the necessary verify information in two separate URLs, but now the two URLs cannot be aligned.
P.S. I found another interesting point, if you set the x-resume-token between 85-165, you will get the same returned data with token ID 166: Test1:![image](https://user-images.githubusercontent.com/94878995/142960092-aeab3ac0-14cf-4609-b125-05896a114097.png)
Test 2:![image](https://user-images.githubusercontent.com/94878995/142960166-bdb6f73f-4945-4d86-891c-80e65b278ba1.png)
I want to ask, who should I report to about the API issue?