Skip to content

Commit 0817e19

Browse files
authored
Issue #4: Make some updates/corrections to Identity Mapper design doc; a… (#15)
…dd README files
1 parent ee06c75 commit 0817e19

4 files changed

Lines changed: 98 additions & 162 deletions

File tree

cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@
8181
"marimo",
8282
"mkdocs",
8383
"mongoimport",
84+
"mypass",
8485
"mypy",
86+
"myuser",
8587
"ndarray",
8688
"NOJIRA",
8789
"nosetests",

docs/LIF_Component_Design_Document-Identity_Mapper.md

Lines changed: 15 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -30,80 +30,6 @@ Version 1.0.0
3030

3131
            [Identity Mapper Service](#identity-mapper-service)
3232

33-
      [Design Requirements](#design-requirements-1)
34-
35-
            [Performance](#performance-1)
36-
37-
            [Concurrency](#concurrency-1)
38-
39-
      [Dependencies](#dependencies)
40-
41-
      [Exceptions and Errors](#exceptions-and-errors)
42-
43-
            [Data validation exception](#data-validation-exception)
44-
45-
            [Mapping exception](#_Toc198241137)
46-
47-
      [Example Usage](#example-usage)
48-
49-
[Detailed Design](#detailed-design)
50-
51-
      [Implementation Model](#implementation-model)
52-
53-
      [Tools and Technologies](#tools-and-technologies)
54-
55-
      [Implementation Requirements](#implementation-requirements)
56-
57-
            [Data Storage](#data-storage)
58-
59-
            [State](#state)
60-
61-
            [Concurrency](#concurrency-2)
62-
63-
            [Sync/Async](#syncasync)
64-
65-
            [External Services](#external-services)
66-
67-
[Deployment Design](#deployment-design)
68-
69-
      [Deployment Environment](#deployment-environment)
70-
71-
      [Deployment Model](#deployment-model)
72-
73-
      [Deployment Requirements](#deployment-requirements)
74-
75-
      [Dependencies](#dependencies-1)
76-
77-
[Motivation](#motivation)
78-
79-
[Design Proposal](#design-proposal)
80-
81-
      [Key Concept](#key-concept)
82-
83-
      [Functional Requirements](#functional-requirements)
84-
85-
      [Interaction with Other LIF Components](#interaction-with-other-lif-components)
86-
87-
      [Design Assumptions](#design-assumptions)
88-
89-
      [Design Requirements](#design-requirements)
90-
91-
            [Performance](#performance)
92-
93-
            [Concurrency](#concurrency)
94-
95-
      [High Level Design](#high-level-design)
96-
97-
            [Identity Mapper Storage](#identity-mapper-storage)
98-
99-
            [Identity Mapper Service](#identity-mapper-service)
100-
101-
      [Design Requirements](#design-requirements-1)
102-
103-
            [Performance](#performance-1)
104-
105-
            [Concurrency](#concurrency-1)
106-
10733
      [Dependencies](#dependencies)
10834

10935
      [Exceptions and Errors](#exceptions-and-errors)
@@ -114,33 +40,7 @@ Version 1.0.0
11440

11541
      [Example Usage](#example-usage)
11642

117-
[Detailed Design](#detailed-design)
118-
119-
      [Implementation Model](#implementation-model)
120-
121-
      [Tools and Technologies](#tools-and-technologies)
122-
123-
      [Implementation Requirements](#implementation-requirements)
124-
125-
            [Data Storage](#data-storage)
126-
127-
            [State](#state)
128-
129-
            [Concurrency](#concurrency-2)
130-
131-
            [Sync/Async](#syncasync)
132-
133-
      [External Services](#external-services)
134-
135-
      [Deployment Design](#deployment-design)
136-
137-
            [Deployment Environment](#deployment-environment)
138-
139-
            [Deployment Model](#deployment-model)
140-
141-
            [Deployment Requirements](#deployment-requirements)
142-
143-
            [Dependencies](#dependencies-1)
43+
[Possible Future Roadmap Items](#possible-future-roadmap-items)
14444

14545
# Overview
14646

@@ -158,7 +58,7 @@ The **Identity Mapper** component addresses this need by resolving person identi
15858

15959
The **Identity Mapper** is a standalone component that maps person identifiers of two organizations. The **Identity Mapper** is intended to be populated by an internal system having knowledge of the relationship between identifiers used by two organizations. It is invoked by the **Query Planner** when there is a need to translate an external person identifier into an internal identifier.
16060

161-
![](media/image_identityMapper_1.png)
61+
![](media/image_identityMapper_4.png)
16262

16363
*Image 1: A simple diagram depicting how the Identity Mapper functions at a high-level*
16464

@@ -173,7 +73,7 @@ This component has the following specific requirements:
17373
via an API
17474

17575
3. Ability to populate identity mapping database through a bulk upload
176-
process
76+
process (Possible Future Roadmap Item)
17777

17878
## Interaction with Other LIF Components
17979

@@ -197,7 +97,7 @@ This component primarily interacts with the **Query Planner**, which invokes it
19797

19898
### Performance
19999

200-
The component should provide consistent performance irrespective of the volume of the requests and number of identity mapping records.
100+
(Possible Future Roadmap Item) The component should provide consistent performance irrespective of the volume of the requests and number of identity mapping records.
201101

202102
### Concurrency
203103

@@ -207,7 +107,7 @@ Concurrent endpoint requests are addressed through parallel threads implemented
207107

208108
The **Identity Mapper** is a standalone component that enables the conversion of a person identifier from an external organization to an internal identifier. As depicted below, the proposed design envisions Identity Mapper storage, along with an Identity Mapper service that provides CRUD operation endpoints.
209109

210-
![](media/image_identityMapper_2.png)
110+
![](media/image_identityMapper_5.png)
211111

212112
*Image 2: Simple diagram depicting the relationship between the ID Mapper Service and ID Mapper Storage*
213113

@@ -233,37 +133,37 @@ A uniqueness constraint should be enforced on the combination of LIF Organizatio
233133

234134
The following methods should be implemented in the Identity Mapper Service to save, retrieve, and delete mappings:
235135

236-
1. **Save Mappings:** POST Organizations/{Org id}/Persons/{Person id}/mappings
136+
1. **Save Mappings:** POST organizations/{org_id}/persons/{person_id}/mappings
237137

238-
2. **List Mappings:** GET Organizations/{Org id}/Persons/{Person id}/
138+
2. **List Mappings:** GET organizations/{org_id}/persons/{person_id}/mappings
239139

240-
3. **Delete Mappings:** DELETE Organizations/{Org id}/Persons/{Person id}/mappings/{mapping id}
140+
3. **Delete Mappings:** DELETE organizations/{org_id}/persons/{person_id}/mappings/{mapping_id}
241141

242142
The diagrams in the following section illustrate the internal steps the service should implement to enable the above methods.
243143

244144
1. **Save Mappings:** A collection of mappings should be passed to the method for saving the mappings in the storage.
245145

246-
![](media/image_identityMapper_3.pdf)
146+
![](media/image_identityMapper_3.png)
247147

248148
*Image 3: Workflow diagram for the Save Mappings method*
249149

250150
2. **List Mappings:** The workflow below illustrates the steps the service should implement to list the mappings for a given organization and person.
251151

252-
![](media/image_identityMapper_4.png)
152+
![](media/image_identityMapper_2.png)
253153

254154
*Image 4: Workflow diagram for the List Mappings method*
255155

256156
3. **Delete Mappings:** The workflow below illustrates the steps the service should implement to delete the mapping for a given organization and person.
257157

258-
![](media/image_identityMapper_5.png)
158+
![](media/image_identityMapper_1.png)
259159

260160
*Image 5: Workflow diagram for the Delete Mappings method*
261161

262162
## Design Requirements
263163

264164
### Performance
265165

266-
The component should provide consistent performance irrespective of the volume of the requests and number of identity mapping records.
166+
(Possible Future Roadmap Item) The component should provide consistent performance irrespective of the volume of the requests and number of identity mapping records.
267167

268168
### Concurrency
269169

@@ -283,54 +183,7 @@ This exception occurs when uniqueness constrains for External and Internal Ident
283183

284184
TBD
285185

286-
# Detailed Design
287-
288-
This component is designed to be implemented as a serverless component that can be scaled on demand.
289-
290-
## Implementation Model
291-
292-
TBD
293-
294-
## Tools and Technologies
295-
296-
The component is implemented using Python.
297-
298-
## Implementation Requirements
299-
300-
### Data Storage
301-
302-
This component stores data in a SQL database.
303-
304-
### State
305-
306-
This component is stateless and does not maintain any information about any run.
307-
308-
### Concurrency
309-
310-
Being a stateless component, it should be able to scale on demand to address multiple concurrent requests.
311-
312-
### Sync/Async
313-
314-
This component operates in sync mode and the client waits for it to return the result before performing any other activity.
315-
316-
### External Services
317-
318-
This component does not call any external services.
319-
320-
# Deployment Design
321-
322-
## Deployment Environment
323-
324-
The component can be deployed in the cloud using serverless infrastructure such as AWS Step Function or Azure Function. In the on-prem deployment environment, the component can be deployed in a docker container running the data pipeline.
325-
326-
## Deployment Model
327-
328-
TBD
329-
330-
## Deployment Requirements
331-
332-
TBD
333-
334-
## Dependencies
186+
## Possible Future Roadmap Items
335187

336-
TBD
188+
- [Issue #12: Add Identity Mapper Support for Bulk Upload Process](https://github.com/LIF-Initiative/lif-core/issues/12)
189+
- [Issue #13: Investigate and Improve Identity Mapper Performance](https://github.com/LIF-Initiative/lif-core/issues/13)
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# LIF Identity Mapper API
2+
3+
The **Identity Mapper API** facilitates the resolution of person identifiers from external partner organizations to the internal identifiers utilized within the organization. It enables cross-organizational sharing of LIF records for individuals using the respective identifiers from each organization. The API provides simple CRUD operations for managing the mappings.
4+
5+
# Example Usage
6+
7+
## Build the project
8+
9+
Navigate to this folder (where the `pyproject.toml` file is)
10+
11+
``` shell
12+
./build.sh
13+
14+
```
15+
16+
## Build a docker image from root
17+
18+
``` shell
19+
./build-docker.sh
20+
```
21+
22+
## Run the image
23+
24+
``` shell
25+
docker run --rm --name lif_identity_mapper_api -p 8006:8006 lif-identity-mapper-api
26+
```
27+
28+
The OpenAPI specification of this FastAPI app can now be accessed at http://localhost:8006/docs#
29+
30+
# Example API Usage
31+
32+
## List
33+
34+
GET http://localhost:8006/organizations/Org1/persons/100075/mappings/
35+
36+
## Save
37+
38+
POST http://localhost:8006/organizations/Org1/persons/100075/mappings/
39+
with body:
40+
```json
41+
[
42+
{
43+
"lif_organization_id": "Org1",
44+
"lif_organization_person_id": "100075",
45+
"target_system_id": "Org2",
46+
"target_system_person_id_type": "SCHOOL_ASSIGNED_NUMBER",
47+
"target_system_person_id": "1234567"
48+
}
49+
]
50+
```
51+
52+
## Delete
53+
54+
DELETE http://localhost:8006/organizations/Org1/persons/100075/mappings/84d1f9c8-8cc8-11f0-976c-06ae7a452344
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# LIF Identity Mapper MariaDB
2+
3+
The **Identity Mapper MariaDB** project provides a docker-based MariaDB database for storing the identity mappings for the Identity Mapper.
4+
5+
# Example Usage
6+
7+
## Build a docker image from root
8+
9+
``` shell
10+
./build-docker.sh
11+
```
12+
13+
## Run the image
14+
15+
``` shell
16+
docker run --rm --name lif_identity_mapper_mariadb -p 3306:3306 lif-identity-mapper-mariadb
17+
```
18+
19+
# Connect to the Database
20+
21+
Use these connection parameters:
22+
23+
- host: localhost (or 127.0.0.1)
24+
- port: 3306
25+
- schema: lif
26+
- user: myuser (default) or value for MARIADB_USER environment variable
27+
- password: mypass (default) or value for MARIADB_PASSWORD environment variable

0 commit comments

Comments
 (0)