New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details → →
Socket
Book a DemoSign in
Socket

ract-cli-tool

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ract-cli-tool

A CLI based tool for RBAC system administration

latest
Source
npmnpm
Version
0.0.0
Version published
Maintainers
1
Created
Source
RACT
Visit us Code License

RACT is a command-line tool for managing Role-Based Access Control (RBAC) in systems that use Redis and PostgreSQL as backend services. It allows administrators to manage user roles (e.g., Admin, User) in a PostgreSQL database and handle user sessions in Redis. This tool can be used to:

  • Update user roles between "User" and "Admin" in PostgreSQL.
  • Delete session data from Redis associated with users.
  • Add or update Redis and PostgreSQL credentials for the tool's operation.

RACT ensures that the roles of users in a system are efficiently managed across both Redis (for session management) and PostgreSQL (for user roles).

Requirements

  • Redis: The tool interacts with Redis to manage user sessions.
  • PostgreSQL: The tool interacts with PostgreSQL to manage user roles.
  • Node.js: Ensure Node.js is installed on your system for running the tool.
  • NPM: Ensure NPM is installed to access this code

Configuration

Your Postgres and Redis URIs will be stored locally through the creditionals.json file within the root directory of this tooler.

creditionals.json Example

{
  "redisUrl": "redis://localhost:6379",
  "sqlDbUrl": "postgres://username:password@localhost:5432/dbname"
}
  • redisUrl: The URL of the Redis instance used for session management.
  • sqlDbUrl: The URL of the PostgreSQL instance used for user management.

If the creditionals.json file is missing fields, the tool will prompt you to enter the credentials when you run it.

Usage

Running the Tool

To run the tool, use npx from the command line:

npx ract-cli-tool

Upon running the tool, you'll be presented with a menu of options.

Main Commands

  • add/update configs: Prompts you to enter and save Redis and PostgreSQL credentials into the creditionals.json file.
  • update role: Allows you to update the role of a user (Admin/User) in PostgreSQL based on the email.

Example Flow

  • add/update configs: You will be prompted for Redis and PostgreSQL URLs. The tool will then save them to the creditionals.json file.

  • update role: You will:

    • Be asked for a user’s email.
    • Redis sessions related to the email will be deleted if found (through idx:session index w/ RediSearch module)
    • The tool will check if the email exists in PostgreSQL.
    • You will be prompted to select the role (User or Admin) for the email.
    • The role in PostgreSQL will be updated accordingly.

FAQs

Package last updated on 06 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts