Skip to content

Commit 1e4d21b

Browse files
author
Dan Costello
committed
API link updates
1 parent 3d7c4ce commit 1e4d21b

File tree

22 files changed

+222
-205
lines changed

22 files changed

+222
-205
lines changed

content/docs/guides/(authorization)/Implement-AuthZ-in-3-steps/2-populate-the-graph.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ slug: "2-populate-the-graph"
44
excerpt: ""
55
hidden: false
66
metadata:
7-
image: []
8-
robots: "index"
7+
image: []
8+
robots: "index"
99
createdAt: "Thu Aug 03 2023 23:20:03 GMT+0000 (Coordinated Universal Time)"
1010
updatedAt: "Fri Aug 04 2023 18:42:07 GMT+0000 (Coordinated Universal Time)"
1111
---
@@ -15,12 +15,12 @@ import { Step, Steps } from "fumadocs-ui/components/steps";
1515
Once you have designed the structure of your model, it's time to build your database of <Glossary>object</Glossary>s and <Glossary>edge</Glossary>s in UserClouds. This can be done in two steps:
1616

1717
<Steps>
18-
<Step>Migrate over from a pre-existing identity system &nbsp;</Step>
19-
<Step>
20-
Implement UserClouds's APIs to [populate the graph with
21-
objects](/docs/reference/post_authz-objects) and
22-
[edges](/docs/reference/post_authz-edges) on an ongoing basis &nbsp;
23-
</Step>
18+
<Step>Migrate over from a pre-existing identity system &nbsp;</Step>
19+
<Step>
20+
Implement UserClouds's APIs to [populate the graph with
21+
objects](/docs/reference/authz/objects/post) and
22+
[edges](/docs/reference/authz/edges/post) on an ongoing basis &nbsp;
23+
</Step>
2424
</Steps>
2525

2626
If you are building your product or user base from scratch, you will skip straight to step 2.
@@ -31,6 +31,6 @@ UserClouds supports mass migration from pre-existing AuthN and AuthZ systems, li
3131

3232
## 2. Implement Write APIs in your software
3333

34-
Maintaining your authorization graph is simple with UserClouds's CRUD APIs. These allow you to [create Objects](/docs/reference/post_authz-objects) and [Edges](/docs/reference/post_authz-edges) programmatically in your application.
34+
Maintaining your authorization graph is simple with UserClouds's CRUD APIs. These allow you to [create Objects](/docs/reference/authz/objects/post) and [Edges](/docs/reference/authz/edges/post) programmatically in your application.
3535

36-
For more information on the APIs for Authorization, check out our [Authorization API Docs](/docs/reference/post_authz-objects).
36+
For more information on the APIs for Authorization, check out our [Authorization API Docs](/docs/reference/authz/objects/post).

content/docs/guides/(authorization)/Implement-AuthZ-in-3-steps/3-run-permissions-checks.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ hidden: false
66
createdAt: "Thu Aug 03 2023 23:22:50 GMT+0000 (Coordinated Universal Time)"
77
updatedAt: "Thu Jun 06 2024 17:25:04 GMT+0000 (Coordinated Universal Time)"
88
---
9-
Once you have populated UserClouds with your types, objects and edges, UserClouds is ready to be the source-of-truth for permissions. To implement <Glossary>permission</Glossary>s in your system, all you need to do is add UserClouds's [Permission Check APIs](/docs/reference/get_authz-checkattribute) in the appropriate places in your software.
9+
10+
Once you have populated UserClouds with your types, objects and edges, UserClouds is ready to be the source-of-truth for permissions. To implement <Glossary>permission</Glossary>s in your system, all you need to do is add UserClouds's [Permission Check APIs](/docs/reference/authz/checkattribute) in the appropriate places in your software.
1011

1112
- **CheckAttribute** answers the question: does user X have permission Y on object Z?
1213
- **ListAttributes** receives a source object ID and target object ID. It returns a list of attributes that the source object has on the target object.
1314
- **ListObjectsReachableWithAttribute** receives an attribute and a source object ID. It returns a list of objects reachable with that attribute.
1415

15-
For more information, check out our [Authorization API Docs](/docs/reference/get_authz-checkattribute).
16+
For more information, check out our [Authorization API Docs](/docs/reference/authz/checkattribute).

content/docs/guides/(data-access)/definitions/access-policies.mdx

Lines changed: 57 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ hidden: false
66
createdAt: "Thu Aug 03 2023 19:17:40 GMT+0000 (Coordinated Universal Time)"
77
updatedAt: "Tue Sep 10 2024 18:36:12 GMT+0000 (Coordinated Universal Time)"
88
---
9+
910
Access Policies control the circumstances under which data can be retrieved or edited. These policies are functions that receive contextual data and return true or false to determine whether access is allowed or denied. The context is generated from the server and can be combined with additional context sent from the client.
1011

