Skip to content

Commit

Permalink
feat: add passwordProtection property to Token
Browse files Browse the repository at this point in the history
  • Loading branch information
britsta committed Dec 17, 2024
1 parent bb8df70 commit 202be88
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions _docs_integrate/data-model-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,28 @@ Tokens can be used to save arbitrary structured data on the Backbone, which is e

A Token has the following properties:

| Name | Type | Description | Remarks |
| ------------------ | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| id | `string` | {% include descr_id class="Token" prefix="TOK" %} |
| createdBy | `string` | {% include descr_createdBy class="Token" %} | |
| createdByDevice | `string` | {% include descr_createdByDevice class="Token" %} | |
| content | `unknown` | The content of the Token. You can add whatever you want here. | will be encrypted before sent to the Backbone |
| createdAt | `string` | {% include descr_createdAt class="Token" %} | |
| expiresAt | `string` | {% include descr_expiresAt class="Token" %} | |
| forIdentity | `string` \| `undefined` | Can be set to an enmeshed address. If set, then only the [Identity]({% link _docs_integrate/data-model-overview.md %}#identity) with that `address` can retrieve the Token from the Backbone. |
| truncatedReference | `string` | {% include descr_truncatedReference class="Token" %} | saved only locally |
| isEphemeral | `boolean` | If set to `true` the Token will not be cached in the database and only displayed once. You will not be able to fetch this Token unless you remember its truncatedReference. |
| Name | Type | Description | Remarks |
| ------------------ | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| id | `string` | {% include descr_id class="Token" prefix="TOK" %} |
| createdBy | `string` | {% include descr_createdBy class="Token" %} | |
| createdByDevice | `string` | {% include descr_createdByDevice class="Token" %} | |
| content | `unknown` | The content of the Token. You can add whatever you want here. | will be encrypted before sent to the Backbone |
| createdAt | `string` | {% include descr_createdAt class="Token" %} | |
| expiresAt | `string` | {% include descr_expiresAt class="Token" %} | |
| forIdentity | `string` \| `undefined` | Can be set to an enmeshed address. If set, then only the [Identity]({% link _docs_integrate/data-model-overview.md %}#identity) with that `address` can retrieve the Token from the Backbone. |
| passwordProtection | [`object for password protection of Token`](#object-for-password-protection-of-token) \| `undefined` | Information about whether the Token is protected by a password or not. | |
| truncatedReference | `string` | {% include descr_truncatedReference class="Token" %} | saved only locally |
| isEphemeral | `boolean` | If set to `true` the Token will not be cached in the database and only displayed once. You will not be able to fetch this Token unless you remember its truncatedReference. |

### Object for Password Protection of Token

A [Token](#token) can be protected by a password to ensure that it is protected from unauthorized access.
Information about the password protection of a Token is recorded within its optional `passwordProtection` property.

| Name | Type | Description | Remarks |
| ------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| password | `string` | The password of the Token. | |
| passwordIsPin | `true` \| `undefined` | If the password of the Token consists of 4 to 16 digits, the value of the `passwordIsPin` property can be set to `true`. In this case, the password is interpreted as a pin and a corresponding input field is displayed in the UI of the App when the pin needs to be entered. However, if the value is `undefined`, a regular input field for entering the password is displayed regardless of whether the password could also be interpreted as a pin. | |

## RelationshipTemplate

Expand All @@ -81,10 +92,10 @@ A RelationshipTemplate serves two purposes:
| expiresAt | `string` | {% include descr_expiresAt class="RelationshipTemplate" %} | will be encrypted before sent to the Backbone |
| maxNumberOfAllocations | `number` \| `undefined` | Can be set to limit the number of allocations of this RelationshipTemplate. A RelationshipTemplate is allocated by another Identity when it is first retrieved by it from the Backbone. After this value is reached, the Backbone rejects each request of any new Identity that wants to retrieve it. Identities that already allocated it will still be able to retrieve it. | |
| forIdentity | `string` \| `undefined` | Can be set to an enmeshed address. If set, then only the [Identity]({% link _docs_integrate/data-model-overview.md %}#identity) with that `address` can retrieve the RelationshipTemplate from the Backbone. | |
| passwordProtection | [`PasswordProtection`](#passwordprotection) \| `undefined` | Information about whether the RelationshipTemplate is protected by a password or not. | |
| passwordProtection | [`object for password protection of RelationshipTemplate`](#object-for-password-protection-of-relationshiptemplate) \| `undefined` | Information about whether the RelationshipTemplate is protected by a password or not. | |
| truncatedReference | `string` | {% include descr_truncatedReference class="RelationshipTemplate" %} | saved only locally |

### PasswordProtection
### Object for Password Protection of RelationshipTemplate

A [RelationshipTemplate can be protected by a password]({% link _docs_integrate/establish-relationships.md %}#password-protection-of-a-relationshiptemplate) to ensure that it is protected from unauthorized access.
Indeed, in order for a peer to [establish a Relationship]({% link _docs_integrate/establish-relationships.md %}) to the creator of the password protected RelationshipTemplate, it must enter the correct password when [loading the RelationshipTemplate]({% link _docs_use-cases/use-case-transport-load-relationshiptemplate-created-by-others.md %}).
Expand Down

0 comments on commit 202be88

Please sign in to comment.