Skip to content

Commit

Permalink
Merge pull request #202 from NillionNetwork/psofiterol/sv-updates
Browse files Browse the repository at this point in the history
feat: add secretvaults examples, slightly reorganize sidebars + api
  • Loading branch information
psofiterol authored Feb 14, 2025
2 parents bf22deb + a782ec9 commit 3984d6b
Show file tree
Hide file tree
Showing 14 changed files with 1,846 additions and 1,053 deletions.
2 changes: 1 addition & 1 deletion docs/api/nildb/list-the-organizations-queries.api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: list-the-organizations-queries
title: "List the organization's queries"
description: "List the organization's queries"
sidebar_label: 'List'
sidebar_label: 'List Queries'
hide_title: true
hide_table_of_contents: true
api: eJy1V21v2zYQ/iuEvqwFHDvxsmL1t3TOhuwF7dCk+7AaAS2ebSYUyZJUYtfwf9/dSbJly6s3dPtiSSTvePfccy9eZxHyMui0ykZ/rrOH54TPyWbSy5KcR3zPfi8hrDJcCBC9sxFwdZ0Nz8/poSDmQfuknc1G2e0ChMxzV9r0TRSfUFDj6V6WO5vAJhKQ3hudSxIYPESSWmcxX0Ah6S2tPKAeN32APGV05adSB1Bkh5JJkhk+OA8h6coOXt1JyhDkCgV1goL3pTFvZ+zaoe59Pfdadf25EqXVTxAialnRO7oktEJX9ExDEDMXREKf6bY+qqyviCloO8dv3C8kup2VJarHfZ0MHbi7uxlnm152nweQCVTLga4seghnSReAi124WQN+CjoRkyx8nzWXXn2lZiNjEpWaPeWb/bDcs2dbT1pXT3YOj11eFgjbGxkBzftyoK1ki9yzhYDPmh297EkGLacG49VhAYscC1+kKCELrcIAEiFXola/j8qmue8opxXkaHyQRkdQbQK8GN+MXwo3YxagAlQlXJhLqz9zVI5wApYII4OitBpZbUYJobWQ6N2gzAWUNkD52aTl3Cxfz5aXr781w/A9zF4FZYIsL1VUNieTd4nTtRnDhfCgPdUhkTtjEGuiSkVbXWXoCjNVzucB5hWPvPZgtO1CdEjnTTsiR01o1DfBFQELAzJJ7OR6HSZIpTTpkObdXoidhb9J5DZ3eG+fzR2yVPLdvABbFqRju4DfU6bg1DkDkqJJzM4mm4N8OdRFOdJQn8vnh9rhk9w/Yn9TzP61H1UtPG1sq1qeNO3/AHPTgeuKLN9hNqEDW15209xumQZLbGYNjek0pu4MH0pIZLkVDAnla+Vhi3+dxrEPBRk5ObCSF9n4y2PN8AOWC1XlFOYbopZDjJSQEIIL/1lbZCdqld3oxK9oAJyqdW3jC7i3B0U+JMfL1ingflMb0AHhV41NBHVU8thEopzDl2CXdrWf5luWnurgOdpylN31rcfSlKjVIt81WZk1Mb3ouvObrkKIvmj7RAEWP/9xy/l+xG9uCq1usDcTFZAWDiOYzYF9kWmBHwPp9eDpYrA7hx2MJhCGpAwGzyxS8nE0GGC/UNMzBYXr162jj23k2YXHjLjazHXviUYVRDzdbVEgPU1/pe8pyFBlKL/82LCEPDz070pg5zvDHWyxzAd09fr98LtXvwhp5g7vXRTcZ2SJW1j1cxoJBPZh77RNsf/RkrCXK+OkEkWJcGmbm1LB6KM9E1qmkbiJsaTUTbv5g/Zg6Ufieul1OJh8xIsAuStw0FCgXtJRWaqRuJUBMWaunujkfHOMI/GDwZGBZthT5zn02s4c41rTCKMxfiOu3t3Q0IKxqyA77w/7Q+KjdzEV0u7mln/AluMVPMEyDbyR2pJeZse6ZhKWf6/p/gv8afQgKxZ4Oe2u11Ocxe6C2WxomQsoTf67ps7/A1AApKK5COn3CCsKfZ6DTzyPmZJz+LB2Efu29P7pmthDNGgZfkC1dr5jAWjpRjP5xK17BIum9mojEn1zZ9j8BS6ua/4=
Expand Down
8 changes: 7 additions & 1 deletion docs/api/nildb/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const sidebar: SidebarsConfig = {
},
{
type: "category",
label: "Data",
label: "Schema",
items: [
{
type: "doc",
Expand All @@ -40,6 +40,12 @@ const sidebar: SidebarsConfig = {
label: "Retrieve data from the specified schema collection that matches the provided filter",
className: "api-method post",
},
],
},
{
type: "category",
label: "Data",
items: [
{
type: "doc",
id: "api/nildb/update-documents-within-a-schema-collection-that-match-the-given-filter",
Expand Down
6 changes: 3 additions & 3 deletions docs/build/secret-vault-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import IframeVideo from '@site/src/components/IframeVideo/index';
<IframeVideo videoSrc="https://www.loom.com/embed/ee391ce583ab442db71942565b068e61?sid=c7dd28bb-8920-4451-a88e-6de83a21655f"/>
<br/>
:::info
This guide uses JavaScript (Node.js) and the [nillion-sv-wrappers](https://github.com/NillionNetwork/nillion-sv-wrappers) package for simplicity, but SecretVault can be integrated with any language [using the nilDB APIs directly](/build/secret-vault#how-to-use-secretvault).
This guide uses JavaScript (Node.js) and the JS [nillion-sv-wrappers](https://github.com/NillionNetwork/secretvault-js) package for simplicity, but SecretVault can be integrated with any language [using the nilDB APIs directly](/build/secret-vault#how-to-use-secretvault). The wrapper package is also available in [Python](https://github.com/NillionNetwork/secretvaults-py) via [PyPi](https://pypi.org/project/secretvaults/).
:::

## Project Overview

This quickstart will guide you through:

1. Setting up a Node.js project from scratch and installing [nillion-sv-wrappers](https://github.com/NillionNetwork/nillion-sv-wrappers)
1. Setting up a Node.js project from scratch and installing the JS [nillion-sv-wrappers](https://github.com/NillionNetwork/secretvault-js))
2. Configuring SecretVault org access
3. Creating a SecretVault Collection by uploading a schema
4. Writing and reading encrypted survey data to the collection
Expand Down Expand Up @@ -57,7 +57,7 @@ npm i nillion-sv-wrappers
```

:::info
[nillion-sv-wrappers](https://github.com/NillionNetwork/nillion-sv-wrappers) is a JavaScript npm package with wrappers for simplifying usage of Nillion's Secret Vault and the nilQL encryption and decryption library.
[nillion-sv-wrappers](https://github.com/NillionNetwork/secretvault-js) is a JavaScript npm package with wrappers for simplifying usage of Nillion's Secret Vault and the nilQL encryption and decryption library. A [Python](https://github.com/NillionNetwork/secretvaults-py) version is also available via [PyPi](https://pypi.org/project/secretvaults/).
:::

### 2. Set your SecretVault Organization Config
Expand Down
2 changes: 1 addition & 1 deletion docs/build/secret-vault.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This approach offers stronger security than traditional databases where all data

## How to use SecretVault

Interact with [nilDB APIs](/api/overview) or the [nillion-sv-wrappers](https://github.com/NillionNetwork/nillion-sv-wrappers) helper package shown in the [Quickstart](/build/secret-vault-quickstart) to use SecretVault. First complete setup by registering an organization and defining the structure of your data collections. After setup, you can securely store, retrieve, and query data from SecretVault.
Interact with [nilDB APIs](/api/overview) or the JS [nillion-sv-wrappers](https://github.com/NillionNetwork/secretvault-js) helper package shown in the [Quickstart](/build/secret-vault-quickstart) to use SecretVault (also available in [Python](https://github.com/NillionNetwork/secretvaults-py)). First complete setup by registering an organization and defining the structure of your data collections. After setup, you can securely store, retrieve, and query data from SecretVault.

### 1. Register an Organization

Expand Down
2 changes: 1 addition & 1 deletion docs/build/secretVault-secretDataAnalytics/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## How to use SecretVault APIs

Interact with [nilDB APIs](/api/overview) or the [nillion-sv-wrappers](https://github.com/NillionNetwork/nillion-sv-wrappers) helper package shown in the [Quickstart](/build/secret-vault-quickstart) to use SecretVault. First complete setup by registering an organization and defining the structure of your data collections. After setup, you can securely store, retrieve, and query data from SecretVault.
Interact with [nilDB APIs](/api/overview) or the JS [nillion-sv-wrappers](https://github.com/NillionNetwork/secretvault-js) helper package shown in the [Quickstart](/build/secret-vault-quickstart) to use SecretVault (also available in [Python](https://github.com/NillionNetwork/secretvaults-py)). First complete setup by registering an organization and defining the structure of your data collections. After setup, you can securely store, retrieve, and query data from SecretVault.

### 1. Register an Organization

Expand Down
31 changes: 27 additions & 4 deletions docs/build/secretVault-secretDataAnalytics/create-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,35 @@ https://github.com/NillionNetwork/blind-module-examples/blob/main/nildb/secretva
```

</TabItem>
<TabItem value="typescript" label="TypeScript">

```TypeScript
// coming soon
<TabItem value="wrapper-py" label="Python (with wrapper)">

### Install secretvaults

```bash
pip install secretvaults
```
</TabItem>

### Run the query_create script

```bash
python3 query_create.py
```

<Tabs>
<TabItem value="createSchema" label="query_create.py">
```javascript reference showGithubLink
https://github.com/NillionNetwork/secretvaults-py/blob/main/examples/query_create.py#L2-L41
```
</TabItem>
<TabItem value="orgConfig" label="org_config.py">
```javascript reference showGithubLink
https://github.com/NillionNetwork/secretvaults-py/blob/main/examples/org_config.py
```
</TabItem>
</Tabs>

</TabItem>
</Tabs>

</details>
Expand Down
29 changes: 29 additions & 0 deletions docs/build/secretVault-secretDataAnalytics/create-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,35 @@ https://github.com/NillionNetwork/nillion-sv-wrappers/blob/main/examples/orgConf

</TabItem>

<TabItem value="wrapper-py" label="Python (with wrapper)">

### Install secretvaults

```bash
pip install secretvaults
```

### Run the schema_create script

```bash
python3 schema_create.py
```

<Tabs>
<TabItem value="createSchema" label="createSchema.js">
```javascript reference showGithubLink
https://github.com/NillionNetwork/secretvaults-py/blob/main/examples/schema_create.py
```
</TabItem>
<TabItem value="orgConfig" label="orgConfig.js">
```javascript reference showGithubLink
https://github.com/NillionNetwork/secretvaults-py/blob/main/examples/org_config.py
```
</TabItem>
</Tabs>

</TabItem>

</Tabs>
</details>

Expand Down
29 changes: 29 additions & 0 deletions docs/build/secretVault-secretDataAnalytics/generate-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,36 @@ https://github.com/NillionNetwork/nillion-sv-wrappers/blob/main/examples/generat
https://github.com/NillionNetwork/nillion-sv-wrappers/blob/main/examples/orgConfig.js
```
</TabItem>

</Tabs>

</TabItem>
<TabItem value="wrapper-py" label="Python (with wrapper)">

### Install secretvaults

```bash
pip install secretvaults
```

### Run the generate_api_tokens script

```bash
python3 generate_api_tokens.py
```

<Tabs>
<TabItem value="createSchema" label="generate_api_tokens.js">
```javascript reference showGithubLink
https://github.com/NillionNetwork/secretvaults-py/blob/main/examples/generate_api_tokens.py
```
</TabItem>
<TabItem value="orgConfig" label="orgConfig.js">
```javascript reference showGithubLink
https://github.com/NillionNetwork/secretvaults-py/blob/main/examples/org_config.py
```
</TabItem>
</Tabs>

</TabItem>
</Tabs>
28 changes: 28 additions & 0 deletions docs/build/secretVault-secretDataAnalytics/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,33 @@ https://github.com/NillionNetwork/blind-module-examples/blob/main/nildb/secretva
```

</TabItem>
<TabItem value="wrapper-py" label="Python (with wrapper)">

### Install secretvaults

```bash
pip install secretvaults
```

### Run the query_execute script

```bash
python3 query_execute.py
```

<Tabs>
<TabItem value="createSchema" label="query_execute.py">
```javascript reference showGithubLink
https://github.com/NillionNetwork/secretvaults-py/blob/main/examples/query_execute.py
```
</TabItem>
<TabItem value="orgConfig" label="org_config.py">
```javascript reference showGithubLink
https://github.com/NillionNetwork/secretvaults-py/blob/main/examples/org_config.py
```
</TabItem>
</Tabs>

</TabItem>
</Tabs>
</details>
27 changes: 27 additions & 0 deletions docs/build/secretVault-secretDataAnalytics/retrieve.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,33 @@ https://github.com/NillionNetwork/nillion-sv-wrappers/blob/main/examples/orgConf
</TabItem>
</Tabs>
</TabItem>
<TabItem value="wrapper-py" label="Python (with wrapper)">

### Install secretvaults

```bash
pip install secretvaults
```

### Run the data_create_read script

```bash
python3 data_create_read.py
```

<Tabs>
<TabItem value="readWriteSv" label="readWriteSv.js">
```javascript reference showGithubLink
https://github.com/NillionNetwork/secretvaults-py/blob/main/examples/data_create_read.py
```
</TabItem>
<TabItem value="orgConfig" label="orgConfig.js">
```javascript reference showGithubLink
https://github.com/NillionNetwork/secretvaults-py/blob/main/examples/org_config.py
```
</TabItem>
</Tabs>
</TabItem>
</Tabs>

</details>
Expand Down
28 changes: 28 additions & 0 deletions docs/build/secretVault-secretDataAnalytics/upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,34 @@ https://github.com/NillionNetwork/nillion-sv-wrappers/blob/main/examples/orgConf
</TabItem>
</Tabs>
</TabItem>
<TabItem value="wrapper-py" label="Python (with wrapper)">

### Install secretvaults

```bash
pip install secretvaults
```

### Run the data_create_read script

```bash
python3 data_create_read.py
```

<Tabs>
<TabItem value="readWriteSv" label="readWriteSv.js">
```javascript reference showGithubLink
https://github.com/NillionNetwork/secretvaults-py/blob/main/examples/data_create_read.py
```
</TabItem>
<TabItem value="orgConfig" label="orgConfig.js">
```javascript reference showGithubLink
https://github.com/NillionNetwork/secretvaults-py/blob/main/examples/org_config.py
```
</TabItem>
</Tabs>
</TabItem>

</Tabs>

</details>
14 changes: 10 additions & 4 deletions sidebar-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@ module.exports = [
},
{
type: 'category',
label: 'Data',
label: 'Schemas',
items: [
'api/nildb/list-the-organizations-schemas', // List Schemas
'api/nildb/add-a-new-schema', // Add Schema /
'api/nildb/delete-a-schema', // Delete Schema /
'api/nildb/upload-data-to-the-specified-schema-collection', // Upload /
'api/nildb/add-a-new-schema', // Add Schema
'api/nildb/delete-a-schema', // Delete Schema
],
},
{
type: 'category',
label: 'Data',
items: [
'api/nildb/upload-data-to-the-specified-schema-collection', // Upload
'api/nildb/retrieve-data-from-the-specified-schema-collection-that-matches-the-provided-filter', // Read
'api/nildb/retrieve-recently-added-documents-from-a-schema-collection', // Tail
'api/nildb/update-documents-within-a-schema-collection-that-match-the-given-filter', // Update
Expand Down
14 changes: 10 additions & 4 deletions sidebar-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,21 @@ const buildSidebar = [
],
},
'build/secretVault-secretDataAnalytics/generate-tokens',

{
type: 'link',
label: 'SecretVault Examples',
href: 'https://github.com/NillionNetwork/blind-module-examples/tree/main/nildb',
label: 'JS Wrapper Examples',
href: 'https://github.com/NillionNetwork/secretvault-js/tree/main/examples',
},
{
type: 'link',
label: 'Python Wrapper Examples',
href: 'https://github.com/NillionNetwork/secretvaults-py/tree/main/examples',
},
{
type: 'link',
label: 'SecretVaultWrapper JS Examples',
href: 'https://github.com/NillionNetwork/nillion-sv-wrappers/tree/main/examples',
label: 'Full App Examples',
href: 'https://github.com/NillionNetwork/blind-module-examples/tree/main/nildb',
},
{
type: 'category',
Expand Down
Loading

0 comments on commit 3984d6b

Please sign in to comment.