1112
Access Policies are executed in three places in UserClouds:
@@ -43,7 +44,7 @@ Access policies evaluate claims and key/value pairs in the provided context. The
4344
- **context.server.purpose_names**: the purposes specified on an accessor to which this access policy is attached (does not apply in all cases)
4445
- **context.server.ip_address**: the IP address of the user or system initiating the request
4546
- **context.client**: This context contains key/value pairs specified in the request comments by the client and is not considered trusted. It includes data such as user-specified parameters that are not verified by the server.
46-
- **context.user**: Information about data for the user whose data is row being accessed.
47+
- **context.user**: Information about data for the user whose data is row being accessed.
4748
evaluated by the access policy
4849
- **context.query**: Specific query parameters relevant to the request.
4950
- **context.row_data**: Specific Column data for the user row data values related to being evaluated by the request.
@@ -57,19 +58,19 @@ Access Policies are composed from Access Policy Templates. Templates are paramet
5758
### Template function
5859

5960
```javascript
60-
function getAge(DOB) {
61-
const today = new Date();
62-
const birthDate = new Date(DOB);
63-
let age = today.getFullYear() - birthDate.getFullYear();
64-
const m = today.getMonth() - birthDate.getMonth();
65-
if (m \< 0 || (m === 0 && today.getDate() \< birthDate.getDate())) {
66-
age--;
67-
}
68-
return age;
61+
function getAge(DOB) {
62+
const today = new Date();
63+
const birthDate = new Date(DOB);
64+
let age = today.getFullYear() - birthDate.getFullYear();
65+
const m = today.getMonth() - birthDate.getMonth();
66+
if (m \< 0 || (m === 0 && today.getDate() \< birthDate.getDate())) {
67+
age--;
68+
}
69+
return age;
6970
}
7071

71-
function policy(context, params) {
72-
return getAge(context.user[params.column_name]) >= params.expected_years_old;
72+
function policy(context, params) {
73+
return getAge(context.user[params.column_name]) >= params.expected_years_old;
7374
}
7475
```
7576

@@ -87,10 +88,10 @@ Here is an example of how you can create a policy to check if the country claim
8788
### Template function
8889

8990
```javascript
90-
function policy(context, params) {
91-
const country = context.server.claims.country;
92-
const specifiedCountry = params.specified_country;
93-
return country === specifiedCountry;
91+
function policy(context, params) {
92+
const country = context.server.claims.country;
93+
const specifiedCountry = params.specified_country;
94+
return country === specifiedCountry;
9495
}
9596
```
9697

@@ -108,10 +109,10 @@ If the country information is not in the JWT but in the client context, the poli
108109
### Template function
109110

110111
```javascript
111-
function policy(context, params) {
112-
const country = context.client.country;
113-
const specifiedCountry = params.specified_country;
114-
return country === specifiedCountry;
112+
function policy(context, params) {
113+
const country = context.client.country;
114+
const specifiedCountry = params.specified_country;
115+
return country === specifiedCountry;
115116
}
116117
```
117118

@@ -139,13 +140,16 @@ The built-in `networkRequest` function allows you to reach external services via
139140
This example shows how to make a network request to verify the user's country based on their IP address. Note that the interface for `networkRequest` is synchronous, as in the example below:
140141

