Skip to content

Commit 75b7d52

Browse files
committed
OID4VP: Remove deprecated elements
1 parent fade9c2 commit 75b7d52

7 files changed

Lines changed: 13 additions & 68 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Release 5.10.0 (Unreleased):
1919
- Use correct syntax for `vp_token` in responses to DCQL queries, i.e., with an array
2020
- Drop session transcript implementation from ISO/IEC 18013-7:2024 Annex B, which was pre-OpenID4VP 1.0
2121
- Remove deprecated format identifier `vc+sd-jwt` (now `dc+sd-jwt`)
22+
- Remove deprecated client identifier prefix scheme `x509_san_uri`
2223

2324
Release 5.9.0
2425
- Refactor `RqesWalletService` to be stateless

openid-data-classes/src/commonMain/kotlin/at/asitplus/openid/AuthenticationRequestParameters.kt

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,6 @@ data class AuthenticationRequestParameters(
5252
@SerialName("client_id")
5353
val clientId: String? = null,
5454

55-
/**
56-
* OID4VP: OPTIONAL. A string identifying the scheme of the value in the `client_id` Authorization Request parameter
57-
* (Client Identifier scheme). Kept here only for compatibility with POTENTIAL.
58-
*/
59-
@Deprecated("Removed from OpenID4VP Draft 22", level = DeprecationLevel.ERROR)
60-
@SerialName("client_id_scheme")
61-
val clientIdScheme: OpenIdConstants.ClientIdScheme? = null,
62-
6355
/**
6456
* OIDC: REQUIRED. Redirection URI to which the response will be sent. This URI MUST exactly match one of the
6557
* Redirection URI values for the Client pre-registered at the OpenID Provider, with the matching performed as
@@ -128,10 +120,6 @@ data class AuthenticationRequestParameters(
128120
@SerialName("client_metadata")
129121
val clientMetadata: RelyingPartyMetadata? = null,
130122

131-
@Deprecated("Removed from OpenID4VP Draft 21")
132-
@SerialName("client_metadata_uri")
133-
val clientMetadataUri: String? = null,
134-
135123
/**
136124
* OIDC: OPTIONAL. ID Token previously issued by the Authorization Server being passed as a hint about the
137125
* End-User's current or past authenticated session with the Client. If the End-User identified by the ID Token is
@@ -395,15 +383,13 @@ data class AuthenticationRequestParameters(
395383
) : RequestParameters() {
396384

397385
/**
398-
* Reads the [OpenIdConstants.ClientIdScheme] of this request either directly from [clientIdScheme],
399-
* or by extracting the prefix from [clientId] (as specified in OpenID4VP draft 22 onwards).
386+
* Reads the [OpenIdConstants.ClientIdScheme] by extracting the prefix from [clientId]
400387
*/
401388
val clientIdSchemeExtracted: OpenIdConstants.ClientIdScheme?
402389
get() = clientId?.let { OpenIdConstants.ClientIdScheme.decodeFromClientId(it) }
403390

404391
/**
405-
* Reads the [clientId] and removes the prefix of the [clientIdSchemeExtracted],
406-
* as specified in OpenID4VP draft 22 onwards.
392+
* Reads the [clientId] and removes the prefix of the [clientIdSchemeExtracted].
407393
* OpenID4VP states that the *full* [clientId] must be used for presentations and anything else.
408394
*/
409395
val clientIdWithoutPrefix: String?
@@ -413,13 +399,12 @@ data class AuthenticationRequestParameters(
413399

414400
/**
415401
* Reads the [redirectUrl], or the [clientIdWithoutPrefix] if [clientIdSchemeExtracted] is
416-
* [OpenIdConstants.ClientIdScheme.RedirectUri], as specified in OpenID4VP draft 22 onwards.
402+
* [OpenIdConstants.ClientIdScheme.RedirectUri].
417403
*/
418404
val redirectUrlExtracted: String?
419405
get() = redirectUrl
420406
?: (clientIdSchemeExtracted as? OpenIdConstants.ClientIdScheme.RedirectUri)?.let { clientIdWithoutPrefix }
421407

422-
@Suppress("DEPRECATION")
423408
override fun equals(other: Any?): Boolean {
424409
if (this === other) return true
425410
if (other == null || this::class != other::class) return false
@@ -473,7 +458,6 @@ data class AuthenticationRequestParameters(
473458
return true
474459
}
475460

476-
@Suppress("DEPRECATION")
477461
override fun hashCode(): Int {
478462
var result = responseType?.hashCode() ?: 0
479463
result = 31 * result + (clientId?.hashCode() ?: 0)

openid-data-classes/src/commonMain/kotlin/at/asitplus/openid/OpenIdConstants.kt

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,14 @@ object OpenIdConstants {
150150
private const val STRING_PRE_REGISTERED = "pre-registered"
151151
private const val STRING_REDIRECT_URI = "redirect_uri"
152152
private const val STRING_X509_SAN_DNS = "x509_san_dns"
153-
private const val STRING_X509_SAN_URI = "x509_san_uri"
154153
private const val STRING_X509_HASH = "x509_hash"
155154
private const val STRING_ENTITY_ID = "entity_id"
156155
private const val STRING_DID = "did"
157156
private const val STRING_VERIFIER_ATTESTATION = "verifier_attestation"
158157

159-
@Suppress("DEPRECATION")
160158
fun decodeFromClientId(clientId: String) = when (clientId.substringBefore(":")) {
161159
STRING_REDIRECT_URI -> RedirectUri
162160
STRING_X509_SAN_DNS -> X509SanDns
163-
STRING_X509_SAN_URI -> X509SanUri
164161
STRING_X509_HASH -> X509Hash
165162
STRING_ENTITY_ID -> EntityId
166163
STRING_DID -> Did
@@ -201,20 +198,6 @@ object OpenIdConstants {
201198
*/
202199
object X509SanDns : ClientIdScheme(STRING_X509_SAN_DNS)
203200

204-
/**
205-
* When the Client Identifier Scheme is `x509_san_uri`, the Client Identifier MUST be a URI and match a
206-
* `uniformResourceIdentifier` Subject Alternative Name (SAN) RFC5280 entry in the leaf certificate passed with
207-
* the request. The request MUST be signed with the private key corresponding to the public key in the leaf
208-
* X.509 certificate of the certificate chain added to the request in the `x5c` JOSE header RFC7515 of the
209-
* signed request object. The Wallet MUST validate the signature and the trust chain of the X.509 certificate.
210-
* All Verifier metadata other than the public key MUST be obtained from the `client_metadata` parameter. If
211-
* the Wallet can establish trust in the Client Identifier authenticated through the certificate, e.g. because
212-
* the Client Identifier is contained in a list of trusted Client Identifiers, it may allow the client to
213-
* freely choose the `redirect_uri` value. If not, the `redirect_uri` value MUST match the Client Identifier.
214-
*/
215-
@Deprecated("Removed in OpenID4VP Draft 25")
216-
object X509SanUri : ClientIdScheme(STRING_X509_SAN_URI)
217-
218201
/**
219202
* When the Client Identifier Prefix is `x509_hash`, the original Client Identifier (the part without the
220203
* `x509_hash:` prefix) MUST be a hash and match the hash of the leaf certificate passed with the request.
@@ -272,12 +255,10 @@ object OpenIdConstants {
272255
object Serializer : KSerializer<ClientIdScheme> {
273256
override val descriptor = PrimitiveSerialDescriptor("ClientIdScheme", PrimitiveKind.STRING)
274257

275-
@Suppress("DEPRECATION")
276258
override fun deserialize(decoder: Decoder): ClientIdScheme = when (val string = decoder.decodeString()) {
277259
STRING_PRE_REGISTERED -> PreRegistered
278260
STRING_REDIRECT_URI -> RedirectUri
279261
STRING_X509_SAN_DNS -> X509SanDns
280-
STRING_X509_SAN_URI -> X509SanUri
281262
STRING_X509_HASH -> X509Hash
282263
STRING_ENTITY_ID -> EntityId
283264
STRING_DID -> Did

openid-data-classes/src/commonMain/kotlin/at/asitplus/openid/dcql/DCQLCredentialSetQuery.kt

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,24 @@ import kotlinx.serialization.Serializable
77
/**
88
* 6.2. Credential Set Query
99
*
10-
* A Credential Set Query is an object representing a request for one or more credentials to
11-
* satisfy a particular use case with the Verifier.
10+
* A Credential Set Query is an object representing a request for one or more Credentials to satisfy a particular use
11+
* case with the Verifier.
1212
*/
1313
@Serializable
1414
data class DCQLCredentialSetQuery(
1515
/**
16-
* OID4VP draft 23: options: REQUIRED: A non-empty array, where each value in the array is a
17-
* list of Credential Query identifiers representing one set of Credentials that satisfies the
18-
* use case. The value of each element in the options array is an array of identifiers which
19-
* reference elements in credentials.
16+
* REQUIRED. A non-empty array, where each value in the array is a list of Credential Query identifiers
17+
* representing one set of Credentials that satisfies the use case. The value of each element in the `options` array
18+
* is a non-empty array of identifiers which reference elements in `credentials`.
2019
*/
2120
@SerialName("options")
2221
val options: NonEmptyList<List<DCQLCredentialQueryIdentifier>>,
2322

2423
/**
25-
* OID4VP draft 23: required: OPTIONAL. A boolean which indicates whether this set of
26-
* Credentials is required to satisfy the particular use case at the Verifier. If omitted,
27-
* the default value is true.
24+
* OPTIONAL. A boolean which indicates whether this set of Credentials is required to satisfy the particular use
25+
* case at the Verifier. If omitted, the default value is `true`.
2826
*/
2927
@SerialName("required")
3028
val required: Boolean = true,
3129

32-
/**
33-
* OID4VP draft 23: purpose: OPTIONAL. A string, number or object specifying the purpose of the
34-
* query. This specification does not define a specific structure or specific values for this
35-
* property. The purpose is intended to be used by the Verifier to communicate the reason for
36-
* the query to the Wallet. The Wallet MAY use this information to show the user the reason
37-
* for the request.
38-
*/
39-
@Deprecated("Removed in OpenID4VP Draft 26")
40-
@SerialName("purpose")
41-
val purpose: DCQLCredentialSetQueryPurpose? = null,
42-
)
30+
)

openid-data-classes/src/commonTest/kotlin/at/asitplus/openid/dcql/DCQLQueryTest.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -538,15 +538,13 @@ val DCQLQueryTest by testSuite {
538538
],
539539
"credential_sets": [
540540
{
541-
"purpose": "Identification",
542541
"options": [
543542
[ "pid" ],
544543
[ "other_pid" ],
545544
[ "pid_reduced_cred_1", "pid_reduced_cred_2" ]
546545
]
547546
},
548547
{
549-
"purpose": "Show your rewards card",
550548
"required": false,
551549
"options": [
552550
[ "nice_to_have" ]
@@ -752,14 +750,12 @@ val DCQLQueryTest by testSuite {
752750
],
753751
"credential_sets": [
754752
{
755-
"purpose": "Identification",
756753
"options": [
757754
[ "mdl-id" ],
758755
[ "photo_card-id" ]
759756
]
760757
},
761758
{
762-
"purpose": "Proof of address",
763759
"required": false,
764760
"options": [
765761
[ "mdl-address" ],

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,8 @@ internal class AuthorizationRequestValidator(
8484
}
8585
}
8686

87-
@Suppress("DEPRECATION")
8887
private fun ClientIdScheme?.isAnyX509() =
89-
(this == ClientIdScheme.X509SanDns)
90-
|| (this == ClientIdScheme.X509SanUri)
91-
|| (this == ClientIdScheme.X509Hash)
88+
(this == ClientIdScheme.X509SanDns) || (this == ClientIdScheme.X509Hash)
9289

9390
@Throws(OAuth2Exception::class)
9491
private fun AuthenticationRequestParameters.verifyClientMetadata() {
@@ -127,7 +124,6 @@ internal class AuthorizationRequestValidator(
127124
val leaf = jwsSigned.header.certificateChain!!.leaf
128125
when (clientIdScheme) {
129126
ClientIdScheme.X509SanDns -> verifyX509SanDns(leaf, responseModeIsDirectPost, responseModeIsDcApi)
130-
ClientIdScheme.X509SanUri -> verifyX509SanUri(leaf)
131127
ClientIdScheme.X509Hash -> verifyX509SanHash(leaf)
132128
// checked before calling this method
133129
else -> throw InvalidRequest("Unexpected clientIdScheme $clientIdScheme")

vck/src/commonTest/kotlin/at/asitplus/wallet/openid/dcql/DCQLQueryProcedureAdapterTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ val DCQLQueryProcedureAdapterTest by testSuite {
5353
{
5454
"credential_sets": [
5555
{
56-
"purpose": "To obtain e-prescription, we need to verify your identity.",
5756
"options": [
5857
[
5958
"pid_sd_jwt"

0 commit comments

Comments
 (0)