common

package
v0.0.0-...-e313fe3 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERR_SIGNIN_MISSING_ARGS = "Missing username or password or both"
	MSG_METHOD_START        = "Entering method - "
	MSG_METHOD_END          = "Exiting method - "
	ERR_METHOD_END          = "Exiting method with error - "
)
View Source
const (
	URL_USER_MANAGEMENT       = "api/v1/usermgmt/users"
	URL_KEY_MANAGEMENT        = "api/v1/vault/keys2"
	URL_SIGNIN                = "api/v1/auth/tokens"
	URL_GROUP                 = "api/v1/usermgmt/groups"
	URL_DOMAIN                = "api/v1/domains"
	URL_INTERFACE             = "api/v1/configs/interfaces"
	URL_CTE_PROCESS_SET       = "api/v1/transparent-encryption/processsets"
	URL_CTE_USER_SET          = "api/v1/transparent-encryption/usersets"
	URL_CTE_RESOURCE_SET      = "api/v1/transparent-encryption/resourcesets"
	URL_CTE_SIGNATURE_SET     = "api/v1/transparent-encryption/signaturesets"
	URL_CTE_POLICY            = "api/v1/transparent-encryption/policies"
	URL_CTE_CLIENT            = "api/v1/transparent-encryption/clients"
	URL_CTE_CLIENT_GROUP      = "api/v1/transparent-encryption/clientgroups"
	URL_CTE_PROFILE           = "api/v1/transparent-encryption/profiles"
	URL_CTE_CSIGROUP          = "api/v1/transparent-encryption/csigroups"
	URL_REG_TOKEN             = "api/v1/client-management/regtokens"
	URL_LOCAL_CA              = "api/v1/ca/local-cas"
	URL_SSH_KEY               = "api/v1/system/ssh/keys"
	URL_CHANGE_USER_PWD       = "api/v1/auth/changepw"
	URL_LDT_GROUP_COMM_SVC    = "api/v1/transparent-encryption/ldtgroupcommservice"
	URL_NEW_CLUSTER           = "api/v1/cluster/new"
	URL_CREATE_CSR            = "api/v1/cluster/csr"
	URL_SIGN_CERT             = "api/v1/nodes"
	URL_CLUSTER_JOIN          = "api/v1/cluster/join"
	URL_CLUSTER_INFO          = "api/v1/cluster"
	URL_TRIAL_LICENSE         = "api/v1/licensing/trials"
	URL_SCP_CONNECTION        = "api/v1/connectionmgmt/services/scp/connections"
	URL_PROMETHEUS_ENABLE     = "api//v1/system/metrics/prometheus/enable"
	URL_PROMETHEUS_DISABLE    = "api//v1/system/metrics/prometheus/disable"
	URL_PROMETHEUS_STATUS     = "api/v1/system/metrics/prometheus/status"
	URL_SCHEDULER_JOB_CONFIGS = "api/v1/scheduler/job-configs"
	// CCKM Endpoints
	URL_AWS_CONNECTION   = "api/v1/connectionmgmt/services/aws/connections"
	URL_AWS_KMS          = "api/v1/cckm/aws/kms"
	URL_AWS_XKS          = "api/v1/cckm/aws/custom-key-stores"
	URL_HSM_SETUP        = "api/v1/system/hsm/setup"
	URL_HSM_Server       = "api/v1/system/hsm/servers"
	URL_AWS_KEY          = "api/v1/cckm/aws/keys"
	URL_GCP_CONNECTION   = "api/v1/connectionmgmt/services/gcp/connections"
	URL_AZURE_CONNECTION = "api/v1/connectionmgmt/services/azure/connections"
)
View Source
const CipherTrustURL string = "https://10.10.10.10"

Default CipherTrust Manager URL

Variables

This section is empty.

Functions

func LogEntryExit

func LogEntryExit(f func() error) func() error

logEntryExit is a function that wraps another function to log its entry and exit.

func NewListUseStateForUnknown

func NewListUseStateForUnknown() planmodifier.List

func NewObjectUseStateForUnknown

func NewObjectUseStateForUnknown() planmodifier.Object

func ParseArray

func ParseArray(response string, paramName string) types.List

func ParseMap

