Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelavoyan committed Feb 6, 2024
1 parent d135c12 commit 5316bfe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ internal class VCLJwtSignServiceRemoteImpl(
val payload = jwtDescriptor.payload?.copy() ?: JSONObject()

// HeaderValues.XVnfProtocolVersion == VCLXVnfProtocolVersion.XVnfProtocolVersion1
header.putOpt(KeyJwk, didJwk.publicJwk)
header.putOpt(KeyJwk, didJwk.publicJwk.valueJson)
// HeaderValues.XVnfProtocolVersion == VCLXVnfProtocolVersion.XVnfProtocolVersion2
header.putOpt(KeyKid, didJwk.kid)

options.putOpt(KeyKeyId, didJwk.keyId)

payload.putOpt(KeyNonce, nonce)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import io.velocitycareerlabs.impl.jwt.remote.VCLJwtSignServiceRemoteImpl
import io.velocitycareerlabs.impl.keys.VCLKeyServiceLocalImpl
import io.velocitycareerlabs.infrastructure.db.SecretStoreServiceMock
import io.velocitycareerlabs.infrastructure.network.NetworkServiceSuccess
import junit.framework.TestCase.assertEquals
import org.json.JSONObject
import org.junit.Before
import org.junit.Test
Expand Down Expand Up @@ -63,6 +64,7 @@ internal class VCLJwtSignServiceTest {
val payload = payloadToSign.optJSONObject("payload")

assert(header?.optString("kid") == didJwk.kid)
assertEquals(header?.optJSONObject("jwk"), didJwk.publicJwk.valueJson)

assert(options?.optString("keyId") == didJwk.keyId)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ package io.velocitycareerlabs.usecases
import android.os.Build
import io.velocitycareerlabs.api.entities.*
import io.velocitycareerlabs.api.entities.error.VCLErrorCode
import io.velocitycareerlabs.impl.data.infrastructure.executors.ExecutorImpl
import io.velocitycareerlabs.impl.keys.VCLKeyServiceLocalImpl
import io.velocitycareerlabs.impl.data.repositories.CredentialManifestRepositoryImpl
import io.velocitycareerlabs.impl.data.repositories.JwtServiceRepositoryImpl
Expand Down

0 comments on commit 5316bfe

Please sign in to comment.