server

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 13 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvanceAuthResponse added in v2.0.1

type AdvanceAuthResponse struct {
	Success         bool              `json:"success"`
	Result          AdvanceAuthResult `json:"Result"`
	Message         interface{}       `json:"Message"`
	MessageID       interface{}       `json:"MessageID"`
	Exception       interface{}       `json:"Exception"`
	ErrorID         interface{}       `json:"ErrorID"`
	ErrorCode       interface{}       `json:"ErrorCode"`
	IsSoftError     bool              `json:"IsSoftError"`
	InnerExceptions interface{}       `json:"InnerExceptions"`
}

type AdvanceAuthResult added in v2.0.1

type AdvanceAuthResult struct {
	AuthLevel     string      `json:"AuthLevel"`
	DisplayName   string      `json:"DisplayName"`
	OAuthTokens   OAuthTokens `json:"OAuthTokens"`
	UserId        string      `json:"UserId"`
	EmailAddress  string      `json:"EmailAddress"`
	UserDirectory string      `json:"UserDirectory"`
	StartingPoint string      `json:"StartingPoint"`
	PodFqdn       string      `json:"PodFqdn"`
	User          string      `json:"User"`
	CustomerID    string      `json:"CustomerID"`
	SystemID      string      `json:"SystemID"`
	SourceDsType  string      `json:"SourceDsType"`
	Summary       string      `json:"Summary"`
}

type Challenge added in v2.0.1

type Challenge struct {
	Mechanisms []Mechanism `json:"Mechanisms"`
}

type ClientHints added in v2.0.1

type ClientHints struct {
	PersistDefault      bool   `json:"PersistDefault"`
	AllowPersist        bool   `json:"AllowPersist"`
	AllowForgotPassword bool   `json:"AllowForgotPassword"`
	StartingPoint       string `json:"StartingPoint"`
	RequestedUsername   string `json:"RequestedUsername"`
}

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 Connection struct {
	Url            string `json:"url"`
	OAuthProfileId string `json:"oAuthProfileId"`
}

type Mechanism added in v2.0.1

type Mechanism struct {
	AnswerType       string `json:"AnswerType"`
	Name             string `json:"Name"`
	PromptMechChosen string `json:"PromptMechChosen"`
	PromptSelectMech string `json:"PromptSelectMech"`
	MechanismId      string `json:"MechanismId"`
}

type OAuthTokens added in v2.0.1

type OAuthTokens struct {
	AccessToken      string `json:"access_token"`
	RefreshToken     string `json:"refresh_token"`
	IdToken          string `json:"id_token"`
	TokenType        string `json:"token_type"`
	ExpiresIn        int    `json:"expires_in"`
	SessionExpiresIn int    `json:"session_expires_in"`
	Scope            string `json:"scope"`
}

type Response added in v2.0.1

type Response struct {
	Healthy               bool `json:"healthy"`
	DatabaseHealthy       bool `json:"databaseHealthy"`
	ServiceBusHealthy     bool `json:"serviceBusHealthy"`
	StorageAccountHealthy bool `json:"storageAccountHealthy"`
	ScheduledForDeletion  bool `json:"scheduledForDeletion"`
}

type Result added in v2.0.1

type Result struct {
	ClientHints        ClientHints `json:"ClientHints"`
	Version            string      `json:"Version"`
	SessionId          string      `json:"SessionId"`
	AllowLoginMfaCache bool        `json:"AllowLoginMfaCache"`
	Challenges         []Challenge `json:"Challenges"`
	Summary            string      `json:"Summary"`
	TenantId           string      `json:"TenantId"`
}

type SearchResult added in v2.0.1

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 added in v2.0.1

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 StartAuthResponse added in v2.0.1

type StartAuthResponse struct {
	Success         bool        `json:"success"`
	Result          Result      `json:"Result"`
	Message         interface{} `json:"Message"`
	MessageID       interface{} `json:"MessageID"`
	Exception       interface{} `json:"Exception"`
	ErrorID         interface{} `json:"ErrorID"`
	ErrorCode       interface{} `json:"ErrorCode"`
	IsSoftError     bool        `json:"IsSoftError"`
	InnerExceptions interface{} `json:"InnerExceptions"`
}

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 Vault added in v2.0.1

type Vault struct {
	VaultId         string     `json:"vaultId"`
	Name            string     `json:"name"`
	Type            string     `json:"type"`
	IsDefault       bool       `json:"isDefault"`
	IsGlobalDefault bool       `json:"isGlobalDefault"`
	IsActive        bool       `json:"isActive"`
	Connection      Connection `json:"connection"`
}

type VaultsResponseModel added in v2.0.1

type VaultsResponseModel struct {
	Vaults []Vault `json:"vaults"`
}

Jump to

Keyboard shortcuts

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