tpp

package
v4.24.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: Apache-2.0 Imports: 23 Imported by: 5

Documentation

Index

Constants

View Source
const (
	SSHCaRootPath = util.PathSeparator + "VED" + util.PathSeparator + "Certificate Authority" + util.PathSeparator + "SSH" + util.PathSeparator + "Templates"
)

Variables

View Source
var RevocationReasonsMap = map[string]RevocationReason{
	"":                       0,
	"none":                   0,
	"key-compromise":         1,
	"ca-compromise":          2,
	"affiliation-changed":    3,
	"superseded":             4,
	"cessation-of-operation": 5,
}

RevocationReasonsMap maps *certificate.RevocationRequest.Reason to TPP-specific webSDK codes

Functions

func GetAvailableSshTemplates added in v4.17.1

func GetAvailableSshTemplates(c *Connector) ([]certificate.SshAvaliableTemplate, error)

func NewAuthenticationError added in v4.16.1

func NewAuthenticationError(b []byte) error

func NewResponseError

func NewResponseError(b []byte) error

func ParseCertificateSearchResponse

func ParseCertificateSearchResponse(httpStatusCode int, body []byte) (searchResult *certificate.CertSearchResponse, err error)

func PolicyExist added in v4.14.0

func PolicyExist(policyName string, c *Connector) (bool, error)

func RequestSshCertificate added in v4.15.0

func RequestSshCertificate(c *Connector, req *certificate.SshCertRequest) (*certificate.SshCertificateObject, error)

func RetrieveSshCaPrincipals added in v4.15.2

func RetrieveSshCaPrincipals(c *Connector, ca *certificate.SshCaTemplateRequest) ([]string, error)

func RetrieveSshCertificate added in v4.15.0

func RetrieveSshCertificate(c *Connector, req *certificate.SshCertRequest) (*certificate.SshCertificateObject, error)

func RetrieveSshConfig added in v4.15.2

Types

type CertificateDetailsResponse

type CertificateDetailsResponse struct {
	CustomFields []struct {
		Name  string
		Value []string
	}
	Consumers []string
	Disabled  bool `json:",omitempty"`
}

type CertificateSearchInfo added in v4.22.0

type CertificateSearchInfo struct {
	CreatedOn   string
	DN          string
	Guid        string
	Name        string
	ParentDn    string
	SchemaClass string
	X509        certificate.CertificateInfo
}

type CertificateSearchResponse

type CertificateSearchResponse struct {
	Certificates []CertificateSearchInfo `json:"Certificates"`
	Count        int                     `json:"TotalCount"`
}

type ConfigReadDNRequest

type ConfigReadDNRequest struct {
	ObjectDN      string `json:",omitempty"`
	AttributeName string `json:",omitempty"`
}

type ConfigReadDNResponse

type ConfigReadDNResponse struct {
	Result int      `json:",omitempty"`
	Values []string `json:",omitempty"`
}

type Connector

type Connector struct {
	Identity identity
	// contains filtered or unexported fields
}

Connector contains the base data needed to communicate with a TPP Server

func NewConnector

func NewConnector(url string, zone string, verbose bool, trust *x509.CertPool) (*Connector, error)

NewConnector creates a new TPP Connector object used to communicate with TPP

func (*Connector) Authenticate

func (c *Connector) Authenticate(auth *endpoint.Authentication) (err error)

Authenticate authenticates the user to the TPP

func (*Connector) GenerateRequest

func (c *Connector) GenerateRequest(config *endpoint.ZoneConfiguration, req *certificate.Request) (err error)

GenerateRequest creates a new certificate request, based on the zone/policy configuration and the user data

func (*Connector) GetPolicy added in v4.14.0

func (c *Connector) GetPolicy(name string) (*policy.PolicySpecification, error)

func (*Connector) GetRefreshToken

func (c *Connector) GetRefreshToken(auth *endpoint.Authentication) (resp OauthGetRefreshTokenResponse, err error)

GetRefreshToken Get OAuth refresh and access token

func (*Connector) GetType

func (c *Connector) GetType() endpoint.ConnectorType

func (*Connector) GetZonesByParent added in v4.20.0

func (c *Connector) GetZonesByParent(parent string) ([]string, error)

GetZonesByParent returns a list of valid zones for a TPP parent folder specified by parent

func (*Connector) ImportCertificate

func (c *Connector) ImportCertificate(req *certificate.ImportRequest) (*certificate.ImportResponse, error)

func (*Connector) IsCSRServiceGenerated added in v4.16.0

func (c *Connector) IsCSRServiceGenerated(req *certificate.Request) (bool, error)

func (*Connector) ListCertificates

func (c *Connector) ListCertificates(filter endpoint.Filter) ([]certificate.CertificateInfo, error)

func (*Connector) Ping

func (c *Connector) Ping() (err error)

Ping attempts to connect to the TPP Server WebSDK API and returns an error if it cannot

func (*Connector) ReadPolicyConfiguration

func (c *Connector) ReadPolicyConfiguration() (policy *endpoint.Policy, err error)

func (*Connector) ReadZoneConfiguration

func (c *Connector) ReadZoneConfiguration() (config *endpoint.ZoneConfiguration, err error)

ReadZoneConfiguration reads the policy data from TPP to get locked and pre-configured values for certificate requests

func (*Connector) RefreshAccessToken

func (c *Connector) RefreshAccessToken(auth *endpoint.Authentication) (resp OauthRefreshAccessTokenResponse, err error)

