Skip to content

Commit 7a06708

Browse files
committed
Remove deprecated code elements
1 parent eabc034 commit 7a06708

27 files changed

Lines changed: 20 additions & 606 deletions

File tree

openid-data-classes/src/commonMain/kotlin/at/asitplus/wallet/lib/data/SelectiveDisclosureItem.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import io.matthewnelson.encoding.base64.Base64
77
import io.matthewnelson.encoding.core.Encoder.Companion.encodeToString
88
import kotlinx.serialization.Serializable
99
import kotlinx.serialization.json.JsonElement
10-
import kotlinx.serialization.json.JsonPrimitive
1110

1211
/**
1312
* Selective Disclosure item in SD-JWT format
@@ -19,14 +18,6 @@ data class SelectiveDisclosureItem(
1918
val claimValue: JsonElement,
2019
) {
2120

22-
@Deprecated(
23-
"Replaced with fromAnyValue",
24-
ReplaceWith("SelectiveDisclosureItem.fromAnyValue(salt, claimName, claimValue)"),
25-
DeprecationLevel.ERROR
26-
)
27-
constructor(salt: ByteArray, claimName: String?, claimValue: Any)
28-
: this(salt, claimName, JsonPrimitive(claimValue.toString()))
29-
3021
/**
3122
* Creates a disclosure, as described in section 5.2 of
3223
* [draft-ietf-oauth-selective-disclosure-jwt-08](https://datatracker.ietf.org/doc/draft-ietf-oauth-selective-disclosure-jwt/)

rqes-data-classes/src/commonMain/kotlin/at/asitplus/rqes/CscAuthorizationDetailsDep.kt

Lines changed: 0 additions & 3 deletions
This file was deleted.

vck-openid/src/commonMain/kotlin/at/asitplus/wallet/lib/oauth2/AuthorizationService.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@ interface AuthorizationService {
4545
clientAttestationPop: String? = null,
4646
): KmmResult<PushedAuthenticationResponseParameters>
4747

48-
@Deprecated("Use `authorize` with `loadUserFun` instead")
49-
suspend fun authorize(input: String):
50-
KmmResult<AuthenticationResponseResult.Redirect>
51-
52-
@Deprecated("Use `authorize` with `loadUserFun` instead")
53-
suspend fun authorize(input: AuthenticationRequestParameters):
54-
KmmResult<AuthenticationResponseResult.Redirect>
55-
5648
/**
5749
* Builds the authentication response for this specific user from [loadUserFun].
5850
* Send this result as HTTP Header `Location` in a 302 response to the client.

vck-openid/src/commonMain/kotlin/at/asitplus/wallet/lib/oauth2/SimpleAuthorizationService.kt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import at.asitplus.wallet.lib.oidvci.CredentialIssuer
2323
import at.asitplus.wallet.lib.oidvci.DefaultCodeService
2424
import at.asitplus.wallet.lib.oidvci.DefaultMapStore
2525
import at.asitplus.wallet.lib.oidvci.DefaultNonceService
26-
import at.asitplus.wallet.lib.oidvci.FallbackAdapter
2726
import at.asitplus.wallet.lib.oidvci.MapStore
2827
import at.asitplus.wallet.lib.oidvci.OAuth2AuthorizationServerAdapter
2928
import at.asitplus.wallet.lib.oidvci.OAuth2Exception
@@ -59,8 +58,6 @@ class SimpleAuthorizationService(
5958
/** Used to filter authorization details and scopes. */
6059
private val strategy: AuthorizationServiceStrategy,
6160
/** Used to load the actual user data during [authorize]. */
62-
@Suppress("DEPRECATION") @Deprecated("Use callback from `OAuth2LoadUserFun` in `authorize` instead")
63-
private val dataProvider: at.asitplus.wallet.lib.oidvci.OAuth2DataProvider? = null,
6461
/** Used to create and verify authorization codes during issuing. */
6562
private val codeService: CodeService = DefaultCodeService(),
6663
/** Used in several fields in [OAuth2AuthorizationServerMetadata], to provide endpoint URLs to clients. */
@@ -231,23 +228,6 @@ class SimpleAuthorizationService(
231228
)
232229
}
233230

