auth

package
v0.0.0-...-afd3d84 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Header interface {

	// GetRestApiBaseUri returns a base uri for the REST API
	GetRestApiBaseUri() string

	// GetRestApiAuthHeader returns a valid Suitetalk RESTlet OAuth1.0 header
	GetRestApiAuthHeader(method string, requestUrl string) string

	// GetSoapApiBaseUri returns a base uri for the SOAP API
	GetSoapApiBaseUri(apiVersion string) string

	// GetSoapApiAuthHeader returns a valid Suitetalk SOAP header
	GetSoapApiAuthHeader(apiVersion string) *TokenPassport
}

func NewHeader

func NewHeader(c *HeaderOptions) Header

NewHeader make a new Header

type HeaderOptions

type HeaderOptions struct {
	AccountId      string
	ConsumerKey    string
	ConsumerSecret string
	TokenId        string
	TokenSecret    string
}

func (*HeaderOptions) GetRestApiAuthHeader

func (h *HeaderOptions) GetRestApiAuthHeader(method string, requestUrl string) string

GetRestApiAuthHeader returns a valid Suitetalk RESTlet OAuth1.0 header

func (*HeaderOptions) GetRestApiBaseUri

func (h *HeaderOptions) GetRestApiBaseUri() string

GetRestApiBaseUri returns a base uri for the REST API

func (*HeaderOptions) GetSoapApiAuthHeader

func (h *HeaderOptions) GetSoapApiAuthHeader(apiVersion string) *TokenPassport

GetSoapApiAuthHeader returns a valid Suitetalk SOAP header

func (*HeaderOptions) GetSoapApiBaseUri

func (h *HeaderOptions) GetSoapApiBaseUri(apiVersion string) string

GetSoapApiBaseUri returns a base uri for the SOAP API

type TokenPassport

type TokenPassport struct {
	XMLName      xml.Name `xml:"platformMsgs:tokenPassport"`
	PlatformCore string   `xml:"xmlns:platformCore,attr"`
	PlatformMsgs string   `xml:"xmlns:platformMsgs,attr"`
	Xs           string   `xml:"xmlns:xs,attr"`
	Account      line     `xml:"platformCore:account"`
	ConsumerKey  line     `xml:"platformCore:consumerKey"`
	Token        line     `xml:"platformCore:token"`
	Nonce        line     `xml:"platformCore:nonce"`
	Timestamp    line     `xml:"platformCore:timestamp"`
	Signature    lineSign `xml:"platformCore:signature"`
}

Jump to

Keyboard shortcuts

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