Skip to content

Commit bf1c3d0

Browse files
Merge pull request #320 from minvws/update/docs-oin
updated docs to include OIN instead of URA
2 parents 74ee1a6 + aab6cbb commit bf1c3d0

6 files changed

Lines changed: 34 additions & 35 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,11 @@ To use this system:
226226
mtls_override_cert=./secrets/self-signed-uzi-server-cert.crt
227227
```
228228
229-
2. Insert a new organization via a POST to `/orgs`. The organization ura should be the URA of the uzi certificate you
229+
2. Insert a new organization via a POST to `/orgs`. The organization OIN should be the serialNumber of the OIN certificate you
230230
231231
will be testing with.
232232
233-
Note: there is no mTLS check here. You can add multiple organizations with different URA values for testing.
233+
Note: there is no mTLS check here. You can add multiple organizations with different OIN values for testing.
234234
235235
3. Next, you will need to register your public key to the key services. You can do this by calling `/register/certificate` with a JSON body like:
236236
@@ -286,7 +286,7 @@ To use this system:
286286
POST /oprf/eval
287287
{
288288
"encryptedPersonalId": "EJU9qVhKNmw_UhCXDN_aVM4GL1DCmpDs8QD5WOdUBCU=",
289-
"recipientOrganization": "ura:12345678",
289+
"recipientOrganization": "oin:00000099000000001000",
290290
"recipientScope": "nvi"
291291
}
292292

@@ -331,7 +331,7 @@ To use this system:
331331
},
332332
"decrypted": {
333333
"subject": "pseudonym:eval:-Jpsoeik2058ip20b9Wd-vlwpjkjxRN4IoBrk8Ym2Bg=",
334-
"aud": "ura:12345678",
334+
"aud": "oin:100000099000000001000",
335335
"scope": "nvi",
336336
"version": "1.1",
337337
"iat": 1758616285,

app/application.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@
1616
from app.config import get_config
1717
from app.auth import get_auth_ctx
1818

19-
2019
API_DESCRIPTION = """
2120
The Pseudoniemendienst (PRS) lets parties exchange data about a person without
2221
sharing their BSN. Instead of a BSN, parties exchange **RIDs** and **pseudonyms**
2322
that are scoped to a recipient organization and scope.
2423
25-
A recipient organization is always identified by a URA in the form
26-
`ura:<8 digits>` (e.g. `ura:90000036`).
24+
A recipient organization is always identified by a OIN in the form
25+
`oin:<20 digits>` (e.g. `oin:00000099000000001000`).
2726
2827
The endpoints are grouped into the sections below. Most sections are protected by
2928
mutual TLS (mTLS); the calling organization and, where relevant, its public key
@@ -44,7 +43,7 @@
4443
"name": "Organizational Services",
4544
"description": (
4645
"Manage recipient organizations. An organization is identified by its "
47-
"URA and has a `max_key_usage` (`bsn`, `rp`, or `irp`) that caps which "
46+
"OIN and has a `max_key_usage` (`bsn`, `rp`, or `irp`) that caps which "
4847
"pseudonym types it is allowed to exchange."
4948
),
5049
},

docs/endpoints.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Previously when working with applications within gfmodules, the actual BSN numbe
44

55
This document lists the main service endpoints. The testing/helper endpoints (`/test/...`) are documented in [tests.md](tests.md), and the end-to-end OPRF evaluation flow is described in [oprf-eval-flow.md](oprf-eval-flow.md).
66

7-
A recipient organization is always identified by a URA in the form `ura:<8 digits>` (e.g. `ura:90000036`).
7+
A recipient organization is always identified by a OIN in the form `oin:<20 digits>` (e.g. `oin:00000099000000001000`).
88

99
## Organizational Services
1010

@@ -13,21 +13,21 @@ Create a new organization.
1313

1414
```json
1515
{
16-
"ura": "90000036",
16+
"oin": "00000099000000001000",
1717
"name": "Example Organization",
1818
"max_key_usage": "irp"
1919
}
2020
```
2121

2222
`max_key_usage` is one of `bsn`, `rp`, or `irp` and caps which pseudonym types the organization may exchange.
2323

24-
#### `GET /org/{ura}`
25-
Return the organization for the given URA (digits only, e.g. `90000036`).
24+
#### `GET /org/{oin}`
25+
Return the organization for the given OIN (digits only, e.g. `00000099000000001000`).
2626

27-
#### `PUT /org/{ura}`
27+
#### `PUT /org/{oin}`
2828
Update an organization's `name` and `max_key_usage`.
2929

30-
#### `DELETE /org/{ura}`
30+
#### `DELETE /org/{oin}`
3131
Delete an organization (and its keys).
3232

3333
## Key Registration Services
@@ -45,7 +45,7 @@ Register the public key (taken from the mTLS client certificate) for one or more
4545

4646
Returns `201` on success, `409` if a key for that organization/scope already exists.
4747

48-
#### `GET /keys/{ura}`
48+
#### `GET /keys/{oin}`
4949
List the registered public keys for an organization.
5050

5151
#### `PUT /keys/{key_id}`
@@ -62,7 +62,7 @@ Exchange a personal ID for a pseudonym targeted at a recipient organization/scop
6262
```json
6363
{
6464
"personalId": "NL:bsn:950000012",
65-
"recipientOrganization": "ura:90000036",
65+
"recipientOrganization": "oin:00000099000000001000",
6666
"recipientScope": "bar",
6767
"pseudonymType": "irreversible"
6868
}
@@ -76,7 +76,7 @@ Exchange a personal ID for a RID that the recipient can later redeem. The RID is
7676
```json
7777
{
7878
"personalId": "NL:bsn:950000012",
79-
"recipientOrganization": "ura:90000036",
79+
"recipientOrganization": "oin:00000099000000001000",
8080
"recipientScope": "bar",
8181
"ridUsage": "irp"
8282
}
@@ -88,7 +88,7 @@ Redeem a previously issued RID for a pseudonym (or the BSN, when allowed). The r
8888
```json
8989
{
9090
"rid": "rid:<encrypted-rid>",
91-
"recipientOrganization": "ura:90000036",
91+
"recipientOrganization": "oin:00000099000000001000",
9292
"recipientScope": "bar",
9393
"pseudonymType": "irp"
9494
}
@@ -111,7 +111,7 @@ Evaluate a blinded personal identifier and return a JWE (encrypted to the recipi
111111
```json
112112
{
113113
"encryptedPersonalId": "co1ZgSqfsiB8iEzmKWl3xgxlc0erstUNyBAC3tdjxzg=",
114-
"recipientOrganization": "ura:90000036",
114+
"recipientOrganization": "oin:00000099000000001000",
115115
"recipientScope": "bar"
116116
}
117117
```

docs/hsm-key-cleanup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ not yet marked `removed`, the program:
1212

1313
1. Destroys the corresponding key in the HSM via
1414
`POST {hsm_url}/hsm/{module}/{slot}/destroy` with the key's label
15-
(`ura-ura:<ura>-v<version>` — the same label used during evaluation).
15+
(`oin-<oin>-v<version>` — the same label used during evaluation).
1616
2. Marks the version as `removed` in the database.
1717

1818
If the HSM call fails for a version, that version is left untouched so the next

docs/oprf-eval-flow.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This describes the internal PRS flow when a client asks the PRS to evaluate a
44
blinded personal identifier. The evaluation can run either against a local OPRF
55
key or, in production, against an HSM. When the HSM is used, the active key
6-
versions are looked up from the `hsm_key_version` table (per URA, for the current
6+
versions are looked up from the `hsm_key_version` table (per OIN, for the current
77
date), the blind is evaluated against **every** active version, and the resulting
88
JWE stays backwards compatible: the `subject` always carries the latest version,
99
while older versions are added in a separate `extra_versions` claim.
@@ -26,13 +26,13 @@ sequenceDiagram
2626
2727
Client->>Router: POST /oprf/eval<br/>{encryptedPersonalId, recipientOrganization, recipientScope}
2828
29-
Note over Router: recipientOrganization must start with "ura:"
29+
Note over Router: recipientOrganization must start with "oin:"
3030
alt invalid prefix
3131
Router-->>Client: 400 Invalid recipient organization
3232
end
3333
34-
Router->>Org: get_by_ura(ura)
35-
Org->>DB: SELECT organization WHERE ura = ?
34+
Router->>Org: get_by_oin(oin)
35+
Org->>DB: SELECT organization WHERE oin = ?
3636
DB-->>Org: organization | none
3737
alt organization not found
3838
Org-->>Router: none
@@ -54,11 +54,11 @@ sequenceDiagram
5454
alt HSM configured (hsm_url set)
5555
OPRF->>Ver: get_active_versions(now)
5656
Ver->>DB: SELECT hsm_key_version<br/>not removed, from_dt <= now, until_dt null/>= now
57-
DB-->>Ver: active versions (all URAs)
57+
DB-->>Ver: active versions (all OINs)
5858
Ver-->>OPRF: active versions
59-
Note over OPRF: filter by URA -> sorted version numbers<br/>(error if none active)
59+
Note over OPRF: filter by OIN -> sorted version numbers<br/>(error if none active)
6060
loop for each active version v
61-
OPRF->>HSM: POST /oprf/evaluate<br/>label "ura-<org>-v<v>", blinded_point
61+
OPRF->>HSM: POST /oprf/evaluate<br/>label "oin-<org>-v<v>", blinded_point
6262
HSM-->>OPRF: result (eval bytes for v)
6363
end
6464
else local key

docs/tests.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Request:
2525
POST /oprf/eval
2626
{
2727
"encryptedPersonalId": "co1ZgSqfsiB8iEzmKWl3xgxlc0erstUNyBAC3tdjxzg=",
28-
"recipientOrganization": "ura:90000036",
28+
"recipientOrganization": "oin:00000099000000001000",
2929
"recipientScope": "bar"
3030
}
3131
```
@@ -66,7 +66,7 @@ Response:
6666
},
6767
"decrypted": {
6868
"subject": "pseudonym:eval:Ngb5jRWtUc_EtfPud1uPnjhHwvww1pt51wx_DBao_Uc=",
69-
"aud": "ura:90000036",
69+
"aud": "oin:00000099000000001000",
7070
"scope": "bar",
7171
"version": "1.1",
7272
"iat": 1762769767,
@@ -94,7 +94,7 @@ Request:
9494
POST /exchange/pseudonym
9595
{
9696
"personalId": "NL:bsn:950000012",
97-
"recipientOrganization": "ura:90000036",
97+
"recipientOrganization": "oin:00000099000000001000",
9898
"recipientScope": "bar",
9999
"pseudonymType": "irreversible"
100100
}
@@ -151,11 +151,11 @@ Response:
151151

152152
# Scenarios:
153153

154-
org | ura | max_key_usage
155-
-------|--------------|---------------
156-
Org 1 | ura:90000036 | irp
157-
Org 2 | ura:90000037 | rp
158-
Org 3 | ura:90000038 | bsn
154+
org | oin | max_key_usage
155+
-------|--------------------------|---------------
156+
Org 1 | oin:00000099000000001000 | irp
157+
Org 2 | oin:00000098000000001000 | rp
158+
Org 3 | oin:00000097000000001000 | bsn
159159

160160
* Org 1 can only create irreversible pseudonyms. It cannot be decoded back to the personal ID by anyone.
161161
* Org 2 can create reversible pseudonyms. It cannot decode itself back to the personal ID but can allow others (who have bsn max_key_usage) to do so.

0 commit comments

Comments
 (0)