vaultsql

package module
v0.0.0-...-60c51d6 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

VaultSQL

build status

VaultSQL is a sql driver for easily supporting Hashicorp vault database secrets without having to use sidecar containers



Install

go get -u github.com/jckimble/vaultsql

Configuration

Uses all environment variables Hashicorp Vault uses along with VAULT_SECRET_PATH to set the database credentials path.

Usage

VaultSQL discovers any loaded driver then wraps it, making it easy to use for any driver that Hashicorp Vault supports

package main

import (
	"database/sql"
	_ "github.com/go-sql-driver/mysql"
	_ "github.com/jckimble/vaultsql"
	"log"
	"time"
)

func main() {
	db, err := sql.Open("vault-mysql", "{{username}}:{{password}}@tcp(127.0.0.1:3306)/database")
	if err != nil {
		panic(err)
	}
	//TODO: Work with database here
}

License

Copyright 2019 James Kimble

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

Overview

Package vaultsql provides a sql driver for easily supporting hashicorp vault database secrets without having to use sidecar containers

The driver should be used via the database/sql package along with a vault supported driver

Directories

Path Synopsis
tools

Jump to

Keyboard shortcuts

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