141142
```javascript
142-
function policy(context, params) {
143-
let countryCode = null;
144-
const resp = networkRequest({url: `https://api.iplocation.net/?ip=${context.server.ip_address}`, method: 'GET' });
145-
if (resp) {
146-
countryCode = JSON.parse(resp).country_code2;
147-
}
148-
return countryCode === "US";
143+
function policy(context, params) {
144+
let countryCode = null;
145+
const resp = networkRequest({
146+
url: `https://api.iplocation.net/?ip=${context.server.ip_address}`,
147+
method: "GET",
148+
});
149+
if (resp) {
150+
countryCode = JSON.parse(resp).country_code2;
151+
}
152+
return countryCode === "US";
149153
}
150154
```
151155

@@ -156,51 +160,51 @@ This example shows how to verify an employee is active in a private employee dir
156160
#### Template Function
157161

158162
```javascript
159-
function policy(context, params) {
163+
function policy(context, params) {
160164
let isActiveEmployee = false;
161165

162-
const resp = networkRequest({
163-
url: `https://api.company.com/employees/${context.user.id}/status`,
164-
method: 'GET',
165-
headers: {
166-
'Authorization': 'Basic ' + btoa('username:password'),
167-
'Content-Type': 'application/json'
168-
}
166+
const resp = networkRequest({
167+
url: `https://api.company.com/employees/${context.user.id}/status`,
168+
method: "GET",
169+
headers: {
170+
Authorization: "Basic " + btoa("username:password"),
171+
"Content-Type": "application/json",
172+
},
169173
});
170174

171-
if (resp) {
172-
const employeeData = JSON.parse(resp);
173-
isActiveEmployee = employeeData.status === "active";
175+
if (resp) {
176+
const employeeData = JSON.parse(resp);
177+
isActiveEmployee = employeeData.status === "active";
174178
}
175179

176-
return isActiveEmployee;
180+
return isActiveEmployee;
177181
}
178182
```
179183

180184
#### Parameters to instantiate a policy
181185

182186
```javascript
183187
// Example Policy Parameters (not specified in the template function)
184-
const params = {}; // No specific parameters needed for this example
188+
const params = {}; // No specific parameters needed for this example
185189
```
186190

187191
## checkAttribute
188192

189-
The `checkAttribute` function runs a permission check against the UserClouds authorization graph. If you are using UserClouds for authorization as a service, this can verify if a user has the necessary permissions. In short, it asks whether a given object (usually a user) has an attribute (e.g. "can-read" or "is-admin") on another object (which could be just about any entity in your system). You can read more about this in the [Authorization Documentation](/docs/reference/get_authz-checkattribute).
193+
The `checkAttribute` function runs a permission check against the UserClouds authorization graph. If you are using UserClouds for authorization as a service, this can verify if a user has the necessary permissions. In short, it asks whether a given object (usually a user) has an attribute (e.g. "can-read" or "is-admin") on another object (which could be just about any entity in your system). You can read more about this in the [Authorization Documentation](/docs/reference/authz/checkattribute).
190194

191195
### Example
192196

193197
**Use Case: Does the calling user have view permission on the target user?**
194198

195199
```javascript
196200
function policy(context) {
197-
const callingUserId = context.user.id;
198-
const targetUserId = context.params.targetUserId;
199-
const attribute = "viewPermission";
200-
if (!callingUserId || !targetUserId || !attribute) {
201-
return false;
202-
}
203-
return checkAttribute(callingUserId, targetUserId, attribute);
201+
const callingUserId = context.user.id;
202+
const targetUserId = context.params.targetUserId;
203+
const attribute = "viewPermission";
204+
if (!callingUserId || !targetUserId || !attribute) {
205+
return false;
206+
}
207+
return checkAttribute(callingUserId, targetUserId, attribute);
204208
}
205209
```
206210

@@ -216,19 +220,19 @@ function policy(context) {
216220
### Example
217221

218222
```javascript
219-
function policy(context, params) {
223+
function policy(context, params) {
220224
let { phone_numer } = params; // e.g. "+12065551234"
221-
const country = getCountryNameForPhoneNumber(phone_number);
222-
223-
return country.alpha_2 === "US";
225+
const country = getCountryNameForPhoneNumber(phone_number);
226+
227+
return country.alpha_2 === "US";
224228
}
225229
```
226230

227231
# Managing access policies
228232

229233
UserClouds has several built-in access policies for common use cases, like role-based and time-based expiration of data. However you can also create custom policies, in two ways:
230234

231-
- Call the [CreateAccessPolicy API](/docs/reference/post_tokenizer-policies-access)
235+
- Call the [CreateAccessPolicy API](/docs/reference/tokenizer/policies/access/post)
232236
- Compose a new policy from existing policies and parametrizable templates in the UserClouds Console
233237

234238
To learn more about creating access policies, see our How to Guide on Creating Access Policies.

content/docs/guides/(data-access)/definitions/accessors-read-apis.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ hidden: false
66
createdAt: "Thu Aug 03 2023 19:30:50 GMT+0000 (Coordinated Universal Time)"
77
updatedAt: "Tue Sep 10 2024 16:09:30 GMT+0000 (Coordinated Universal Time)"
88
---
9+
910
Accessors are configurable APIs that allow a client to retrieve data from the user store. Accessors are intended to be use-case specific. For example, you might configure two separate accessors `GetEmailForMarketing` and `GetEmailForAuthentication`. They enforce data usage policies and minimize outbound data from the store for their given use case.
1011

1112
As an example of data minimization, you might configure an accessor called `GetPhoneCountryCodeForAnalytics` that returns the country code of a user's phone number when called, instead of the raw phone number. This reduces the sensitivity of the data outside your store, minimizing your surface area for an attack and simplifying compliance.
@@ -25,7 +26,7 @@ Accessors can be configured to access either live or soft-deleted data. Soft-del
2526
2. **Column-default access policies**: Column default policies for all columns accessed by the accessor are applied, unless overridden. Learn more [here](/docs/protect-a-column-with-defaults).
2627
3. **Accessor-specific access policy composition**: Applied in addition to the above policies.
2728
4. User data is further filtered according to whether the users have consented to the accessor's data processing purpose.
28-
5. For records where access is granted, the accessor's <Glossary>data transformer</Glossary>s transform each column of the outbound data, minimizing the data for the given use case. If no transformer is specified for a given column, the column's default transformer is used. Learn more [here](/docs/protect-a-column-with-defaults).
29+
5. For records where access is granted, the accessor's <Glossary>data transformer</Glossary>s transform each column of the outbound data, minimizing the data for the given use case. If no transformer is specified for a given column, the column's default transformer is used. Learn more [here](/docs/protect-a-column-with-defaults).
2930

3031
## Structure of an Accessor
3132

@@ -42,4 +43,4 @@ At creation time, each accessor is associated with a user record <Glossary>selec
4243
For more info on accessors, see:
4344

4445
- [Creating an accessor](/docs/create-an-accessor)
45-
- [Executing an accessor](/docs/reference/post_userstore-api-accessors)
46+
- [Executing an accessor](/docs/reference/userstore/api/accessors)

content/docs/guides/(data-access)/definitions/transformers.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ hidden: false
66
createdAt: "Thu Aug 03 2023 19:18:00 GMT+0000 (Coordinated Universal Time)"
77
updatedAt: "Tue Sep 10 2024 18:37:33 GMT+0000 (Coordinated Universal Time)"
88
---
9+
910
Transformers are re-usable functions that manipulate data in UserClouds. They allow you to minimize the data that you pass or store for each use case. This is key for complying with the data minimization principles in regulations like GDPR.
1011

1112
![Transformers can be arbitrarily smart about how they obfuscate data.](/assets/images/user-data.webp)
1213

13-
14-
Transformers allow you to retain select structure and information from the raw data for different use cases, like sorting alphabetically, zip code analysis or simply flowing through your systems without triggering validation errors. For example, if you want to conduct analysis assessing the differences in behavior between children and adults, you may use a data transformer to pass a string indicating `child` or `adult`, instead of pulling raw Date of Birth from the store.
14+
Transformers allow you to retain select structure and information from the raw data for different use cases, like sorting alphabetically, zip code analysis or simply flowing through your systems without triggering validation errors. For example, if you want to conduct analysis assessing the differences in behavior between children and adults, you may use a data transformer to pass a string indicating `child` or `adult`, instead of pulling raw Date of Birth from the store.
1515

1616
Transformers are executed in two places:
1717

@@ -24,7 +24,7 @@ In addition, column default transformers provide a way to consistently apply tra
2424

2525
## Examples of Transformers
2626

27-
Transformers range from the simplest UUID function that replaces any given data with a unique identifier, to custom-written Javascript that runs in a carefully-controlled sandbox.
27+
Transformers range from the simplest UUID function that replaces any given data with a unique identifier, to custom-written Javascript that runs in a carefully-controlled sandbox.
2828

2929
![One simple transformer receives raw data, and creates a UUID token.](/assets/images/uuid-input.webp)
3030

@@ -65,7 +65,7 @@ A transformer consists of:
6565

6666
UserClouds has several off-the-shelf transformers for common use cases, like masking emails, national ID numbers and credit card details. However you can also create custom functions, in three ways:
6767

68-
1. Call the [CreateTransformer API](/docs/reference/post_tokenizer-policies-transformation)
68+
1. Call the [CreateTransformer API](/docs/reference/tokenizer/policies/transformation/post)
6969
2. Create functions in the UserClouds UI
7070

7171
For more info on creating transformers, see our How To Guide on Creating a Transformer.

content/docs/guides/(data-access)/how-to-guides/apply-global-protection-policies.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ hidden: false
66
createdAt: "Tue Jul 30 2024 16:39:16 GMT+0000 (Coordinated Universal Time)"
77
updatedAt: "Tue Jul 30 2024 16:40:29 GMT+0000 (Coordinated Universal Time)"
88
---
9+
910
This guide explains how to update and use global baseline policies.
1011

1112
Global baseline policies are access policies that get applied by default to all accessors (or mutators). These policies ensure a consistent security baseline across all data operations. Global baseline policies cannot be overridden for individual accessors or mutators.
@@ -21,7 +22,7 @@ Global baseline policies are access policies that get applied by default to all
2122

2223
## Setting Global Baseline Policies
2324

24-
Global baseline policies are provisioned during tenant creation. They can be found and edited on the access policies page. These policies can be composed of other policies and templates. Additionally, they can be edited via the Update Access Policy API. For more details on editing global baseline policies, see the [API reference](/docs/reference/put_tokenizer-policies-access-id).
25+
Global baseline policies are provisioned during tenant creation. They can be found and edited on the access policies page. These policies can be composed of other policies and templates. Additionally, they can be edited via the Update Access Policy API. For more details on editing global baseline policies, see the [API reference](/docs/reference/tokenizer/policies/access/get).
2526

2627
## Combining Policies
2728

0 commit comments

Comments
 (0)