Storj IconSTORJ | DCS Docs
access restrict

access restrict #

This command allows you to create a restricted Access Grant and print it to stdout, export it to a file or import it as an access to the local store of Uplink.

Usage #

./uplink.exe access restrict [flags]
uplink access restrict [flags]
uplink access restrict [flags]

Flags #

FlagDescription
--access stringAccess name or value to restrict
--import-as stringImport the access as this name
--export-to stringExport the access to this file path
-f, --forceForce overwrite an existing saved access
--useSwitch the default access to the newly created one
--prefix SharePrefix

Key prefix access will be restricted to this prefix.

You can optionally specify this flag several times to add several different prefixes to the access grant.

--readonlyImplies --disallow-writes and --disallow-deletes (default true)
--writeonlyImplies --disallow-reads and --disallow-lists
--disallow-deletesDisallow deletes with the access
--disallow-listsDisallow lists with the access
--disallow-readsDisallow reads with the access
--disallow-writesDisallow writes with the access
--not-before relative_dateDisallow access before this time (e.g. ‘+2h’, ’now’, ‘2020-01-02T15:04:05Z0700’)
--not-after relative_dateDisallow access after this time (e.g. ‘+2h’, ’now’, ‘2020-01-02T15:04:05Z0700’)

Global flags #

Global flagsDescription
--config-dir stringDirectory that stores the configuration
--help, -hprints help for the command
--advancedwhen used with -h, prints advanced flags help

Examples #

Create a restricted Access Grant #

As result, it will print the created access grant to stdout. Since we did not specify any restrictions, only the defaults will be applied. This command will print an Access Grant with read only access:

./uplink.exe access restrict
uplink access restrict
uplink access restrict
18yMsZpg6ZQdz........

Create a restricted Access Grant and export it to the file #

This will export the restricted access grant to a file named “access.txt”:

./uplink.exe access restrict --not-after +1h --export-to access.txt
uplink access restrict --not-after +1h --export-to access.txt
uplink access restrict --not-after +1h --export-to access.txt
Exported access to: /home/user/access.txt

This will import the write only restricted access grant to Uplink as a named access:

./uplink.exe access restrict --access us1 --writeonly --import-as us1-wo
uplink access restrict --access us1 --writeonly --import-as us1-wo
uplink access restrict --access us1 --writeonly --import-as us1-wo
Imported access "us1-wo" to "/home/user/.config/storj/uplink/access.json"
17UjiCX.....

Create a restricted Access Grant and replace the existing access #

This will import the restricted access grant to Uplink as a named access and replace it if one existed already:

./uplink.exe access restrict --import-as us1-ro --force
uplink access restrict --import-as us1-ro --force
uplink access restrict --import-as us1-ro --force
Imported access "us1-ro" to "/home/user/.config/storj/uplink/access.json"
19jihX...

Create a restricted Access Grant for several prefixes #

This will create the restricted access grant for several prefixes:

./uplink.exe access restrict --prefix sj://cakes/New-York --prefix sj://pies
uplink access restrict --prefix sj://cakes/New-York --prefix sj://pies
uplink access restrict  --prefix sj://cakes/New-York --prefix sj://pies
16Xng...