RefreshAccessToken Refresh OAuth access token

func (*Connector) RenewCertificate

func (c *Connector) RenewCertificate(renewReq *certificate.RenewalRequest) (requestID string, err error)

RenewCertificate attempts to renew the certificate

func (*Connector) RequestCertificate

func (c *Connector) RequestCertificate(req *certificate.Request) (requestID string, err error)

RequestCertificate submits the CSR to TPP returning the DN of the requested Certificate

func (*Connector) RequestSSHCertificate added in v4.15.0

func (c *Connector) RequestSSHCertificate(req *certificate.SshCertRequest) (response *certificate.SshCertificateObject, err error)

func (*Connector) RetrieveAvailableSSHTemplates added in v4.17.1

func (c *Connector) RetrieveAvailableSSHTemplates() (response []certificate.SshAvaliableTemplate, err error)

func (*Connector) RetrieveCertificate

func (c *Connector) RetrieveCertificate(req *certificate.Request) (certificates *certificate.PEMCollection, err error)

RetrieveCertificate attempts to retrieve the requested certificate

func (*Connector) RetrieveCertificateMetaData added in v4.17.1

func (c *Connector) RetrieveCertificateMetaData(dn string) (*certificate.CertificateMetaData, error)

func (*Connector) RetrieveSSHCertificate added in v4.15.0

func (c *Connector) RetrieveSSHCertificate(req *certificate.SshCertRequest) (response *certificate.SshCertificateObject, err error)

func (*Connector) RetrieveSshConfig added in v4.15.2

func (c *Connector) RetrieveSshConfig(ca *certificate.SshCaTemplateRequest) (*certificate.SshConfig, error)

func (*Connector) RetrieveSystemVersion added in v4.22.1

func (c *Connector) RetrieveSystemVersion() (string, error)

requestSystemVersion returns the TPP system version of the connector context

func (*Connector) RevokeAccessToken added in v4.12.1

func (c *Connector) RevokeAccessToken(auth *endpoint.Authentication) (err error)

RevokeAccessToken - call to revoke token so that it can never be used again

func (*Connector) RevokeCertificate

func (c *Connector) RevokeCertificate(revReq *certificate.RevocationRequest) (err error)

RevokeCertificate attempts to revoke the certificate

func (*Connector) SearchCertificate added in v4.22.0

func (c *Connector) SearchCertificate(zone string, cn string, sans *certificate.Sans, certMinTimeLeft time.Duration) (certificateInfo *certificate.CertificateInfo, err error)

func (*Connector) SearchCertificates added in v4.17.0

func (c *Connector) SearchCertificates(req *certificate.SearchRequest) (*certificate.CertSearchResponse, error)

func (*Connector) SetHTTPClient

func (c *Connector) SetHTTPClient(client *http.Client)

func (*Connector) SetPolicy added in v4.14.0

func (c *Connector) SetPolicy(name string, ps *policy.PolicySpecification) (string, error)

func (*Connector) SetZone

func (c *Connector) SetZone(z string)

func (*Connector) VerifyAccessToken added in v4.12.1

func (c *Connector) VerifyAccessToken(auth *endpoint.Authentication) (resp OauthVerifyTokenResponse, err error)

VerifyAccessToken - call to check whether token is valid and, if so, return its properties

type DNToGUIDRequest added in v4.17.1

type DNToGUIDRequest struct {
	ObjectDN string `json:"ObjectDN"`
}

type DNToGUIDResponse added in v4.17.1

type DNToGUIDResponse struct {
	ClassName        string `json:"ClassName"`
	GUID             string `json:"GUID"`
	HierarchicalGUID string `json:"HierarchicalGUID"`
	Result           int    `json:"Result"`
	Revision         int    `json:"Revision"`
}

type OauthGetRefreshTokenResponse

type OauthGetRefreshTokenResponse struct {
	Access_token  string `json:"access_token,omitempty"`
	Expires       int    `json:"expires,omitempty"`
	ExpiresIn     int    `json:"expires_in,omitempty"` //Attribute added as it's used on vSSH
	Identity      string `json:"identity,omitempty"`
	Refresh_token string `json:"refresh_token,omitempty"`
	Refresh_until int    `json:"refresh_until,omitempty"`
	Scope         string `json:"scope,omitempty"`
	Token_type    string `json:"token_type,omitempty"`
}

type OauthRefreshAccessTokenResponse

type OauthRefreshAccessTokenResponse struct {
	Access_token  string `json:"access_token,omitempty"`
	Expires       int    `json:"expires,omitempty"`
	Identity      string `json:"identity,omitempty"`
	Refresh_token string `json:"refresh_token,omitempty"`
	Refresh_until int    `json:"refresh_until,omitempty"`
	Token_type    string `json:"token_type,omitempty"`
}

type OauthVerifyTokenResponse added in v4.12.1

type OauthVerifyTokenResponse struct {
	AccessIssuedOn string `json:"access_issued_on_ISO8601,omitempty"`
	ClientID       string `json:"application,omitempty"`
	Expires        string `json:"expires_ISO8601,omitempty"`
	GrantIssuedOn  string `json:"grant_issued_on_ISO8601,omitempty"`
	Identity       string `json:"identity,omitempty"`
	Scope          string `json:"scope,omitempty"`
	ValidFor       int    `json:"valid_for,omitempty"`
}

type RevocationReason

type RevocationReason int

type SearchRequest

type SearchRequest []string

Jump to

Keyboard shortcuts

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