Skip to content

Commit

Permalink
Merge pull request #39 from alphagov/death-registration-mvp
Browse files Browse the repository at this point in the history
Life events experimental schema
  • Loading branch information
galund authored Aug 18, 2023
2 parents 04bd61b + 57604d6 commit 3b632e6
Show file tree
Hide file tree
Showing 13 changed files with 434 additions and 80 deletions.
2 changes: 2 additions & 0 deletions scripts/generate_json_schemas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ LINKML_ITEMS=(
"name.yaml,NameClass,Name.json"
"credentials.yaml,IssuerAuthorizationRequestClass,IssuerAuthorizationRequest.json"
"credentials.yaml,OpenIDConnectAuthenticationRequestClass,OpenIDConnectAuthenticationRequest.json"
"lifeEvents.yaml,DeathRegistrationJWTClass,DeathRegistrationJWT.json",
"lifeEvents.yaml,DeathRegistrationUpdateJWTClass,DeathRegistrationUpdateJWT.json"
)

ROOT_DIR="$( git rev-parse --show-toplevel )"
Expand Down
2 changes: 2 additions & 0 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ ajv validate -c ajv-formats -s $HERE/../v1/json-schemas/IdentityCheckCredentialJ
ajv validate -c ajv-formats -s $HERE/../v1/json-schemas/IdentityCheckCredentialJWT.json -d $HERE/../v1/examples/identity-check-jwt.json
ajv validate -c ajv-formats -s $HERE/../v1/json-schemas/IssuerAuthorizationRequest.json -d $HERE/../v1/examples/core-cri-authz-request.json
ajv validate -c ajv-formats -s $HERE/../v1/json-schemas/OpenIDConnectAuthenticationRequest.json -d $HERE/../v1/examples/rp-authz-request.json
ajv validate -c ajv-formats -s $HERE/../v1/json-schemas/DeathRegistrationJWT.json -d $HERE/../v1/examples/life-events/death-registration.json
ajv validate -c ajv-formats -s $HERE/../v1/json-schemas/DeathRegistrationUpdateJWT.json -d $HERE/../v1/examples/life-events/death-registration-update.json
82 changes: 82 additions & 0 deletions v1/examples/life-events/death-registration-update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"iss": "https://scim.example.com",
"iat": 1691637001,
"jti": "4d3559ec67504aaba65d40b0363faad8",
"toe": 618772150,
"events": {
"https://ssf.account.gov.uk/v1/deathRegistrationUpdate": {
"subject": {
"name": [
{
"nameParts": [
{
"value": "Velma",
"type": "GivenName"
},
{
"value": "Rogers",
"type": "FamilyName"
}
]
},
{
"nameParts": [
{
"value": "Velma",
"type": "GivenName"
},
{
"value": "Smith",
"type": "FamilyName"
}
],
"description": "Otherwise or formerly known as"
},
{
"nameParts": [
{
"value": "Velma",
"type": "GivenName"
},
{
"value": "Molone",
"type": "FamilyName"
}
],
"description": "Name before marriage"
}
],
"sex": [
{
"value": "Female"
}
],
"birthDate": [
{
"value": "1989-07-06"
}
],
"address": [
{
"subBuildingName": "Flat 4",
"buildingNumber": "5",
"streetName": "Mystery Street",
"addressLocality": "Coolsville",
"postalCode": "M15 7",
"addressCountry": "US"
}
]
},
"deathRegistrationID": 123456,
"deathDate": {
"value": "1989-07",
"description": "Deceased found on 3 August 1989"
},
"freeFormatDeathDate": "Unknown due to mortuary error but some time in July 1989",
"recordUpdateTime": {
"value": "1989-08-10T18:09:10"
},
"deathRegistrationUpdateReason": "formal_correction"
}
}
}
81 changes: 81 additions & 0 deletions v1/examples/life-events/death-registration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"iss": "https://scim.example.com",
"iat": 1691637001,
"jti": "4d3559ec67504aaba65d40b0363faad8",
"toe": 618744124,
"events": {
"https://ssf.account.gov.uk/v1/deathRegistration": {
"subject": {
"name": [
{
"nameParts": [
{
"value": "Velma",
"type": "GivenName"
},
{
"value": "Rogers",
"type": "FamilyName"
}
]
},
{
"nameParts": [
{
"value": "Velma",
"type": "GivenName"
},
{
"value": "Smith",
"type": "FamilyName"
}
],
"description": "Otherwise or formerly known as"
},
{
"nameParts": [
{
"value": "Velma",
"type": "GivenName"
},
{
"value": "Molone",
"type": "FamilyName"
}
],
"description": "Name before marriage"
}
],
"sex": [
{
"value": "Female"
}
],
"birthDate": [
{
"value": "1989-07-06"
}
],
"address": [
{
"subBuildingName": "Flat 4",
"buildingNumber": "5",
"streetName": "Mystery Street",
"addressLocality": "Coolsville",
"postalCode": "M15 7",
"addressCountry": "US"
}
]
},
"deathRegistrationID": 123456,
"deathDate": {
"value": "1989-07",
"description": "Deceased found on 3 August 1989"
},
"freeFormatDeathDate": "Unknown due to mortuary error but some time in July 1989",
"deathRegistrationTime": {
"value": "1989-08-10T10:22:04"
}
}
}
}
56 changes: 54 additions & 2 deletions v1/linkml-schemas/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,47 @@ prefixes:
imports:
- linkml:types
default_curi_maps:
- semweb_context
- semweb_context
default_prefix: di_vocab
default_range: string

