credentials

package
v0.0.0-...-5a21cb2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCredential

func CreateCredential(apiKey string, credential Credential) (*http.Response, error)

CreateCredential creates a new managed credential in Tenable.io.

func DeleteCredential

func DeleteCredential(apiKey, uuid string) error

DeleteCredential deletes a managed credential by its UUID.

func UpdateCredential

func UpdateCredential(apiKey, uuid string, update CredentialUpdate) error

UpdateCredential updates the details of a managed credential by its UUID.

Types

type Credential

type Credential struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description,omitempty"`
	Type        string                 `json:"type"`
	Settings    map[string]interface{} `json:"settings"`
	Permissions []Permission           `json:"permissions,omitempty"`
}

Credential represents the request body for creating a new credential.

type CredentialDetail

type CredentialDetail struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Description string                 `json:"description,omitempty"`
	Type        string                 `json:"type"`
	Settings    map[string]interface{} `json:"settings"`
	Permissions []Permission           `json:"permissions,omitempty"`
}

CredentialDetail represents the details of a managed credential returned by Tenable.io.

func GetCredentialDetail

func GetCredentialDetail(apiKey, uuid string) (*CredentialDetail, error)

GetCredentialDetail fetches the details of a managed credential by its UUID.

type CredentialList

type CredentialList struct {
	Credentials []struct {
		ID          string `json:"id"`
		Name        string `json:"name"`
		Description string `json:"description,omitempty"`
		Type        string `json:"type"`
	} `json:"credentials"`
	// Assuming the response includes some form of pagination or total count
	Total int `json:"total"`
}

CredentialList represents a list of managed credentials.

func ListCredentials

func ListCredentials(apiKey string, options ...func(*url.Values)) (*CredentialList, error)

ListCredentials fetches a list of managed credentials with optional filtering and pagination.

type CredentialUpdate

type CredentialUpdate struct {
	Name        string                 `json:"name,omitempty"`
	Description string                 `json:"description,omitempty"`
	AdHoc       *bool                  `json:"ad_hoc,omitempty"`
	Settings    map[string]interface{} `json:"settings,omitempty"`
	Permissions []Permission           `json:"permissions,omitempty"`
}

CredentialUpdate represents the body for updating a managed credential.

type ErrorResponse

type ErrorResponse struct {
	StatusCode int    `json:"statusCode"`
	Message    string `json:"message"`
}

ErrorResponse represents a typical error response from the API.

type Permission

type Permission struct {
	Type      string `json:"type"`
	Value     int    `json:"value"`
	GranteeID string `json:"grantee_uuid,omitempty"` // Adjust as needed based on actual API requirements
}

Permission represents user permissions for the managed credential.

Jump to

Keyboard shortcuts

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