Skip to content

pbnj/vim-britive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vim-britive

An unofficial Vim plugin for Britive

Table of Contents

Overview

Britive is a multi-cloud privilege & identity access management platform.

This is an unofficial vim plugin to provide a seamless integration with pybritive.

Install

With vim-plug:

Plug 'https://github.com/pbnj/vim-britive'

Dependencies

Usage

Basic

Run Britive commands from vim.

:Britive <args...>

A basic example is checking out Britive Profiles:

:Britive checkout <APPLICATION>/<ENVIRONMENT>/<PROFILE>

Tab completion on :Britive command completes Britive sub-commands, like checkin, checkout, ...etc.

Profile Checkouts

Checkout Programmatic Access

Since checking out Britive Profiles for programmatic access (i.e. generating API keys) are very common operations, there is a convenient command for it:

:BritiveCheckout <APPLICATION>/<ENVIRONMENT>/<PROFILE>

This is equivalent to checking out Programmatic Access via the Britive web UI.

Tab completion is supported on :BritiveCheckout command, which completes profile names.

You may pass any britive checkout flags to this command. For example, if you would like to check out programmatic access and display the API keys/credentials in "environment variable" format:

:BritiveCheckout <APPLICATION>/<ENVIRONMENT>/<PROFILE> --mode=env

Checkout Console Access

You may check out console access for Britive Profiles:

:BritiveConsole <APPLICATION>/<ENVIRONMENT>/<PROFILE>

This will produce a URL for the configured Cloud Service Provider, equivalent to checking out Console Access via the Britive web UI.

Tab completion is supported on :BritiveConsole command, which completes possible profile names.

To automatically open Britive console URLs without manually copying/pasting, on macOS:

:BritiveConsole <APPLICATION>/<ENVIRONMENT>/<PROFILE> | xargs open

On Linux/Ubuntu:

:BritiveConsole <APPLICATION>/<ENVIRONMENT>/<PROFILE> | xargs xdg-open

Britive API

pybritive exposes the api subcommand to query Britive APIs beyond the available commands.

For example, you may run an environment scan like so:

pybritive api scans.scan --application_id <app_id> --environment_id <env_id>

This plugin provides the vim command :BritiveAPI with tab-completion suggestions, which allows you to do the same in vim:

:BritiveAPI scans.scan --application_id <app_id> --environment_id <env_id>

The results will be displayed in a vim terminal buffer. This allows you to leverage the full capabilities and functionality of vim to query and interact with the data as you please.

TODO

  • Windows OS testing

License

MIT