forked from sourcenetwork/defradb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR(ACP-DOCS): Generate CLI Docs With Identity
- Loading branch information
1 parent
5121794
commit 70ff196
Showing
10 changed files
with
239 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
## defradb client acp | ||
|
||
Interact with the access control system of a DefraDB node | ||
|
||
### Synopsis | ||
|
||
Interact with the access control system of a DefraDB node | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for acp | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--allowed-origins stringArray List of origins to allow for CORS requests | ||
--logformat string Log format to use. Options are csv, json (default "csv") | ||
--loglevel string Log level to use. Options are debug, info, error, fatal (default "info") | ||
--lognocolor Disable colored log output | ||
--logoutput string Log output path (default "stderr") | ||
--logtrace Include stacktrace in error and fatal logs | ||
--max-txn-retries int Specify the maximum number of retries per transaction (default 5) | ||
--no-p2p Disable the peer-to-peer network synchronization system | ||
--p2paddr strings Listen addresses for the p2p network (formatted as a libp2p MultiAddr) (default [/ip4/127.0.0.1/tcp/9171]) | ||
--peers stringArray List of peers to connect to | ||
--privkeypath string Path to the private key for tls | ||
--pubkeypath string Path to the public key for tls | ||
--rootdir string Directory for persistent data (default: $HOME/.defradb) | ||
--store string Specify the datastore to use (supported: badger, memory) (default "badger") | ||
--tx uint Transaction ID | ||
--url string URL of HTTP endpoint to listen on or connect to (default "127.0.0.1:9181") | ||
--valuelogfilesize int Specify the datastore value log file size (in bytes). In memory size will be 2*valuelogfilesize (default 1073741824) | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [defradb client](defradb_client.md) - Interact with a DefraDB node | ||
* [defradb client acp policy](defradb_client_acp_policy.md) - Interact with the acp policy features of DefraDB instance | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
## defradb client acp policy | ||
|
||
Interact with the acp policy features of DefraDB instance | ||
|
||
### Synopsis | ||
|
||
Interact with the acp policy features of DefraDB instance | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for policy | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--allowed-origins stringArray List of origins to allow for CORS requests | ||
--logformat string Log format to use. Options are csv, json (default "csv") | ||
--loglevel string Log level to use. Options are debug, info, error, fatal (default "info") | ||
--lognocolor Disable colored log output | ||
--logoutput string Log output path (default "stderr") | ||
--logtrace Include stacktrace in error and fatal logs | ||
--max-txn-retries int Specify the maximum number of retries per transaction (default 5) | ||
--no-p2p Disable the peer-to-peer network synchronization system | ||
--p2paddr strings Listen addresses for the p2p network (formatted as a libp2p MultiAddr) (default [/ip4/127.0.0.1/tcp/9171]) | ||
--peers stringArray List of peers to connect to | ||
--privkeypath string Path to the private key for tls | ||
--pubkeypath string Path to the public key for tls | ||
--rootdir string Directory for persistent data (default: $HOME/.defradb) | ||
--store string Specify the datastore to use (supported: badger, memory) (default "badger") | ||
--tx uint Transaction ID | ||
--url string URL of HTTP endpoint to listen on or connect to (default "127.0.0.1:9181") | ||
--valuelogfilesize int Specify the datastore value log file size (in bytes). In memory size will be 2*valuelogfilesize (default 1073741824) | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [defradb client acp](defradb_client_acp.md) - Interact with the access control system of a DefraDB node | ||
* [defradb client acp policy add](defradb_client_acp_policy_add.md) - Add new policy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
## defradb client acp policy add | ||
|
||
Add new policy | ||
|
||
### Synopsis | ||
|
||
Add new policy | ||
|
||
Requirements: | ||
- Must provide a valid SourceHub Identity. | ||
- ACP module must be available (i.e. ACP not disabled). | ||
- Policy specified must be a valid policy (but DPI compliance is not necessary). | ||
- Policy specified must be in a valid JSON or YAML format (detected automatically). | ||
|
||
Notes: | ||
- A non-DPI policy will be accepted (will be registered with acp module). | ||
- But only a valid DPI policyID & resource can be specified on a schema. | ||
- DPI validation happens when attempting to add a permissioned schema. | ||
- If DPI validation fails while adding schema, the schema is rejected. | ||
|
||
Example: add from an argument string: | ||
defradb client acp policy add -i cosmos1f2djr7dl9vhrk3twt3xwqp09nhtzec9mdkf70j ' | ||
description: A Valid DefraDB Policy Interface | ||
|
||
actor: | ||
name: actor | ||
|
||
resources: | ||
users: | ||
permissions: | ||
read: | ||
expr: owner + reader | ||
write: | ||
expr: owner | ||
|
||
relations: | ||
owner: | ||
types: | ||
- actor | ||
reader: | ||
types: | ||
- actor | ||
' | ||
|
||
Example: add from file: | ||
defradb client acp policy add -i cosmos17r39df0hdcrgnmmw4mvu7qgk5nu888c7uvv37y -f policy.yml | ||
|
||
Example: add from file, verbose flags: | ||
defradb client acp policy add --identity cosmos1kpw734v54g0t0d8tcye8ee5jc3gld0tcr2q473 --file policy.yml | ||
|
||
Example: add from stdin: | ||
cat policy.yml | defradb client acp policy add - | ||
|
||
Learn more about the DefraDB Policy Interface [DPI](/acp/DPI.md) | ||
Learn more about DefraDB ACP Terminologies [TERMINOLOGY](/acp/TERMINOLOGY.md) | ||
|
||
|
||
|
||
``` | ||
defradb client acp policy add [-i --identity] [policy] [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-f, --file string File to load a policy from | ||
-h, --help help for add | ||
-i, --identity string [Required] Identity of the creator | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--allowed-origins stringArray List of origins to allow for CORS requests | ||
--logformat string Log format to use. Options are csv, json (default "csv") | ||
--loglevel string Log level to use. Options are debug, info, error, fatal (default "info") | ||
--lognocolor Disable colored log output | ||
--logoutput string Log output path (default "stderr") | ||
--logtrace Include stacktrace in error and fatal logs | ||
--max-txn-retries int Specify the maximum number of retries per transaction (default 5) | ||
--no-p2p Disable the peer-to-peer network synchronization system | ||
--p2paddr strings Listen addresses for the p2p network (formatted as a libp2p MultiAddr) (default [/ip4/127.0.0.1/tcp/9171]) | ||
--peers stringArray List of peers to connect to | ||
--privkeypath string Path to the private key for tls | ||
--pubkeypath string Path to the public key for tls | ||
--rootdir string Directory for persistent data (default: $HOME/.defradb) | ||
--store string Specify the datastore to use (supported: badger, memory) (default "badger") | ||
--tx uint Transaction ID | ||
--url string URL of HTTP endpoint to listen on or connect to (default "127.0.0.1:9181") | ||
--valuelogfilesize int Specify the datastore value log file size (in bytes). In memory size will be 2*valuelogfilesize (default 1073741824) | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [defradb client acp policy](defradb_client_acp_policy.md) - Interact with the acp policy features of DefraDB instance | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters