server

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Credentials            UserCredential
	ServerURL, TLD, Tenant string
	TLSClientConfig        *tls.Config
	// contains filtered or unexported fields
}

Configuration settings for the API

type SearchResult

type SearchResult struct {
	SearchText string
	Records    []Secret
}

type Secret

type Secret struct {
	Name                                                                       string
	FolderID, ID, SiteID, SecretTemplateID                                     int
	SecretPolicyID, PasswordTypeWebScriptID                                    int `json:",omitempty"`
	LauncherConnectAsSecretID, CheckOutIntervalMinutes                         int
	Active, CheckedOut, CheckOutEnabled                                        bool
	AutoChangeEnabled, CheckOutChangePasswordEnabled, DelayIndexing            bool
	EnableInheritPermissions, EnableInheritSecretPolicy, ProxyEnabled          bool
	RequiresComment, SessionRecordingEnabled, WebLauncherRequiresIncognitoMode bool
	Fields                                                                     []SecretField `json:"Items"`
	SshKeyArgs                                                                 *SshKeyArgs   `json:",omitempty"`
}

Secret represents a secret from Delinea Secret Server

func (Secret) Field

func (s Secret) Field(fieldName string) (string, bool)

Field returns the value of the field with the name fieldName

func (Secret) FieldById

func (s Secret) FieldById(fieldId int) (string, bool)

FieldById returns the value of the field with the given field ID

type SecretField

type SecretField struct {
	ItemID, FieldID, FileAttachmentID     int
	FieldName, Slug                       string
	FieldDescription, Filename, ItemValue string
	IsFile, IsNotes, IsPassword           bool
}

SecretField is an item (field) in the secret

type SecretTemplate

type SecretTemplate struct {
	Name   string
	ID     int
	Fields []SecretTemplateField
}

SecretTemplate represents a secret template from Delinea Secret Server

func (SecretTemplate) FieldIdToSlug

func (s SecretTemplate) FieldIdToSlug(fieldId int) (string, bool)

FieldIdToSlug returns the shorthand alias (aka: "slug") of the field with the given field ID, and a boolean indicating whether the given ID actually identifies a field for the secret template.

func (SecretTemplate) FieldSlugToId

func (s SecretTemplate) FieldSlugToId(slug string) (int, bool)

FieldSlugToId returns the field ID for the given shorthand alias (aka: "slug") of the field, and a boolean indicating whether the given slug actually identifies a field for the secret template.

func (SecretTemplate) GetField

func (s SecretTemplate) GetField(slug string) (*SecretTemplateField, bool)

GetField returns the field with the given shorthand alias (aka: "slug"), and a boolean indicating whether the given slug actually identifies a field for the secret template .

type SecretTemplateField

type SecretTemplateField struct {
	SecretTemplateFieldID                                   int
	FieldSlugName, DisplayName, Description, Name, ListType string
	IsFile, IsList, IsNotes, IsPassword, IsRequired, IsUrl  bool
}

SecretTemplateField is a field in the secret template

type Server

type Server struct {
	Configuration
}

Server provides access to secrets stored in Delinea Secret Server

func New

func New(config Configuration) (*Server, error)

New returns an initialized Secrets object

func (Server) CreateSecret

func (s Server) CreateSecret(secret Secret) (*Secret, error)

func (Server) DeleteSecret

func (s Server) DeleteSecret(id int) error

func (Server) GeneratePassword

func (s Server) GeneratePassword(slug string, template *SecretTemplate) (string, error)

GeneratePassword generates and returns a password for the secret field identified by the given slug on the given template. The password adheres to the password requirements associated with the field. NOTE: this should only be used with fields whose IsPassword property is true.

func (Server) Secret

func (s Server) Secret(id int) (*Secret, error)

Secret gets the secret with id from the Secret Server of the given tenant

func (Server) SecretTemplate

func (s Server) SecretTemplate(id int) (*SecretTemplate, error)

SecretTemplate gets the secret template with id from the Secret Server of the given tenant

func (Server) Secrets

func (s Server) Secrets(searchText, field string) ([]Secret, error)

Secret gets the secret with id from the Secret Server of the given tenant

func (Server) UpdateSecret

func (s Server) UpdateSecret(secret Secret) (*Secret, error)

type SshKeyArgs

type SshKeyArgs struct {
	GeneratePassphrase, GenerateSshKeys bool
}

SshKeyArgs control whether to generate an SSH key pair and a private key passphrase when the secret template supports such generation.

WARNING: this struct is only used for write _request_ bodies, and will not be present in _response_ bodies.

type UserCredential

type UserCredential struct {
	Domain, Username, Password, Token string
}

UserCredential holds the username and password that the API should use to authenticate to the REST API

Jump to

Keyboard shortcuts

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