Notice: This file is automatically generated by generate_auth_docs.ts.
Below you will find various diagrams that illustrates how to API restricts access to data.
This project is hosted behind an Azure API gateway that determines what data
can be returned by a given client via subscriptions. Each subscription is tied to a
product which modifies the x-auth-group
header sent to this service. The
available values and filters are defined in the auth.ts
file.
// auth.ts
{
"nml-lab": {},
"csc": {
"sites": {
"where": [
"healthReg",
"CSC"
]
}
},
"bccdc": {
"sites": {
"where": [
"healthReg",
"Vancouver"
]
},
"datasets": {
"whereIn": [
"dataID",
[
"BCCDC",
"NML-WWPCR"
]
]
}
},
"hnj": {
"sites": {
"whereIn": [
"healthReg",
[
"Whitehorse",
"Haines Junction"
]
]
},
"datasets": {
"whereIn": [
"dataID",
[
"NML-WWPCR",
"NML-WWGX"
]
]
}
}
}
The process described above is illustrated below using a flow chart.
When the GraphQL server receives a request to access data in a particular table, the foreign key relationships of the table are examined, and a query plan is produced that enforces the rules declared in auth.ts.
The diagrams below illustrates what the resulting query plan is for each group and table combination.