Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(v2): conn manager, dbproxy, hoststore, rolestore, vault, nam, userstore #164

Merged
merged 5 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
460 changes: 225 additions & 235 deletions api/connectionmanager/client.go

Large diffs are not rendered by default.

306 changes: 151 additions & 155 deletions api/connectionmanager/model.go

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions api/dbproxy/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,38 @@
package dbproxy

import (
"github.com/SSHcom/privx-sdk-go/common"
"github.com/SSHcom/privx-sdk-go/api/response"
"github.com/SSHcom/privx-sdk-go/restapi"
)

// DbProxy is a db proxy instance.
// DbProxy is a db proxy client instance.
type DbProxy struct {
api restapi.Connector
}

// New creates a new db proxy client instance, using the
// argument SDK API client.
// New db proxy client constructor.
func New(api restapi.Connector) *DbProxy {
return &DbProxy{api: api}
}

// DbProxyStatus get microservice status
func (store *DbProxy) DbProxyStatus() (*common.ServiceStatus, error) {
status := &common.ServiceStatus{}
// MARK: Status
// Status get db proxy microservice status.
func (c *DbProxy) Status() (*response.ServiceStatus, error) {
status := &response.ServiceStatus{}

_, err := store.api.
_, err := c.api.
URL("/db-proxy/api/v1/status").
Get(status)

return status, err
}

// DbProxyConf get db proxy configuration
func (store *DbProxy) DbProxyConf() (*DBProxyConf, error) {
config := &DBProxyConf{}
// MARK: Config
// GetDbProxyConfig get db proxy configuration.
func (c *DbProxy) GetDbProxyConfig() (*DBProxyAPIConf, error) {
config := &DBProxyAPIConf{}

_, err := store.api.
_, err := c.api.
URL("/db-proxy/api/v1/conf").
Get(config)

Expand Down
6 changes: 3 additions & 3 deletions api/dbproxy/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

package dbproxy

// DBProxyCACertificateInfo DB proxy x509 CA certificate information
// DBProxyCACertificateInfo db proxy x509 CA certificate definition.
type DBProxyCACertificateInfo struct {
Subject string `json:"subject,omitempty"`
Issuer string `json:"issuer,omitempty"`
Expand All @@ -17,8 +17,8 @@ type DBProxyCACertificateInfo struct {
FingerPrintSHA256 string `json:"fingerprint_sha256,omitempty"`
}

// DBProxyConf DB proxy config definition
type DBProxyConf struct {
// DBProxyAPIConf db proxy configuration definition.
type DBProxyAPIConf struct {
CACertificate *DBProxyCACertificateInfo `json:"ca_certificate,omitempty"`
Chain string `json:"ca_certificate_chain,omitempty"`
}
Loading
Loading