diff --git a/docs/docs/api-overview/data/read-attributes.md b/docs/docs/api-overview/data/read-attributes.md index 517089690..e87be9087 100644 --- a/docs/docs/api-overview/data/read-attributes.md +++ b/docs/docs/api-overview/data/read-attributes.md @@ -25,20 +25,15 @@ Read API allows for directly querying the stored graph data to display and filte ```go rr, err: = client.Data.Relationship.Read(context.Background(), & v1.Data.RelationshipReadRequest { TenantId: "t1", - Metadata: &v1.Data.RelationshipReadRequestMetadata { + Metadata: &v1.Data.AttributeReadRequestMetadata { SnapToken: "" }, - Filter: &v1.TupleFilter { + Filter: &v1.AttributeFilter { Entity: &v1.EntityFilter { Type: "organization", Ids: []string {"1"} , }, - Relation: "member", - Subject: &v1.SubjectFilter { - Type: "", - Id: []string {""}, - Relation: "" - }} + Attributes: []string {"private"}, }) ``` @@ -59,12 +54,9 @@ client.data.relationship.read({ "1" ] }, - relation: "member", - subject: { - type: "", - ids: [], - relation: "" - } + attributes: [ + "private" + ], } }).then((response) => { // handle response @@ -88,12 +80,9 @@ curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/data/relat "1" ] }, - relation: "member", - subject: { - type: "", - ids: [], - relation: "" - } + attributes: [ + "private" + ], } }' ``` diff --git a/docs/docs/api-overview/data/write-data.md b/docs/docs/api-overview/data/write-data.md index 9b50fa2ae..5649b7411 100644 --- a/docs/docs/api-overview/data/write-data.md +++ b/docs/docs/api-overview/data/write-data.md @@ -153,7 +153,44 @@ Here are the available attribute value types: ```go +// Convert the wrapped attribute value into Any proto message +value, err := anypb.New(&v1.BooleanValue{ + Data: true, +}) +if err != nil { + // Handle error +} +cr, err := client.Data.Write(context.Background(), &v1.DataWriteRequest{ + TenantId: "t1",, + Metadata: &v1.DataWriteRequestMetadata{ + SchemaVersion: "", + }, + Tuples: []*v1.Attribute{ + { + Entity: &v1.Entity{ + Type: "organization", + Id: "1", + }, + Relation: "admin", + Subject: &v1.Subject{ + Type: "user", + Id: "1", + Relation: "", + }, + }, + }, + Attributes: []*v1.Attribute{ + { + Entity: &v1.Entity{ + Type: "account", + Id: "1", + }, + Attribute: "public", + Value: value, + }, + }, +}) ``` @@ -161,7 +198,40 @@ Here are the available attribute value types: ```javascript +const booleanValue = BooleanValue.fromJSON({ data: true }); +const value = Any.fromJSON({ + typeUrl: 'type.googleapis.com/base.v1.BooleanValue', + value: BooleanValue.encode(booleanValue).finish() +}); + +client.data.write({ + tenantId: "t1", + metadata: { + schemaVersion: "" + }, + tuples: [{ + entity: { + type: "organization", + id: "1" + }, + relation: "admin", + subject: { + type: "user", + id: "1" + } + }], + attributes: [{ + entity: { + type: "document", + id: "1" + }, + attribute: "public", + value: value, + }] +}).then((response) => { + // handle response +}) ``` @@ -197,7 +267,7 @@ curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/data/write "attribute": "private", "value": { "@type": "type.googleapis.com/base.v1.BooleanValue", - "value": "true" + "value": true } } ] diff --git a/docs/docs/comparision.md b/docs/docs/comparision.md index a73e70f98..75fb39c4a 100644 --- a/docs/docs/comparision.md +++ b/docs/docs/comparision.md @@ -31,7 +31,7 @@ This comparison table shows the differentiation between authorization solutions | **Watch API** | ✅ | ✅ | ✅ | ✅ | | **RBAC** | ✅ | ✅ | ✅ | ✅ | | **ReBAC** | ✅ | ✅ | ✅ | ✅ | -| **ABAC** | ⛔ | 🟡 | ✅ | ⛔ | +| **ABAC** | ⛔ | 🟡 | ✅ | ✅ | | **Data Filtering** | ⛔ | ✅ | ✅ | ✅ | | **Multi Tenancy** | ⛔ | ✅ | ⛔ | ✅ | | **Testing & Validation** | ⛔ | 🟡 | ✅ | ✅ | diff --git a/docs/docs/reference/configuration.md b/docs/docs/reference/configuration.md index 9eccbc5f8..31c2666fb 100644 --- a/docs/docs/reference/configuration.md +++ b/docs/docs/reference/configuration.md @@ -458,29 +458,26 @@ A consistent hashing ring ensures data distribution that minimizes reorganizatio ``` ├── distributed | ├── enabled -| ├── node -| ├── node-name -| ├── protocol +| ├── address +| ├── port ``` #### Glossary -| Required | Argument | Default | Description | -|----------|-----------|---------|--------------------------------------------------------------------------| -| [x] | enabled | false | switch option for distributed. | -| [x] | node | - | endpoint definition for distributed | -| [x] | node-name | - | node name definition for protocol agent (for example serf node name) | -| [x] | protocol | - | a field where you specify which gossip protocol to use, for example serf | +| Required | Argument | Default | Description | +|----------|-------------|---------|--------------------------------------| +| [x] | enabled | false | switch option for distributed. | +| [] | address | - | address of the distributed service | +| [] | port | 5000 | port on which the service is exposed | #### ENV -| Argument | ENV | Type | -|------------------------|-------------------------------|---------| -| distributed-enabled | PERMIFY_DISTRIBUTED_ENABLED | boolean | -| distributed-node | PERMIFY_DISTRIBUTED_NODE | string | -| distributed-node-name | PERMIFY_DISTRIBUTED_NODE_NAME | string | -| distributed-protocol | PERMIFY_DISTRIBUTED_PROTOCOL | string | +| Argument | ENV | Type | +|----------------------|-----------------------------|---------| +| distributed-enabled | PERMIFY_DISTRIBUTED_ENABLED | boolean | +| distributed-address | PERMIFY_DISTRIBUTED_ADDRESS | string | +| distributed-port | PERMIFY_DISTRIBUTED_PORT | string |

diff --git a/docs/sidebars.js b/docs/sidebars.js index 9b16f17b4..965c14118 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -95,6 +95,7 @@ module.exports = { items: [ "api-overview/data/write-data", "api-overview/data/read-relationships", + "api-overview/data/read-attributes", "api-overview/data/delete-data" ], },