2025-10-21 17:20:20 -04:00
|
|
|
// Copyright IBM Corp. 2016, 2025
|
2023-08-10 21:14:03 -04:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-03-15 12:00:52 -04:00
|
|
|
|
2017-04-13 16:48:32 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2017-05-03 16:01:05 -04:00
|
|
|
"log"
|
2017-04-13 16:48:32 -04:00
|
|
|
"os"
|
|
|
|
|
|
|
|
|
|
"github.com/hashicorp/vault/plugins/database/postgresql"
|
2022-09-06 14:00:37 -04:00
|
|
|
"github.com/hashicorp/vault/sdk/database/dbplugin/v5"
|
2017-04-13 16:48:32 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
2020-10-22 17:43:19 -04:00
|
|
|
err := Run()
|
2017-04-13 16:48:32 -04:00
|
|
|
if err != nil {
|
2017-05-03 16:01:05 -04:00
|
|
|
log.Println(err)
|
2017-04-13 16:48:32 -04:00
|
|
|
os.Exit(1)
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-10-22 17:43:19 -04:00
|
|
|
|
|
|
|
|
// Run instantiates a PostgreSQL object, and runs the RPC server for the plugin
|
|
|
|
|
func Run() error {
|
2022-09-06 14:00:37 -04:00
|
|
|
dbplugin.ServeMultiplex(postgresql.New)
|
2020-10-22 17:43:19 -04:00
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|