sdm-ui

command module
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 1 Imported by: 0

README

SDM Wrapper

Why Use the SDM Wrapper?

  • Performance: The sdm command can be slow, especially when listing statuses/resources (sdm status). This issue might be exacerbated if you're outside the US.
  • User Interface: sdm lacks a UI for Linux, which, combined with its performance issues, makes the experience less than ideal.
  • Personal Challenge: Because it's a fun project and a great learning opportunity.

Installation

To install the SDM Wrapper, run:

go install github.com/marianozunino/sdm-ui@latest

Usage

Usage:
  sdm-ui [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  dmenu       Opens dmenu with available data sources
  fzf         Opens fzf with available data sources
  help        Help about any command
  list        List SDM resources
  sync        Syncronizes the internal cache
  version     Print the version number of sdm ui
  wipe        Wipe the SDM UI cache db

Flags:
      --config string   config file (default "/home/forbi/.config/sdm-ui.yaml")
  -d, --db string       database path (default "/home/forbi/.local/share")
  -e, --email string    email address (overrides config file)
  -h, --help            help for sdm-ui
  -v, --verbose         verbose output (overrides config file)
Configuration

The SDM Wrapper can be configured using a YAML file located at $XDG_CONFIG_HOME/sdm-ui.yaml. Here's an example configuration:

email: some_email@example.com
verbose: true
blacklistPatterns:
  - "*rds*"
  - "prod*"
  - "es-logs$"

The available configuration options are:

  • email: Your email address used for authentication with the StrongDM platform.
  • verbose: Enable verbose output.
  • blacklistPatterns: A list of regular expression patterns used to filter out unwanted data sources.

You can also override the configuration options using command-line flags, as shown in the Usage section.

How Does the Wrapper Address These Issues?
Slow Status

The typical workflow with sdm involves:

  1. Running sdm status | grep <something> to filter the list of resources (e.g., sdm status | grep rds to find RDS resources).
  2. Using sdm connect <resource> to connect to the selected resource.

The SDM Wrapper improves this by caching the resource list using bbolt. This makes resource retrieval faster and more efficient. The cache is populated automatically when you connect to a resource.

Lack of UI

While I'm not a UI expert, I appreciate efficiency. The wrapper integrates with rofi, wofi, or fzf to provide a user-friendly interface for selecting resources.

Credential management is handled using keyring, and if credentials are missing, the wrapper prompts for them via zenity.

Additionally, unlike the macOS version of sdm, which opens a browser tab for web resources, the wrapper uses open to achieve the same on Linux.

Notes
  • Cross-Platform Testing: This wrapper has only been tested in the environment where it was developed. If you encounter any issues, contributions or feedback are welcome!
  • SDM Version: The wrapper was tested with the sdm version 44.31.0.

Documentation

Overview

Copyright © 2024 Mariano Zunino <marianoz@posteo.net>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis
internal
app
sdm

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL