Allows for the creation of user accounts. A few notes on the specifics: - Experiments are the main access control objects. If you can view an experiment, you can view all its prompts/scenarios/evals. If you can edit it, you can edit or delete all of those as well. - Experiments are owned by Organizations in the database. Organizations can have multiple members and members can have roles of ADMIN, MEMBER or VIEWER. - Organizations can either be "personal" or general. Each user has a "personal" organization created as soon as they try to create an experiment. There's currently no UI support for creating general orgs or adding users to them; they're just in the database to future-proof all the ACL logic. - You can require that a user is signed-in to see a route using the `protectedProcedure` helper. When you use `protectedProcedure`, you also have to call `ctx.markAccessControlRun()` (or delegate to a function that does it for you; see accessControl.ts). This is to remind us to actually check for access control when we define a new endpoint.
29 lines
1.1 KiB
Plaintext
29 lines
1.1 KiB
Plaintext
# Since the ".env" file is gitignored, you can use the ".env.example" file to
|
|
# build a new ".env" file when you clone the repo. Keep this file up-to-date
|
|
# when you add new variables to `.env`.
|
|
|
|
# This file will be committed to version control, so make sure not to have any
|
|
# secrets in it. If you are cloning this repo, create a copy of this file named
|
|
# ".env" and populate it with your secrets.
|
|
|
|
# When adding additional environment variables, the schema in "/src/env.mjs"
|
|
# should be updated accordingly.
|
|
|
|
# Prisma
|
|
# https://www.prisma.io/docs/reference/database-reference/connection-urls#env
|
|
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/openpipe?schema=public"
|
|
|
|
# OpenAI API key. Instructions on generating a key can be found here:
|
|
# https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key
|
|
OPENAI_API_KEY=""
|
|
|
|
NEXT_PUBLIC_SOCKET_URL="http://localhost:3318"
|
|
|
|
# Next Auth
|
|
NEXTAUTH_SECRET="your_secret"
|
|
NEXTAUTH_URL="http://localhost:3000"
|
|
|
|
# Next Auth Github Provider
|
|
GITHUB_CLIENT_ID="your_client_id"
|
|
GITHUB_CLIENT_SECRET="your_secret"
|