upvs

package
v0.0.0-...-19239a5 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: EUPL-1.2 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateInvoiceNotificationMessage

func CreateInvoiceNotificationMessage(
	ctx goContext.Context, senderUri, recipientUri, invoiceId string, xmlFile, zip []byte,
) (string, error)

Types

type Body

type Body struct {
	MessageContainer MessageContainer
}

type Configuration

type Configuration struct {
	Url                string
	ApiTokenPrivateKey string
	OboTokenPublicKey  string
	// Identifier of certificate used for communication trough UPVS SSO. Required for sending notifications.
	SsoSubject string
}

func NewConfig

func NewConfig(defaultConfig Configuration) Configuration

type Connector

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

func New

func New(config Configuration) *Connector

func (*Connector) GetLoggedUserInfo

func (c *Connector) GetLoggedUserInfo(ctx goContext.Context, oboToken string) (*User, *SamlToken, error)

func (*Connector) GetLogoutUrl

func (c *Connector) GetLogoutUrl(ctx goContext.Context, callbackUrl, oboToken string) (string, error)

func (*Connector) GetSamlToken

func (c *Connector) GetSamlToken(ctx goContext.Context, oboToken string) (*SamlToken, error)

func (*Connector) GetUser

func (c *Connector) GetUser(ctx goContext.Context, oboToken string) (*User, error)

func (*Connector) SendInvoiceNotification

func (c *Connector) SendInvoiceNotification(ctx goContext.Context, skTalkMessage string) error

type GeneralAgenda

type GeneralAgenda struct {
	XMLName xml.Name `xml:"http://schemas.gov.sk/form/Doc.GeneralAgenda/1.2 GeneralAgenda"`
	Subject string   `xml:"subject"`
	Text    string   `xml:"text"`
}
type Header struct {
	MessageInfo MessageInfo
}

type InvalidTokenError

type InvalidTokenError struct {
	Message string
}

func (InvalidTokenError) Error

func (e InvalidTokenError) Error() string

type MessageContainer

type MessageContainer struct {
	XMLName        xml.Name `xml:"http://schemas.gov.sk/core/MessageContainer/1.0 MessageContainer"`
	MessageId      string
	SenderId       string
	RecipientId    string
	MessageType    string
	MessageSubject string
	Objects        []Object
}

type MessageInfo

type MessageInfo struct {
	Class         string
	PospID        string
	PospVersion   string
	MessageID     string
	CorrelationID string
}

type Object

type Object struct {
	XMLName       xml.Name `xml:"Object"`
	Id            string   `xml:"Id,attr"`
	Class         string   `xml:"Class,attr"`
	MimeType      string   `xml:"MimeType,attr"`
	Encoding      string   `xml:"Encoding,attr"`
	Name          string   `xml:"Name,attr"`
	GeneralAgenda *GeneralAgenda
	Value         *string `xml:",innerxml"`
}

type RawSamlToken

type RawSamlToken struct {
	XMLName    xml.Name `xml:"Assertion"`
	Attributes []struct {
		Name           string `xml:",attr"`
		AttributeValue string
	} `xml:"AttributeStatement>Attribute"`
}

type SKTalkMessage

type SKTalkMessage struct {
	XMLName         xml.Name `xml:"http://gov.sk/SKTalkMessage SKTalkMessage"`
	EnvelopeVersion string
	Header          Header
	Body            Body
}

type SamlToken

type SamlToken struct {
	ActorUPVSIdentityID   string
	SubjectUPVSIdentityID string
	DelegationType        int
}

type UpvsError

type UpvsError struct {
	Message string
}

func (UpvsError) Error

func (e UpvsError) Error() string

type User

type User struct {
	Name string `json:"name"`
	Uri  string `json:"uri"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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