security

package
v0.5.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package security contains common methods regarding encryption and passwords.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandOraclePassword

func RandOraclePassword() (string, error)

RandOraclePassword returns a random password containing letters and numbers. It is caller's responsibility to handle the error.

func SetupConnStringOnServer

func SetupConnStringOnServer(ctx context.Context, onServer runSQLOnServer, username, db, DBDomain string) (string, string, error)

SetupConnStringOnServer generates and sets a random password for the given user on the DB server and returns the connection string without user/password part and the generated password.

func SetupUserPwConnStringByClient

func SetupUserPwConnStringByClient(ctx context.Context, onClient runSQLOnClient, username, db, DBDomain string) (string, error)

SetupUserPwConnStringByClient sets the password for the given user to a randomized password with the client and returns the connection string.

func SetupUserPwConnStringOnServer

func SetupUserPwConnStringOnServer(ctx context.Context, onServer runSQLOnServer, username, db, DBDomain string) (string, error)

SetupUserPwConnStringOnServer sets the password for the given user to a randomized password on the DB server and returns the connection string.

Types

type Security

type Security struct {
	// contains filtered or unexported fields
}

Security provides login and encryption methods.

func (*Security) Close

func (s *Security) Close() error

Close closes any Security resources and connections.

func (*Security) SetupUserPwConnString

func (s *Security) SetupUserPwConnString(ctx context.Context, username, db, DBDomain string) (string, error)

SetupUserPwConnString sets the password for the given user to a randomized password and returns the connection string.

Jump to

Keyboard shortcuts

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