234-
@Suppress("DEPRECATION")
235-
@Deprecated("Use `authorize` with `loadUserFun` instead")
236-
override suspend fun authorize(input: String) = catching {
237-
requestParser.parseRequestParameters(input).getOrThrow()
238-
.let { it.parameters as? AuthenticationRequestParameters }
239-
?.let { authorize(it).getOrThrow() }
240-
?: run {
241-
Napier.w("authorize: could not parse request parameters from $input")
242-
throw InvalidRequest("Could not parse request parameters from $input")
243-
}
244-
}
245-
246-
@Suppress("DEPRECATION")
247-
@Deprecated("Use `authorize` with `loadUserFun` instead")
248-
override suspend fun authorize(input: AuthenticationRequestParameters) =
249-
authorize(input, FallbackAdapter(dataProvider))
250-
251231
/**
252232
* Builds the authentication response.
253233
* Send this result as HTTP Header `Location` in a 302 response to the client.

vck-openid/src/commonMain/kotlin/at/asitplus/wallet/lib/oidvci/CredentialDataProviderFun.kt

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,3 @@ data class CredentialDataProviderInput(
3434
val credentialRepresentation: ConstantIndex.CredentialRepresentation,
3535
)
3636

37-
/** Adapter for deprecated code, to be removed > 5.8.0 */
38-
@Suppress("DEPRECATION")
39-
class CredentialIssuerDataProviderAdapter(
40-
val credentialDataProvider: CredentialIssuerDataProvider,
41-
) : CredentialDataProviderFun {
42-
override suspend fun invoke(
43-
input: CredentialDataProviderInput,
44-
): KmmResult<CredentialToBeIssued> =
45-
credentialDataProvider.getCredential(
46-
input.userInfo,
47-
input.subjectPublicKey,
48-
input.credentialScheme,
49-
input.credentialRepresentation,
50-
null
51-
)
52-
53-
}

vck-openid/src/commonMain/kotlin/at/asitplus/wallet/lib/oidvci/CredentialIssuer.kt

Lines changed: 0 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,12 @@ import at.asitplus.openid.JwtVcIssuerMetadata
1010
import at.asitplus.openid.OidcUserInfoExtended
1111
import at.asitplus.openid.OpenIdConstants
1212
import at.asitplus.openid.SupportedAlgorithmsContainer
13-
import at.asitplus.signum.indispensable.CryptoPublicKey
1413
import at.asitplus.signum.indispensable.SignatureAlgorithm
1514
import at.asitplus.signum.indispensable.josef.JsonWebKeySet
1615
import at.asitplus.signum.indispensable.josef.JweAlgorithm
1716
import at.asitplus.signum.indispensable.josef.JweEncryption
1817
import at.asitplus.signum.indispensable.josef.JweHeader
19-
import at.asitplus.signum.indispensable.josef.JwsAlgorithm
20-
import at.asitplus.signum.indispensable.josef.JwsSigned
21-
import at.asitplus.signum.indispensable.josef.KeyAttestationJwt
2218
import at.asitplus.signum.indispensable.josef.toJwsAlgorithm
23-
import at.asitplus.wallet.lib.agent.CredentialToBeIssued
2419
import at.asitplus.wallet.lib.agent.EphemeralKeyWithoutCert
2520
import at.asitplus.wallet.lib.agent.Issuer
2621
import at.asitplus.wallet.lib.agent.IssuerAgent
@@ -29,18 +24,12 @@ import at.asitplus.wallet.lib.data.ConstantIndex
2924
import at.asitplus.wallet.lib.data.ConstantIndex.CredentialScheme
3025
import at.asitplus.wallet.lib.jws.EncryptJwe
3126
import at.asitplus.wallet.lib.jws.EncryptJweFun
32-
import at.asitplus.wallet.lib.jws.VerifyJwsObject
33-
import at.asitplus.wallet.lib.jws.VerifyJwsObjectFun
3427
import at.asitplus.wallet.lib.oauth2.RequestInfo
3528
import at.asitplus.wallet.lib.oidvci.CredentialSchemeMapping.decodeFromCredentialIdentifier
3629
import at.asitplus.wallet.lib.oidvci.CredentialSchemeMapping.toSupportedCredentialFormat
3730
import at.asitplus.wallet.lib.oidvci.OAuth2Exception.*
3831
import io.github.aakira.napier.Napier
39-
import kotlin.time.Clock
40-
import kotlin.time.Clock.System
4132
import kotlin.coroutines.cancellation.CancellationException
42-
import kotlin.time.Duration
43-
import kotlin.time.Duration.Companion.minutes
4433

