2023-03-15 12:00:52 -04:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-10 21:14:03 -04:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-03-15 12:00:52 -04:00
|
|
|
|
2017-05-11 17:38:54 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"log"
|
|
|
|
|
"os"
|
|
|
|
|
|
|
|
|
|
"github.com/hashicorp/vault/plugins/database/mongodb"
|
2022-09-06 14:00:37 -04:00
|
|
|
"github.com/hashicorp/vault/sdk/database/dbplugin/v5"
|
2017-05-11 17:38:54 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
2020-10-22 17:43:19 -04:00
|
|
|
err := Run()
|
2017-05-11 17:38:54 -04:00
|
|
|
if err != nil {
|
|
|
|
|
log.Println(err)
|
|
|
|
|
os.Exit(1)
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-10-22 17:43:19 -04:00
|
|
|
|
|
|
|
|
// Run instantiates a MongoDB object, and runs the RPC server for the plugin
|
|
|
|
|
func Run() error {
|
2022-09-06 14:00:37 -04:00
|
|
|
dbplugin.ServeMultiplex(mongodb.New)
|
2020-10-22 17:43:19 -04:00
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|