model

package
v0.0.0-...-6d13c91 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TokenFormat                       = "?token=%s"
	CertsEndpoint                     = "/v1/applications/certificates"
	ManagementInfoEndpoint            = "/v1/applications/management/info"
	ApplicationRegistryEndpointFormat = "/%s/v1/metadata/services"
	EventsInfoEndpoint                = "/subscribed"
	RenewCertURLFormat                = "%s/v1/applications/certificates/renewals"
	RevocationCertURLFormat           = "%s/v1/applications/certificates/revocations"
)

Variables

This section is empty.

Functions

func IsXML

func IsXML(content string) bool

Types

type API

type API struct {
	TargetUrl                      string               `json:"targetUrl" valid:"url,required~targetUrl field cannot be empty."`
	Credentials                    *CredentialsWithCSRF `json:"credentials,omitempty"`
	Spec                           *SpecResponse        `json:"spec,omitempty"`
	SpecificationUrl               string               `json:"specificationUrl,omitempty"`
	ApiType                        string               `json:"apiType,omitempty"`
	RequestParameters              *RequestParameters   `json:"requestParameters,omitempty"`
	SpecificationCredentials       *Credentials         `json:"specificationCredentials,omitempty"`
	SpecificationRequestParameters *RequestParameters   `json:"specificationRequestParameters,omitempty"`
	Headers                        *map[string][]string `json:"headers,omitempty"`
	QueryParameters                *map[string][]string `json:"queryParameters,omitempty"`
}

type Api

type Api struct {
	*RuntimeURLs
	InfoURL         string `json:"infoUrl"`
	CertificatesURL string `json:"certificatesUrl"`
}

type BasicAuth

type BasicAuth struct {
	Username string `json:"username" valid:"required~basic auth username field cannot be empty"`
	Password string `json:"password" valid:"required~basic auth password field cannot be empty"`
}

type BasicAuthWithCSRF

type BasicAuthWithCSRF struct {
	BasicAuth
	CSRFInfo *CSRFInfo `json:"csrfInfo,omitempty"`
}

type CSRFInfo

type CSRFInfo struct {
	TokenEndpointURL string `json:"tokenEndpointURL" valid:"url,required~tokenEndpointURL field cannot be empty"`
}

type CSRInfoResponse

type CSRInfoResponse struct {
	CsrURL          string   `json:"csrUrl"`
	API             Api      `json:"api"`
	CertificateInfo CertInfo `json:"certificate"`
}

type CertInfo

type CertInfo struct {
	Subject      string `json:"subject"`
	Extensions   string `json:"extensions"`
	KeyAlgorithm string `json:"key-algorithm"`
}

func ToCertInfo

func ToCertInfo(signingRequestInfo *schema.CertificateSigningRequestInfo) CertInfo

type CertRequest

type CertRequest struct {
	CSR string `json:"csr"`
}

type CertResponse

type CertResponse struct {
	CRTChain  string `json:"crt"`
	ClientCRT string `json:"clientCrt"`
	CaCRT     string `json:"caCrt"`
}

func ToCertResponse

func ToCertResponse(certificationResult schema.CertificationResult) CertResponse

type CertificateGen

type CertificateGen struct {
	CommonName  string `json:"commonName"`
	Certificate string `json:"certificate"`
}

type CertificateGenWithCSRF

type CertificateGenWithCSRF struct {
	CertificateGen
	CSRFInfo *CSRFInfo `json:"csrfInfo,omitempty"`
}

type ClientIdentity

type ClientIdentity struct {
	Application string `json:"application"`
	Group       string `json:"group,omitempty"`
	Tenant      string `json:"tenant,omitempty"`
}

type CreateServiceResponse

type CreateServiceResponse struct {
	ID string `json:"id"`
}

type Credentials

type Credentials struct {
	Oauth *Oauth     `json:"oauth,omitempty"`
	Basic *BasicAuth `json:"basic,omitempty"`
}

type CredentialsWithCSRF

