Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove UniqueId from PID. #34

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ val OidcSub: AttributeDetails by lazy {
AttributeDetails(
name = "sub",
mandatory = true,
display = mapOf(Locale.ENGLISH to "Unique Identifier"),
dzarras marked this conversation as resolved.
Show resolved Hide resolved
display = mapOf(Locale.ENGLISH to "Subject - Identifier for the End-User at the Issuer"),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ internal fun createMsoMdocReq(
pid.nationality?.let { put("nationalities", JsonArray(listOf(JsonPrimitive(it.value)))) }
put("is_over_18", pid.ageOver18)
pid.ageBirthYear?.let { put("age_birth_year", it.value) }
put("unique_id", pid.uniqueId.value)
put("issuance_date", pidMetaData.issuanceDate.toString())
put("expiry_date", pidMetaData.expiryDate.toString())
when (val issuingAuthority = pidMetaData.issuingAuthority) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class GetPidDataFromAuthServer private constructor(
birthDate = LocalDate.parse(userInfo.birthDate),
ageOver18 = userInfo.ageOver18 ?: false,
gender = userInfo.gender?.let { IsoGender(it) },
uniqueId = UniqueId(userInfo.sub),
residentCountry = userInfo.address?.country?.let { IsoCountry(it) },
residentState = userInfo.address?.region?.let { State(it) },
residentPostalCode = userInfo.address?.postalCode?.let { PostalCode(it) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ private val pidAttributes = pidNameSpace(1) to listOf(
AttributeDetails(
name = "age_birth_year",
),
AttributeDetails(
name = "unique_id",
mandatory = true,
display = mapOf(Locale.ENGLISH to "Unique Identifier"),
),
AttributeDetails(
name = "family_name_birth",
mandatory = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ private object Attributes {
OidcGivenName,
OidcBirthDate,
OidcAddressClaim.attribute,
OidcSub,
OidcGender,
OidcAssuranceNationalities,
OidcAssuranceBirthFamilyName,
Expand Down Expand Up @@ -133,7 +132,6 @@ fun selectivelyDisclosed(
exp(exp.epochSecond)
cnf(holderPubKey)
plain("vct", PidSdJwtVcV1.type.value)
sub(pid.uniqueId.value)

//
// Selectively Disclosed claims
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,6 @@ value class FamilyName(val value: String)
@JvmInline
value class GivenName(val value: String)

/**
* A PID Provider SHALL ensure that a unique_id data element is present in the PID.
* It SHALL contain an identifier for the PID User.
* The value of this data element SHALL be unique and persistent.
* This means that a specific Relying Party, if it is authorized to receive this data element,
* SHALL always receive the same unique_id value for the same PID User from all Wallet Instances
* issued to that PID User, either in parallel or consecutively, throughout the User’s lifetime.
* It is up to each PID Provider to determine if the unique_id for a User is different for each Relying Party,
* or the same for a group of Relying Parties or even for all Relying Parties.
*/
@JvmInline
value class UniqueId(val value: String)

/**
* An Alpha-2 country
* code as specified in ISO 3166-1.
Expand Down Expand Up @@ -74,8 +61,6 @@ typealias Nationality = IsoCountry
* minor (false).
* @param ageBirthYear The year when the PID User was born. If unknown, approximate
* year.
* @param uniqueId A unique and persistent identifier for the PID User, assigned by
* the PID Provider.
* @param familyNameBirth First name(s), including middle name(s), of the PID User at the
* time of birth.
* @param givenNameBirth First name(s), including middle name(s), of the PID User at the time of birth.
Expand All @@ -99,7 +84,6 @@ data class Pid(
val birthDate: LocalDate,
val ageOver18: Boolean,
val ageBirthYear: Year? = null,
val uniqueId: UniqueId,
val familyNameBirth: FamilyName? = null,
val givenNameBirth: GivenName? = null,
val birthPlace: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ internal class WalletApiTest {
givenName = GivenName("Firstname"),
birthDate = LocalDate.of(1989, Month.AUGUST, 22),
ageOver18 = true,
uniqueId = UniqueId(UUID.randomUUID().toString()),
)
val issuingCountry = IsoCountry("GR")
val pidMetaData = PidMetaData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class EncodePidInCborWithMicroServiceTest {
givenName = GivenName("javier"),
birthDate = birthDate,
ageOver18 = true,
uniqueId = UniqueId("86b73c6c-7542-4923-a986-97d2cdf7f07a"),
)
val pidMetaData = PidMetaData(
issuanceDate = LocalDate.of(2023, 7, 19),
Expand Down