Documentation
¶
Index ¶
- type Configuration
- type Connection
- type OAuthTokens
- type Response
- type SearchResult
- type Secret
- type SecretField
- type SecretTemplate
- type SecretTemplateField
- type Server
- func (s Server) CreateSecret(secret Secret) (*Secret, error)
- func (s Server) DeleteSecret(id int) error
- func (s Server) GeneratePassword(slug string, template *SecretTemplate) (string, error)
- func (s Server) Secret(id int) (*Secret, error)
- func (s Server) SecretTemplate(id int) (*SecretTemplate, error)
- func (s Server) Secrets(searchText, field string) ([]Secret, error)
- func (s Server) UpdateSecret(secret Secret) (*Secret, error)
- type SshKeyArgs
- type TokenCache
- type UserCredential
- type Vault
- type VaultsResponseModel
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 Connection ¶ added in v2.0.1
type OAuthTokens ¶ added in v2.0.1
type SearchResult ¶ added in v2.0.1
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
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) DeleteSecret ¶
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) SecretTemplate ¶
func (s Server) SecretTemplate(id int) (*SecretTemplate, error)
SecretTemplate gets the secret template with id from the Secret Server of the given tenant
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 TokenCache ¶ added in v2.0.3
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
type VaultsResponseModel ¶ added in v2.0.1
type VaultsResponseModel struct {
Vaults []Vault `json:"vaults"`
}