type CredentialsWithCSRF struct {
	OauthWithCSRF          *OauthWithCSRF          `json:"oauth,omitempty"`
	BasicWithCSRF          *BasicAuthWithCSRF      `json:"basic,omitempty"`
	CertificateGenWithCSRF *CertificateGenWithCSRF `json:"certificateGen,omitempty"`
}

type DocsObject

type DocsObject struct {
	Title  string `json:"title"`
	Type   string `json:"type"`
	Source string `json:"source"`
}

type Documentation

type Documentation struct {
	DisplayName string       `json:"displayName" valid:"required~displayName field cannot be empty in documentation"`
	Description string       `json:"description" valid:"required~description field cannot be empty in documentation"`
	Type        string       `json:"type" valid:"required~type field cannot be empty in documentation"`
	Tags        []string     `json:"tags,omitempty"`
	Docs        []DocsObject `json:"docs,omitempty"`
}

type Events

type Events struct {
	Spec *SpecResponse `json:"spec" valid:"required~spec cannot be empty"`
}

type InfoProviderFunc

type InfoProviderFunc func(applicationName string, eventServiceBaseURL, tenant string, configuration schema.Configuration) (interface{}, error)

func NewCSRInfoResponseProvider

func NewCSRInfoResponseProvider(connectivityAdapterBaseURL, connectivityAdapterMTLSBaseURL string) InfoProviderFunc

func NewManagementInfoResponseProvider

func NewManagementInfoResponseProvider(connectivityAdapterMTLSBaseURL string) InfoProviderFunc

type MgmtInfoReponse

type MgmtInfoReponse struct {
	ClientIdentity  ClientIdentity `json:"clientIdentity"`
	URLs            MgmtURLs       `json:"urls"`
	CertificateInfo CertInfo       `json:"certificate"`
}

type MgmtURLs

type MgmtURLs struct {
	*RuntimeURLs
	RenewCertURL  string `json:"renewCertUrl"`
	RevokeCertURL string `json:"revokeCertUrl"`
}

type Oauth

type Oauth struct {
	URL               string             `json:"url" valid:"url,required~oauth url field cannot be empty"`
	ClientID          string             `json:"clientId" valid:"required~oauth clientId field cannot be empty"`
	ClientSecret      string             `json:"clientSecret" valid:"required~oauth clientSecret cannot be empty"`
	RequestParameters *RequestParameters `json:"requestParameters,omitempty"`
}

type OauthWithCSRF

type OauthWithCSRF struct {
	Oauth
	CSRFInfo *CSRFInfo `json:"csrfInfo,omitempty"`
}

type RequestParameters

type RequestParameters struct {
	Headers         *map[string][]string `json:"headers,omitempty"`
	QueryParameters *map[string][]string `json:"queryParameters,omitempty"`
}

type RuntimeURLs

type RuntimeURLs struct {
	EventsInfoURL string `json:"eventsInfoUrl"`
	EventsURL     string `json:"eventsUrl"`
	MetadataURL   string `json:"metadataUrl"`
}

type Service

type Service struct {
	ID          string             `json:"id"`
	Provider    string             `json:"provider"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Identifier  string             `json:"identifier,omitempty"`
	Labels      *map[string]string `json:"labels,omitempty"`
}

type ServiceDetails

type ServiceDetails struct {
	Provider         string             `json:"provider" valid:"required~Provider field cannot be empty."`
	Name             string             `json:"name" valid:"required~Name field cannot be empty."`
	Description      string             `json:"description" valid:"required~Description field cannot be empty."`
	ShortDescription string             `json:"shortDescription,omitempty"`
	Identifier       string             `json:"identifier,omitempty"`
	Labels           *map[string]string `json:"labels,omitempty"`
	Api              *API               `json:"api,omitempty"`
	Events           *Events            `json:"events,omitempty"`
	Documentation    *Documentation     `json:"documentation,omitempty"`
}

type SpecResponse

type SpecResponse string

func (*SpecResponse) MarshalJSON

func (sp *SpecResponse) MarshalJSON() ([]byte, error)

func (*SpecResponse) UnmarshalJSON

func (sp *SpecResponse) UnmarshalJSON(bytes []byte) error

type TokenResponse

type TokenResponse struct {
	URL   string `json:"url"`
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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