Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chappio/directus-extension-static-auth
Provision a static authentication token on boot
https://github.com/chappio/directus-extension-static-auth
Last synced: 2 months ago
JSON representation
Provision a static authentication token on boot
- Host: GitHub
- URL: https://github.com/chappio/directus-extension-static-auth
- Owner: ChappIO
- Created: 2024-01-02T16:26:35.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-11T20:55:11.000Z (7 months ago)
- Last Synced: 2024-10-16T04:02:45.254Z (3 months ago)
- Language: TypeScript
- Size: 1010 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Directus extension: Manage Static Tokens on CLI
[![directus-extension-static-auth](https://npmbadge.com/npm/directus-extension-static-auth?mode=yarn)](https://www.npmjs.com/package/directus-extension-static-auth)This simple extension lets you create users and roles with static access tokens from the command line. Very useful to provision your directus deployments and other backend when you're using CI/CD.
## Usage
To install the extension, simply install the package into your project:
```bash
npm install directus-extension-static-auth
```or
```bash
yarn add directus-extension-static-auth
```Then, run the `static-auth create` command to create a new user and role with a static access token: `directus static-auth token create my-super-secret-token`.
```bash
directus static-auth --helpUsage: directus static-auth create [options]
Create a static token, the name option is used as the key for the token. This means that if you change the name, a new token will be created.
Arguments:
token the token to useOptions:
--name the unique name and key used for user account that manages the token (default: "Token")
--role the name of the role used to manage this authentication. If this option is not provided, the name defaults to the --name option
--not-admin use this flag to prevent this role from becoming an administrator, this allows you to manually manage roles and permissions (default: false)
-h, --help display help for command
```