auth_config

package
v0.0.1-rc.13 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeConfigFromFile

func MergeConfigFromFile(filePath string, config *Config) error

MergeConfigFromFile merges the configuration from a file into the existing Config.

func WriteConfigToJSON

func WriteConfigToJSON(filePath string, config *Config) error

WriteConfigToJSON writes a Config configuration to a JSON file.

func WriteConfigToYAML

func WriteConfigToYAML(filePath string, config *Config) error

WriteConfigToYAML writes a Config configuration to a YAML file.

func WriteServerToJSON

func WriteServerToJSON(filePath string, server *Server) error

WriteServerToJSON writes a Server configuration to a JSON file.

func WriteServerToYAML

func WriteServerToYAML(filePath string, server *Server) error

WriteServerToYAML writes a Server configuration to a YAML file.

Types

type AuthProvider

type AuthProvider struct {
	Type       string                 `json:"type,omitempty" yaml:"type,omitempty"`             // Type is the type of authentication provider.
	Profile    string                 `json:"profile,omitempty" yaml:"profile,omitempty"`       // Profile is the profile of the authentication provider.
	Parameters map[string]interface{} `json:"parameters,omitempty" yaml:"parameters,omitempty"` // Parameters are additional parameters for the authentication provider.
}

AuthProvider represents the authentication provider configuration.

type Config

type Config struct {
	Servers map[string]Server `json:"servers,omitempty" yaml:"servers,omitempty"` // Servers is a map of server configurations.
}

Config represents the overall configuration structure.

func NewConfig

func NewConfig() *Config

func ReadConfigFromJSON

func ReadConfigFromJSON(filePath string) (*Config, error)

ReadConfigFromJSON reads a Config configuration from a JSON file.

type Server

type Server struct {
	Host string `json:"host,omitempty" yaml:"host,omitempty"` // Host is the Command server DNS name or IP address.
	Port int    `json:"port,omitempty" yaml:"port,omitempty"` // Port is the Command server port.
	//AuthPort      int          `json:"auth_port,omitempty" yaml:"auth_port,omitempty"`             // AuthPort is the authentication port.
	Username      string       `json:"username,omitempty" yaml:"username,omitempty"`               // Username is the username for authentication.
	Password      string       `json:"password,omitempty" yaml:"password,omitempty"`               // Password is the password for authentication.
	Domain        string       `json:"domain,omitempty" yaml:"domain,omitempty"`                   // Domain is the domain for authentication.
	ClientID      string       `json:"client_id,omitempty" yaml:"client_id,omitempty"`             // ClientID is the client ID for OAuth.
	ClientSecret  string       `json:"client_secret,omitempty" yaml:"client_secret,omitempty"`     // ClientSecret is the client secret for OAuth.
	OAuthTokenUrl string       `json:"token_url,omitempty" yaml:"token_url,omitempty"`             // OAuthTokenUrl is full URL for OAuth token request endpoint.
	APIPath       string       `json:"api_path,omitempty" yaml:"api_path,omitempty"`               // APIPath is the API path.
	AuthProvider  AuthProvider `json:"auth_provider,omitempty" yaml:"auth_provider,omitempty"`     // AuthProvider contains the authentication provider details.
	SkipTLSVerify bool         `json:"skip_tls_verify,omitempty" yaml:"skip_tls_verify,omitempty"` // TLSVerify determines whether to verify the TLS certificate.
	CACertPath    string       `json:"ca_cert_path,omitempty" yaml:"ca_cert_path,omitempty"`       // CACertPath is the path to the CA certificate to trust.
	AuthType      string       `json:"auth_type,omitempty" yaml:"auth_type, omitempty"`            // AuthType is the type of authentication to use.

}

Server represents the server configuration for authentication.

func ReadServerFromJSON

func ReadServerFromJSON(filePath string) (*Server, error)

ReadServerFromJSON reads a Server configuration from a JSON file.

func ReadServerFromYAML

func ReadServerFromYAML(filePath string) (*Server, error)

ReadServerFromYAML reads a Server configuration from a YAML file.

func (*Server) GetAuthType

func (s *Server) GetAuthType() string

Jump to

Keyboard shortcuts

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