Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pages/authzed/guides/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
"picking-a-product": "Picking a Product",
cloud: "Getting Started with Authzed Cloud",
};
65 changes: 65 additions & 0 deletions pages/authzed/guides/cloud.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { Callout } from "nextra/components";
import YouTube from "react-youtube";

# Getting Started with AuthZed Cloud

This page provides a guide on how to get up and running with a permission system in AuthZed Cloud.

If you prefer a guide in video format, watch this:

<YouTube videoId="O325tG4s66g" className="youtubeContainer" />

## Create a Permissions System on AuthZed Cloud

Sign in to [AuthZed Cloud](https://app.authzed.cloud) and click on the **+Create** button to create a Permissions System (PS) and fill in the necessary details:

- The type can be either "Production" or "Development".
- Give it a name.
- Choose the underlying datastore.
- The update channel can be either be `rapid` or `regular` which determines the behavior of automatic updates when new SpiceDB releases are made available:
- `rapid` gets the latest release immediately.
- `regular` is one release behind.
- Add SpiceDB deployments:
- Give them a name.
- Choose the region where the deployment will live.
- Choose the number of vCPUs for your deployment. The recommendation is to start with 2 vCPUs and then monitor the Metrics and change it based on your workload.
- Choose the number of replicas to deploy SpiceDB with primarily read workloads. The recommendation is 3 but will depend on your latency requirements.

## Configuring Access

Before using the Permissions System, let's configure access to it.
This functionality enables organizations to apply the principle of least-privilege to services accessing SpiceDB.
For example, read-only tokens can be created for services that should never need to write to SpiceDB.
Read more about it [here](https://authzed.com/docs/authzed/concepts/restricted-api-access)

Let’s start by creating a **Service Account** which is something that represents your unique workload.
We recommend creating a Service Account for each application that will access the SpiceDB API.
Add a name such as `blog-app` and a description before hitting Save.

Now let’s create a **token**.
Tokens are long-lived credentials for Service Accounts.
SpiceDB clients must provide a Token in the Authorization header of an API request to perform actions granted to the Service Account.
Click on the `blog-app` service account you just created and then the Tokens item in the menu.
Create a token by providing a name and description.

Let’s now provide a **Role** and attach a **Policy** to that Role.
A Role defines rules for accessing the SpiceDB API.
Roles are bound to Service Accounts.
Click the Roles -> Create Role and provide a name and a description.
Add the following permissions for this demo:

```
ReadSchema
WriteSchema
DeleteRelationships
ReadRelationships
WriteRelationships
CheckPermission
```

Finally, let’s create a Policy.
Policies are what bind Roles to a Service Account.
Click on Policies -> Create policy.
Provide a name and a description and pick the Service Account and Role created in the steps above to bind the two.

You’re now ready to use your Permissions System!
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets a user to where they're able to make checks, but it seems like we should get them to where they're writing a schema, writing a relationship, and checking that relationship. Is there something to that effect that we can link to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 the role above enables one to call both of those APIs

44 changes: 11 additions & 33 deletions pages/spicedb/concepts/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ A database that stores and computes permissions

### Children commands

- [spicedb datastore](#reference-spicedb-datastore) - datastore operations
- [spicedb lsp](#reference-spicedb-lsp) - serve language server protocol
- [spicedb man](#reference-spicedb-man) - Generate man page
- [spicedb serve](#reference-spicedb-serve) - serve the permissions database
- [spicedb serve-testing](#reference-spicedb-serve-testing) - test server with an in-memory datastore
- [spicedb version](#reference-spicedb-version) - displays the version of SpiceDB

- [spicedb datastore](#reference-spicedb-datastore) - datastore operations
- [spicedb lsp](#reference-spicedb-lsp) - serve language server protocol
- [spicedb man](#reference-spicedb-man) - Generate man page
- [spicedb serve](#reference-spicedb-serve) - serve the permissions database
- [spicedb serve-testing](#reference-spicedb-serve-testing) - test server with an in-memory datastore
- [spicedb version](#reference-spicedb-version) - displays the version of SpiceDB

## Reference: `spicedb datastore`

Expand All @@ -49,11 +48,10 @@ Operations against the configured datastore

### Children commands

- [spicedb datastore gc](#reference-spicedb-datastore-gc) - executes garbage collection
- [spicedb datastore head](#reference-spicedb-datastore-head) - compute the head (latest) database migration revision available
- [spicedb datastore migrate](#reference-spicedb-datastore-migrate) - execute datastore schema migrations
- [spicedb datastore repair](#reference-spicedb-datastore-repair) - executes datastore repair

- [spicedb datastore gc](#reference-spicedb-datastore-gc) - executes garbage collection
- [spicedb datastore head](#reference-spicedb-datastore-head) - compute the head (latest) database migration revision available
- [spicedb datastore migrate](#reference-spicedb-datastore-migrate) - execute datastore schema migrations
- [spicedb datastore repair](#reference-spicedb-datastore-repair) - executes datastore repair

## Reference: `spicedb datastore gc`

Expand Down Expand Up @@ -148,8 +146,6 @@ spicedb datastore gc [flags]
--skip-release-check if true, skips checking for new SpiceDB releases
```



## Reference: `spicedb datastore head`

compute the head (latest) database migration revision available
Expand Down Expand Up @@ -181,8 +177,6 @@ spicedb datastore head [flags]
--skip-release-check if true, skips checking for new SpiceDB releases
```



## Reference: `spicedb datastore migrate`

Executes datastore schema migrations for the datastore.
Expand Down Expand Up @@ -222,8 +216,6 @@ spicedb datastore migrate [revision] [flags]
--skip-release-check if true, skips checking for new SpiceDB releases
```



## Reference: `spicedb datastore repair`

Executes a repair operation for the datastore
Expand Down Expand Up @@ -317,8 +309,6 @@ spicedb datastore repair [flags]
--skip-release-check if true, skips checking for new SpiceDB releases
```



## Reference: `spicedb lsp`

serve language server protocol
Expand All @@ -342,20 +332,17 @@ spicedb lsp [flags]
--skip-release-check if true, skips checking for new SpiceDB releases
```



## Reference: `spicedb man`

Generate a man page for SpiceDB.
The output can be redirected to a file and installed to the system:
The output can be redirected to a file and installed to the system:

```
spicedb man > spicedb.1
sudo mv spicedb.1 /usr/share/man/man1/
sudo mandb # Update man page database
```


```
spicedb man
```
Expand All @@ -368,8 +355,6 @@ spicedb man
--skip-release-check if true, skips checking for new SpiceDB releases
```



## Reference: `spicedb serve`

start a SpiceDB server
Expand Down Expand Up @@ -557,8 +542,6 @@ spicedb serve [flags]
--skip-release-check if true, skips checking for new SpiceDB releases
```



## Reference: `spicedb serve-testing`

An in-memory spicedb server which serves completely isolated datastores per client-supplied auth token used.
Expand Down Expand Up @@ -620,8 +603,6 @@ spicedb serve-testing [flags]
--skip-release-check if true, skips checking for new SpiceDB releases
```



## Reference: `spicedb version`

displays the version of SpiceDB
Expand All @@ -643,6 +624,3 @@ spicedb version [flags]
--log-level string verbosity of logging ("trace", "debug", "info", "warn", "error") (default "info")
--skip-release-check if true, skips checking for new SpiceDB releases
```



2 changes: 1 addition & 1 deletion pages/spicedb/getting-started/_meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export default {
"client-libraries": "Client Libraries",
"installing-zed": "Installing the CLI",
"coming-from": "Coming From",
"protecting-a-blog": "Example: Protecting a Blog Application",
"protecting-a-blog": "Tutorial: Protecting a Blog Application",
faq: "FAQ",
};
Loading
Loading