classes:
JWTClass:
slots:
- iss
- sub
- nbf
- exp
- aud
- iat
- jti
ValidityClass:
abstract: true
mixin: true
slots:
- validFrom
- validUntil

StructuredAttributeClass:
slots:
- value

StructuredDateTimeClass:
is_a: StructuredAttributeClass
description: A complete datetime in ISO format with a structure to allow future addition of metadata if required
slot_usage:
value:
range: datetime

ISODateClass:
is_a: StructuredAttributeClass
slots:
- description
attributes:
value:
pattern: "^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$"
range: string

types:
JWS:
uri: "https://www.iana.org/assignments/media-types/application/jose"
Expand All @@ -37,6 +66,8 @@ slots:
value:
required: true
slot_uri: schema:value
description:
slot_uri: schema:description
"@context":
range: string
multivalued: true
Expand All @@ -46,4 +77,25 @@ slots:
slot_uri: schema:validFrom
validUntil:
range: date
slot_uri: schema:validUntil
slot_uri: schema:validUntil
iss:
range: uri
description: The `iss` (issuer) claim identifies the principal that issued the JWT.
sub:
range: uri
description: The `sub` (subject) claim identifies the principal that is the subject of the JWT.
nbf:
range: integer
description: The `nbf` (not before) claim identifies the time the JWT is valid from.
exp:
range: integer
description: The `exp` (expiration time) claim identifies the time the JWT expires.
iat:
range: integer
description: The `iat` (issued at) claim identifies the time at which the JWT was issued.
aud:
range: uri
description: The `aud` (audience) claim identifies the recipients that the JWT is intended for.
jti:
range: uri
description: The `jti` (JWT ID) claim identifies the unique identifier of the JWT.
50 changes: 16 additions & 34 deletions v1/linkml-schemas/credentials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ prefixes:
di_vocab: https://vocab.account.gov.uk/v1/
imports:
- linkml:types
- ./common
- ./person
- ./evidence
- ./vectorsOfTrust
Expand All @@ -22,15 +23,6 @@ default_prefix: di_vocab
default_range: string

classes:
JWTClass:
slots:
- iss
- sub
- nbf
- exp
- aud
- iat
- jti
AuthorizationRequestClass:
is_a: JWTClass
slots:
Expand Down Expand Up @@ -97,50 +89,40 @@ classes:
type:
range: VerifiableCredentialType
multivalued: true
slot_usage:
credentialSubject:
range: PersonIdentityClass
range: PersonWithIdentityClass

AddressCredentialClass:
is_a: VerifiableCredentialClass
attributes:
type:
range: VerifiableCredentialType
multivalued: true
slot_usage:
credentialSubject:
range: AddressClass
range: AddressAssertionClass

CredentialSubjectClass:
description: Verifiable credential subjects use multiple inheritance; this base class is intentionally blank.
see_also:
- /v1/IdentityCheckCredentialClass_credentialSubject
- /v1/AddressCredentialClass_credentialSubject
- /v1/IdentityAssertionCredentialClass_credentialSubject
- /v1/VerifiableIdentityCredentialClass_credentialSubject

slots:
credentialJWT:
range: JWS
multivalued: true
inlined_as_list: true
iss:
range: uri
description: The `iss` (issuer) claim identifies the principal that issued the JWT.
sub:
range: uri
description: The `sub` (subject) claim identifies the principal that is the subject of the JWT.
nbf:
range: integer
description: The `nbf` (not before) claim identifies the time the JWT is valid from.
exp:
range: integer
description: The `exp` (expiration time) claim identifies the time the JWT expires.
iat:
range: integer
description: The `iat` (issued at) claim identifies the time at which the JWT was issued.
aud:
range: uri
description: The `aud` (audience) claim identifies the recipients that the JWT is intended for.
jti:
range: uri
description: The `jti` (JWT ID) claim identifies the unique identifier of the JWT.
vc:
range: VerifiableCredentialClass
credentialSubject:
range: PersonClass
slot_uri: https://www.w3.org/2018/credentials#credentialSubject
range: CredentialSubjectClass
shared_claims:
range: PersonClass
range: IdentityCheckSubjectClass
description: The shared claims. This value will detail what shared information the calling service wants to and is permitted to share.
response_type:
range: string
Expand Down
Loading

0 comments on commit 3b632e6

Please sign in to comment.