4534
/**
4635
* Server implementation to issue credentials using OID4VCI.
@@ -72,23 +61,8 @@ class CredentialIssuer(
7261
* to that URI (which starts with [publicContext]) to [nonce].
7362
*/
7463
private val nonceEndpointPath: String = "/nonce",
75-
@Suppress("DEPRECATION") @Deprecated("Use `credentialDataProvider` in method `credential` instead")
76-
private val credentialProvider: CredentialIssuerDataProvider = FallbackCredentialIssuerDataProvider(),
77-
/** Used to verify the signature of proof elements in credential requests. */
78-
@Deprecated("Use `proofValidator` instead")
79-
private val verifyJwsObject: VerifyJwsObjectFun = VerifyJwsObject(),
80-
@Deprecated("Use `proofValidator` instead")
81-
private val supportedAlgorithms: Collection<JwsAlgorithm.Signature> = listOf(JwsAlgorithm.Signature.ES256),
82-
@Deprecated("Use `proofValidator` instead")
83-
private val clock: Clock = System,
84-
@Deprecated("Use `proofValidator` instead")
85-
private val timeLeeway: Duration = 5.minutes,
86-
@Deprecated("Use `proofValidator` instead")
87-
private val verifyAttestationProof: (JwsSigned<KeyAttestationJwt>) -> Boolean = { true },
8864
/** Turn on to require key attestation support in the [metadata]. */
8965
private val requireKeyAttestation: Boolean = false,
90-
@Deprecated("Use `proofValidator` instead")
91-
private val clientNonceService: NonceService = DefaultNonceService(),
9266
/** Used to optionally encrypt the credential response, if requested by the client. */
9367
private val encryptCredentialRequest: EncryptJweFun = EncryptJwe(EphemeralKeyWithoutCert()),
9468
/** Whether to indicate in [metadata] if credential response encryption is required. */
@@ -100,13 +74,7 @@ class CredentialIssuer(
10074
/** Used to verify proof of posession of key material in credential requests. */
10175
private val proofValidator: ProofValidator = ProofValidator(
10276
publicContext = publicContext,
103-
verifyJwsObject = verifyJwsObject,
104-
supportedAlgorithms = supportedAlgorithms,
105-
clock = clock,
106-
timeLeeway = timeLeeway,
107-
verifyAttestationProof = verifyAttestationProof,
10877
requireKeyAttestation = requireKeyAttestation,
109-
clientNonceService = clientNonceService,
11078
),
11179
) {
11280
private val supportedSigningAlgorithms = cryptoAlgorithms
@@ -167,31 +135,6 @@ class CredentialIssuer(
167135
*/
168136
suspend fun nonce() = proofValidator.nonce()
169137

170-
/**
171-
* Verifies the [authorizationHeader] to contain a token from [authorizationService],
172-
* verifies the proof sent by the client (must contain a nonce sent from [authorizationService]),
173-
* and issues credentials to the client.
174-
*
175-
* Callers need to send the result JSON-serialized back to the client.
176-
* HTTP status code MUST be 202.
177-
*
178-
* @param authorizationHeader value of HTTP header `Authorization` sent by the client, with all prefixes
179-
* @param params Parameters the client sent JSON-serialized in the HTTP body
180-
* @param request information about the HTTP request the client has made, to validate authentication
181-
*/
182-
@Suppress("DEPRECATION")
183-
@Deprecated("Use `credential` with parameter `credentialDataProvider` instead")
184-
suspend fun credential(
185-
authorizationHeader: String,
186-
params: CredentialRequestParameters,
187-
request: RequestInfo? = null,
188-
): KmmResult<CredentialResponseParameters> = credential(
189-
authorizationHeader = authorizationHeader,
190-
params = params,
191-
credentialDataProvider = CredentialIssuerDataProviderAdapter(credentialProvider),
192-
request = request,
193-
)
194-
195138
/**
196139
* Verifies the [authorizationHeader] to contain a token from [authorizationService],
197140
* verifies the proof sent by the client (must contain a nonce sent from [authorizationService]),
@@ -296,40 +239,3 @@ class CredentialIssuer(
296239
}
297240

298241
}
299-
300-
@Deprecated("Use `CredentialDataProviderFun` instead")
301-
fun interface CredentialIssuerDataProvider {
302-
303-
/**
304-
* Gets called with the user authorized in [userInfo],
305-
* a resolved [credentialScheme],
306-
* the holder key in [subjectPublicKey],
307-
* and the requested credential [representation].
308-
* Callers may optionally define some attribute names from [ConstantIndex.CredentialScheme.claimNames] in
309-
* [claimNames] to request only some claims (if supported by the representation).
310-
*/
311-
fun getCredential(
312-
userInfo: OidcUserInfoExtended,
313-
subjectPublicKey: CryptoPublicKey,
314-
credentialScheme: CredentialScheme,
315-
representation: ConstantIndex.CredentialRepresentation,
316-
claimNames: Collection<String>?,
317-
): KmmResult<CredentialToBeIssued>
318-
}
319-
320-
/** Fallback for deprecated constructor parameter, which should never be called, because when clients
321-
* migrate away from deprecated code, it's never used from our code,
322-
* when not, clients did set a correct implementation and that one is used. */
323-
@Suppress("DEPRECATION")
324-
private class FallbackCredentialIssuerDataProvider : CredentialIssuerDataProvider {
325-
override fun getCredential(
326-
userInfo: OidcUserInfoExtended,
327-
subjectPublicKey: CryptoPublicKey,
328-
credentialScheme: CredentialScheme,
329-
representation: ConstantIndex.CredentialRepresentation,
330-
claimNames: Collection<String>?,
331-
): KmmResult<CredentialToBeIssued> = catching {
332-
TODO()
333-
}
334-
335-
}

vck-openid/src/commonMain/kotlin/at/asitplus/wallet/lib/oidvci/Extensions.kt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,10 @@ import at.asitplus.signum.indispensable.cosef.io.coseCompliantSerializer
77
import at.asitplus.signum.indispensable.io.Base64UrlStrict
88
import at.asitplus.wallet.lib.agent.Issuer
99
import at.asitplus.wallet.lib.data.ConstantIndex.CredentialRepresentation
10-
import at.asitplus.wallet.lib.data.ConstantIndex.CredentialScheme
11-
import at.asitplus.wallet.lib.oidvci.CredentialSchemeMapping.toCredentialIdentifier
1210
import io.matthewnelson.encoding.core.Encoder.Companion.encodeToString
1311
import kotlinx.serialization.encodeToByteArray
1412
import kotlinx.serialization.json.JsonPrimitive
1513

16-
// TODO In 5.4.0, use DC_SD_JWT instead of VC_SD_JWT
17-
@Suppress("DEPRECATION")
18-
@Deprecated("Use extension method in CredentialSchemeMapping instead")
19-
fun CredentialScheme.toCredentialIdentifier() = toCredentialIdentifier()
20-
21-
// TODO In 5.4.0, use DC_SD_JWT instead of VC_SD_JWT
22-
@Suppress("DEPRECATION")
23-
@Deprecated("Use extension method in CredentialSchemeMapping instead")
24-
fun CredentialScheme.toCredentialIdentifier(rep: CredentialRepresentation) = toCredentialIdentifier(rep)
25-
2614
fun CredentialRepresentation.toFormat(): CredentialFormatEnum = when (this) {
2715
CredentialRepresentation.PLAIN_JWT -> CredentialFormatEnum.JWT_VC
2816
CredentialRepresentation.SD_JWT -> CredentialFormatEnum.DC_SD_JWT

vck-openid/src/commonMain/kotlin/at/asitplus/wallet/lib/oidvci/OAuth2DataProvider.kt

Lines changed: 0 additions & 27 deletions
This file was deleted.

vck-openid/src/commonTest/kotlin/at/asitplus/wallet/lib/openid/OpenId4VpInteropTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class OpenId4VpInteropTest : FreeSpec({
6262
holderKeyMaterial = EphemeralKeyWithoutCert()
6363
holderAgent = HolderAgent(
6464
holderKeyMaterial,
65-
validator = Validator(
65+
validatorSdJwt = ValidatorSdJwt(
6666
verifyJwsObject = VerifyJwsObject(publicKeyLookup = { setOf(issuerKeyMaterial.publicKey.toJsonWebKey()) })
6767
)
6868
)

0 commit comments

Comments
 (0)