func ParseMap(response string, diagnostics *diag.Diagnostics, paramName string) types.Map

func TrimString

func TrimString(data string) string

Types

type AuthResponse

type AuthResponse struct {
	Token string `json:"jwt"`
}

AuthResponse

type AuthStruct

type AuthStruct struct {
	Username   string `json:"username"`
	Password   string `json:"password"`
	AuthDomain string `json:"auth_domain"`
	Domain     string `json:"domain"`
}

AuthStruct

type CMClientBootstrap

type CMClientBootstrap struct {
	CipherTrustURL string
	HTTPClient     *http.Client
}

Bootstrap Client for CipherTrust Manager

func NewCMClientBoot

func NewCMClientBoot(ctx context.Context, uuid string, address *string) (*CMClientBootstrap, error)

Create new client for CM with auth details Usable for som bootstrap API calls

func (*CMClientBootstrap) PatchDataBootstrap

func (c *CMClientBootstrap) PatchDataBootstrap(ctx context.Context, uuid string, endpoint string, data []byte) (string, error)

func (*CMClientBootstrap) PostDataBootstrap

func (c *CMClientBootstrap) PostDataBootstrap(ctx context.Context, uuid string, endpoint string, data []byte, id string) (string, error)

type Client

type Client struct {
	CipherTrustURL string
	HTTPClient     *http.Client
	Token          string
	AuthData       AuthStruct
}

Client

func NewClient

func NewClient(ctx context.Context, uuid string, address, auth_domain, domain, username, password *string) (*Client, error)

Create New Client for CipherTrust Manager

func (*Client) DeleteByID

func (c *Client) DeleteByID(ctx context.Context, method string, uuid string, url string, Body []byte) (string, error)

func (*Client) DeleteByURL

func (c *Client) DeleteByURL(ctx context.Context, uuid string, endpoint string) (string, error)

func (*Client) GetAll

func (c *Client) GetAll(ctx context.Context, uuid string, endpoint string) (string, error)

func (*Client) GetById

func (c *Client) GetById(ctx context.Context, uuid string, id string, endpoint string) (string, error)

func (*Client) PostData

func (c *Client) PostData(ctx context.Context, uuid string, endpoint string, data []byte, id string) (string, error)

func (*Client) PostDataV2

func (c *Client) PostDataV2(ctx context.Context, uuid string, endpoint string, data []byte) (string, error)

func (*Client) ReadDataByParam

func (c *Client) ReadDataByParam(ctx context.Context, uuid string, id string, endpoint string) (string, error)

func (*Client) SignIn

func (c *Client) SignIn(ctx context.Context, uuid string) (*AuthResponse, error)

SignIn - Get a new token for user. This will take username and password as arguments and send them to CipherTrust Manager to acquire token

func (*Client) UpdateData

func (c *Client) UpdateData(ctx context.Context, uuid string, endpoint string, data []byte, id string) (string, error)

func (*Client) UpdateDataFullURL

func (c *Client) UpdateDataFullURL(ctx context.Context, uuid string, endpoint string, data []byte, id string) (string, error)

func (*Client) UpdateDataV2

func (c *Client) UpdateDataV2(ctx context.Context, uuid string, endpoint string, data []byte) (string, error)

type ListUseStateForUnknown

type ListUseStateForUnknown struct{}

ListUseStateForUnknown is a custom plan modifier for SingleNestedAttribute.

func (ListUseStateForUnknown) Description

func (m ListUseStateForUnknown) Description(ctx context.Context) string

func (ListUseStateForUnknown) MarkdownDescription

func (m ListUseStateForUnknown) MarkdownDescription(ctx context.Context) string

func (ListUseStateForUnknown) PlanModifyList

type ObjectUseStateForUnknown

type ObjectUseStateForUnknown struct{}

ObjectUseStateForUnknown is a custom plan modifier for SingleNestedAttribute.

func (ObjectUseStateForUnknown) Description

func (m ObjectUseStateForUnknown) Description(ctx context.Context) string

func (ObjectUseStateForUnknown) MarkdownDescription

func (m ObjectUseStateForUnknown) MarkdownDescription(ctx context.Context) string

func (ObjectUseStateForUnknown) PlanModifyObject

Jump to

Keyboard shortcuts

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