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: 2 additions & 2 deletions docs/api-reference/bundle/write-bundle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ Let's say user:564 creates an organization:789 in your application. According to
- organization:789#manager@user:564
- organization:789$public|boolean:false

Instead of using the [WriteData](./api-overview/data/write-data.md) endpoint, you can utilize [RunBundle](./api-overview/data/run-bundle.md) to create this data by simply providing specific identifiers.
Instead of using the [WriteData](../data/write-data) endpoint, you can utilize [RunBundle](../data/run-bundle) to create this data by simply providing specific identifiers.

An example request of [RunBundle](./api-overview/data/run-bundle.md) for this scenario:
An example request of [RunBundle](../data/run-bundle) for this scenario:

```json
POST /bundle
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/examples/facebook-groups.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,6 @@ The validation result according to our example schema validation file:

## Need any help?

This concludes the demonstration of the authorization structure for Facebook groups. To install and implement this see the [Set Up Permify](../../installation.md) section.
This concludes the demonstration of the authorization structure for Facebook groups. To install and implement this see the [Set Up Permify](../../setting-up/installation/intro) section.

If you need any kind of help, our team is happy to help you get started with Permify. If you'd like to learn more about using Permify in your app or have any questions about it, [schedule a consultation call with one of our account executives](https://www.permify.co/book-demo).
2 changes: 1 addition & 1 deletion docs/getting-started/examples/instagram.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,4 @@ The validation result according to our example schema validation file:

## Need any help?

This is the end of the demonstration of the authorization structure for Instagram. To install and implement this see the [Set Up Permify](../../installation.md) section.
This is the end of the demonstration of the authorization structure for Instagram. To install and implement this see the [Set Up Permify](../../setting-up/installation/intro) section.
2 changes: 1 addition & 1 deletion docs/getting-started/examples/mercury.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,4 @@ At last, as you can see we use the Rules to define access rights to withdraw whi

## Need any help?

This is the end of the demonstration of the authorization structure for Mercury. To install and implement this see the [Set Up Permify](../../installation.md) section.
This is the end of the demonstration of the authorization structure for Mercury. To install and implement this see the [Set Up Permify](../../setting-up/installation/intro) section.
2 changes: 1 addition & 1 deletion docs/getting-started/examples/notion.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,6 @@ The validation result according to our example schema validation file:

## Need any help?

This is the end of the demonstration of the authorization structure for Notion. To install and implement this see the [Set Up Permify](../../installation.md) section.
This is the end of the demonstration of the authorization structure for Notion. To install and implement this see the [Set Up Permify](../../setting-up/installation/intro) section.

If you need any kind of help, our team is happy to help you get started with Permify. If you'd like to learn more about using Permify in your app or have any questions about it, [schedule a consultation call with one of our account executives](https://www.permify.co/book-demo).
14 changes: 7 additions & 7 deletions docs/operations/bundle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This functionality streamlines managing authorization data, allows you to manage

Let's examine how Bundles operate.

Let's say you want to model how data will be created when an organization is created in your application. For this purpose, you can utilize the [WriteBundle](../../api-reference/bundle/write-bundle) API endpoint. This API enables users to define or update data bundles, each distinguished by a unique name.
Let's say you want to model how data will be created when an organization is created in your application. For this purpose, you can utilize the [WriteBundle](../api-reference/bundle/write-bundle) API endpoint. This API enables users to define or update data bundles, each distinguished by a unique name.

Here's an example body for WriteBundle in this scenario:

Expand Down Expand Up @@ -54,9 +54,9 @@ Let's say user:564 creates an organization:789 in your application. According to
- organization:789#manager@user:564
- organization:789$public|boolean:false

Instead of using the [WriteData](../../api-reference/data/write-data) endpoint, you can utilize [RunBundle](../../api-reference/data/run-bundle) to create this data by simply providing specific identifiers.
Instead of using the [WriteData](../api-reference/data/write-data) endpoint, you can utilize [RunBundle](../api-reference/data/run-bundle) to create this data by simply providing specific identifiers.

An example request of [RunBundle](../../api-reference/data/run-bundle) for this scenario:
An example request of [RunBundle](../api-reference/data/run-bundle) for this scenario:

```json
{
Expand All @@ -76,7 +76,7 @@ This will result in the creation of the following data in Permify:

## Endpoints

- [WriteBundle](../../api-reference/bundle/write-bundle)
- [RunBundle](../../api-reference/data/run-bundle)
- [DeleteBundle](../../api-reference/bundle/delete-bundle)
- [ReadBundle](../../api-reference/bundle/read-bundle)
- [WriteBundle](../api-reference/bundle/write-bundle)
- [RunBundle](../api-reference/data/run-bundle)
- [DeleteBundle](../api-reference/bundle/delete-bundle)
- [ReadBundle](../api-reference/bundle/read-bundle)
2 changes: 1 addition & 1 deletion docs/operations/tracing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ database:
write:
connection: 'postgres'
database: 'morf-health-demo'
uri: 'postgres://postgres:SphU4Uf3QXNntT@permify.us-east-1.rds.amazonaws.com:5432'
uri: 'postgres://postgres:yourpassword@your-host.rds.amazonaws.com:5432'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- relevant files ---'
git ls-files | rg '(^|/)(configuration|config|tracing)\.(mdx?|ts|tsx|js|jsx|json|yaml|yml)$|postgres|database' | head -200

printf '%s\n' '--- documentation context ---'
sed -n '35,65p' docs/operations/tracing.mdx
sed -n '80,110p' docs/setting-up/configuration.mdx

printf '%s\n' '--- configuration symbols and PostgreSQL references ---'
rg -n -S 'morf-health-demo|postgres://|PostgreSQL|postgres|database\s*:' --glob '!node_modules' --glob '!dist' --glob '!build' . | head -300

Repository: Permify/permify

Length of output: 37025


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- configuration definitions and loading ---'
rg -n -S 'type .*Config|type .*Database|Database struct|URI\s+string|database.*uri|NewWithSeparateURIs|conf\.Database|Database\.URI|Database\.Write' \
  --glob '*.go' --glob '!**/*_test.go' . | head -300

printf '%s\n' '--- database construction call sites ---'
rg -n -S 'postgres\.New|NewWithSeparateURIs|New\(' pkg internal --glob '*.go' | head -250

printf '%s\n' '--- candidate configuration files ---'
fd -t f -e go . | rg '(^|/)(config|configuration|options|settings)(/|\.go$)' | head -150

Repository: Permify/permify

Length of output: 36922


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- configuration structure and defaults ---'
sed -n '130,205p' internal/config/config.go
sed -n '1,130p' internal/factories/database.go

printf '%s\n' '--- PostgreSQL constructors ---'
sed -n '1,125p' pkg/database/postgres/postgres.go

printf '%s\n' '--- configuration decoding and migration paths ---'
rg -n -S 'mapstructure|Unmarshal|ReadInConfig|SetDefault|database\.write|database\.writer|database\.reader|write:' internal pkg --glob '*.go' --glob '!**/*_test.go' | head -250

Repository: Permify/permify

Length of output: 41123


🌐 Web query:

pgx v5 pgxpool.ParseConfig PostgreSQL URI without database path default database name

💡 Result:

In pgx v5, if a PostgreSQL connection URI does not specify a database name (i.e., there is no path component after the host/port), the driver defaults to using the current operating system username as the database name [1][2]. This behavior follows the standard PostgreSQL connection logic (libpq), where the database name defaults to the user name if not explicitly provided [1][3]. When you use pgxpool.ParseConfig(connString), it internally calls pgx.ParseConfig, which applies these same resolution rules—merging default settings, environment variables, and the provided connection string [4][1][5]. If you need to change this behavior, you can manually modify the Database field in the pgxpool.Config object after calling ParseConfig but before creating the pool: config, err:= pgxpool.ParseConfig("postgres://user:password@localhost:5432/") if err!= nil { // handle error } // Manually set the default database name config.ConnConfig.Database = "my_actual_db" pool, err:= pgxpool.NewWithConfig(context.Background, config)

Citations:


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- pgx dependency version ---'
rg -n 'jackc/pgx|pgx/v5' go.mod go.sum | head -20

printf '%s\n' '--- full database examples using the legacy write block ---'
rg -n -S -A12 -B4 'database:\s*$|write:\s*$|database:\s*['"'"'"]' docs/operations docs/docs/reference docs/setting-up --glob '*.mdx' --glob '*.md' | head -250

printf '%s\n' '--- current configuration documentation around database settings ---'
sed -n '85,125p' docs/setting-up/configuration.mdx
sed -n '420,460p' docs/setting-up/configuration.mdx

Repository: Permify/permify

Length of output: 18078


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- configuration defaults ---'
sed -n '205,290p' internal/config/config.go
sed -n '150,215p' pkg/cmd/serve.go

printf '%s\n' '--- read-only contract probe ---'
python3 - <<'PY'
from pathlib import Path
import re

doc = Path("docs/operations/tracing.mdx").read_text()
block = doc.split("```", 2)[1]
keys = []
for line in block.splitlines():
    if line.startswith("database:"):
        in_db = True
    elif "in_db" in locals() and in_db and line and not line.startswith(" ") and not line.startswith("#"):
        break
    elif "in_db" in locals() and in_db:
        m = re.match(r"^  ([A-Za-z_][A-Za-z0-9_]*):", line)
        if m:
            keys.append(m.group(1))

config_text = Path("internal/config/config.go").read_text()
allowed = set(re.findall(r'mapstructure:"([^"]+)"', config_text))
print("database block child keys:", keys)
print("recognized config keys:", sorted(allowed & set(keys)))
print("unrecognized database block child keys:", sorted(set(keys) - allowed))
PY

Repository: Permify/permify

Length of output: 6005


Use the current PostgreSQL configuration schema.

database.write is unsupported. Use database.engine and database.uri with placeholder values. Include /db_name in the URI because pgx otherwise derives the database name from the operating-system user.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/operations/tracing.mdx` at line 50, Update the PostgreSQL configuration
example in the tracing documentation to use the current schema with
database.engine and database.uri instead of database.write. Replace the URI
placeholder with a valid database name suffix such as /db_name, while preserving
the existing placeholder host and credentials.

pool_max: 2
```

Expand Down
4 changes: 2 additions & 2 deletions docs/permify-overview/faqs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ It's expected that your initial schema will eventually change as your product or

As an example, when a new feature arises and related permissions are created, you need to change the schema (rewrite it with the new permission) then configure it using this Write Schema API. Afterwards, you can use the preferred version of the schema in your API requests with **schema_version**. If you do not prefer to use **schema_version** params in API calls Permify automatically gets the latest schema on API calls.

A potential caveat of changing or creating schemas too often is the creation of many idle relation tuples. In Permify, created relation tuples are not removed from the stored database unless you delete them with the [delete API](../data/delete-data.md). For this case, we have a [garbage collector](https://github.com/Permify/permify/pull/381) which you can use to clear expired or idle relation tuples.
A potential caveat of changing or creating schemas too often is the creation of many idle relation tuples. In Permify, created relation tuples are not removed from the stored database unless you delete them with the [delete API](../api-reference/data/delete-data). For this case, we have a [garbage collector](https://github.com/Permify/permify/pull/381) which you can use to clear expired or idle relation tuples.

We recommend applying the following pattern to safely handle schema changes:

Expand Down Expand Up @@ -124,7 +124,7 @@ Gathering authorization logic in a central place offers important advantages ove

See the [What is Authorization Service] Section for a detailed explanation of those advantages.

[What is Authorization Service]: ../authorization-service
[What is Authorization Service]: ./authorization-service

![load-balancer](https://user-images.githubusercontent.com/34595361/201173835-6f6b67cd-d65b-4239-b695-04ecf1bad5bc.png)

Expand Down
Loading