server

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CtxConstClientID                       = "client_id"
	CtxConstClientSecret                   = "client_secret"
	CtxConstTokenEndpoint                  = "token_endpoint"
	CtxResponseType                        = "responseType"
	CtxConstTokenEndpointAuthMethod        = "token_endpoint_auth_method"
	CtxConstFapiFinancialID                = "x-fapi-financial-id"
	CtxConstFapiCustomerIPAddress          = "x-fapi-customer-ip-address"
	CtxConstRedirectURL                    = "redirect_url"
	CtxConstAuthorisationEndpoint          = "authorisation_endpoint"
	CtxConstBasicAuthentication            = "basic_authentication"
	CtxConstResourceBaseURL                = "resource_server"
	CtxConstIssuer                         = "issuer"
	CtxAPIVersion                          = "api-version"
	CtxConsentedAccountID                  = "consentedAccountId"
	CtxStatementID                         = "statementId"
	CtxInternationalCreditorSchema         = "internationalCreditorScheme"
	CtxInternationalCreditorIdentification = "internationalCreditorIdentification"
	CtxInternationalCreditorName           = "internationalCreditorName"
	CtxCBPIIDebtorAccountName              = "cbpiiDebtorAccountName"
	CtxCBPIIDebtorAccountSchemeName        = "cbpiiDebtorAccountSchemeName"
	CtxCBPIIDebtorAccountIdentification    = "cbpiiDebtorAccountIdentification"
	CtxCreditorSchema                      = "creditorScheme"
	CtxCreditorIdentification              = "creditorIdentification"
	CtxCreditorName                        = "creditorName"
	CtxInstructedAmountCurrency            = "instructedAmountCurrency"
	CtxInstructedAmountValue               = "instructedAmountValue"
	CtxPaymentFrequency                    = "payment_frequency" // CtxPaymentFrequency - for example `EvryDay`.
	CtxFirstPaymentDateTime                = "firstPaymentDateTime"
	CtxRequestedExecutionDateTime          = "requestedExecutionDateTime"
	CtxCurrencyOfTransfer                  = "currencyOfTransfer"
	CtxTransactionFromDate                 = "transactionFromDate"
	CtxTransactionToDate                   = "transactionToDate"
	CtxRequestObjectSigningAlg             = "requestObjectSigningAlg"
	CtxSigningPrivate                      = "signingPrivate"
	CtxSigningPublic                       = "signingPublic"
	CtxPhase                               = "phase"
	CtxNonOBDirectory                      = "nonOBDirectory"
	CtxSigningKid                          = "signingKid"
	CtxSignatureTrustAnchor                = "signatureTrustAnchor"
	CtxDynamicResourceIDs                  = "dynamicResourceIDs"
	CtxAcrValuesSupported                  = "acrValuesSupported"
)
View Source
const ListenHost = "0.0.0.0"

ListenHost defines the name/address by which the service can be accessed.

View Source
const (
	MIMEApplicationZIP = "application/zip"
)

MIME types

Variables

This section is empty.

Functions

func DetermineAPIVersions added in v1.2.0

func DetermineAPIVersions(apis []discovery.ModelDiscoveryItem) []string

DetermineAPIVersions

func EnableTLSCheck added in v1.2.4

func EnableTLSCheck(state bool)

func NewJourney

func NewJourney(logger *logrus.Entry, generator generation.Generator, validator discovery.Validator, tlsValidator discovery.TLSValidator, dynamicResourceIDs bool) *journey

NewJourney creates an instance for a user journey

func NewWebSocketUpgrader

func NewWebSocketUpgrader() *websocket.Upgrader

NewWebSocketUpgrader creates a new websocket.Ugprader.

func PutParametersToJourneyContext added in v1.1.9

func PutParametersToJourneyContext(config JourneyConfig, context model.Context) error

PutParametersToJourneyContext populates a JourneyContext with values from the config screen

func SupportedAcrValues added in v1.1.16

func SupportedAcrValues() []string

SupportedAcrValues returns a slice of supported acr values to be used in the request object those are values that the Authorization Server is being requested to use for processing this Authentication Request https://openbanking.atlassian.net/wiki/spaces/DZ/pages/7046134/Open+Banking+Security+Profile+-+Implementer+s+Draft+v1.1.0

func SupportedRequestSignAlgValues added in v1.1.1

func SupportedRequestSignAlgValues() []interface{}

Types

type AcquiredAccessTokenWebSocketEvent

type AcquiredAccessTokenWebSocketEvent struct {
	Type  string                     `json:"type"`
	Value events.AcquiredAccessToken `json:"value"`
}

type AcquiredAllAccessTokensWebSocketEvent

type AcquiredAllAccessTokensWebSocketEvent struct {
	Type  string                         `json:"type"`
	Value events.AcquiredAllAccessTokens `json:"value"`
}

type AuthClaim

type AuthClaim struct {
	jwt.StandardClaims
	AuditTrackingID     string `json:"auditTrackingId"`
	TokenName           string `json:"tokenName"`
	Nonce               string `json:"nonce"`
	Acr                 string `json:"acr"`
	CHash               string `json:"c_hash"`
	OpenBankingIntentID string `json:"openbanking_intent_id"`
	SHash               string `json:"s_hash"`
	Azp                 string `json:"azp"`
	AuthTime            int    `json:"auth_time"`
	Realm               string `json:"realm"`
	TokenType           string `json:"tokenType"`
}

AuthClaim represents an in coming JWT from third part ASPSP as part of authentication/consent process during `Hybrid Flow Authentication` https://openid.net/specs/openid-connect-core-1_0.html#HybridFlowAuth

type ErrorResponse

type ErrorResponse struct {
	Error interface{} `json:"error"`
}

ErrorResponse wraps `error` into a JSON object.

func NewErrorMessageResponse

func NewErrorMessageResponse(msg string) *ErrorResponse

func NewErrorResponse

func NewErrorResponse(err error) *ErrorResponse

NewErrorResponse creates a ErrorResponse object from a go standard error

type GlobalConfiguration

type GlobalConfiguration struct {
	SigningPrivate                string                               `json:"signing_private" validate:"not_empty"`
	SigningPublic                 string                               `json:"signing_public" validate:"not_empty"`
	TransportPrivate              string                               `json:"transport_private" validate:"not_empty"`
	TransportPublic               string                               `json:"transport_public" validate:"not_empty"`
	UseEIDASCert                  bool                                 `json:"use_eidas_cert"`
	EIDASSigningKID               string                               `json:"eidas_signing_kid,omitempty"`
	EIDASIssuer                   string                               `json:"eidas_issuer,omitempty"`
	ClientID                      string                               `json:"client_id" validate:"not_empty"`
	ClientSecret                  string                               `json:"client_secret" validate:"not_empty"`
	TokenEndpoint                 string                               `json:"token_endpoint" validate:"valid_url"`
	ResponseType                  string                               `json:"response_type" validate:"not_empty"`
	TokenEndpointAuthMethod       string                               `json:"token_endpoint_auth_method" validate:"not_empty"`
	AuthorizationEndpoint         string                               `json:"authorization_endpoint" validate:"valid_url"`
	ResourceBaseURL               string                               `json:"resource_base_url" validate:"valid_url"`
	XFAPIFinancialID              string                               `json:"x_fapi_financial_id" validate:"not_empty"`
	XFAPICustomerIPAddress        string                               `json:"x_fapi_customer_ip_address,omitempty"`
	Issuer                        string                               `json:"issuer" validate:"valid_url"`
	RedirectURL                   string                               `json:"redirect_url" validate:"valid_url"`
	ResourceIDs                   model.ResourceIDs                    `json:"resource_ids" validate:"not_empty"`
	CreditorAccount               models.Payment                       `json:"creditor_account"`
	InternationalCreditorAccount  models.Payment                       `json:"international_creditor_account"`
	TransactionFromDate           string                               `json:"transaction_from_date" validate:"not_empty"`
	TransactionToDate             string                               `json:"transaction_to_date" validate:"not_empty"`
	RequestObjectSigningAlgorithm string                               `json:"request_object_signing_alg"`
	InstructedAmount              models.InstructedAmount              `json:"instructed_amount"`
	PaymentFrequency              models.PaymentFrequency              `json:"payment_frequency"`
	FirstPaymentDateTime          string                               `json:"first_payment_date_time"`
	RequestedExecutionDateTime    string                               `json:"requested_execution_date_time"`
	CurrencyOfTransfer            string                               `json:"currency_of_transfer"`
	UseNonOBDirectory             bool                                 `json:"use_non_ob_directory"`
	SigningKid                    string                               `json:"signing_kid,omitempty"`
	SignatureTrustAnchor          string                               `json:"signature_trust_anchor,omitempty"`
	AcrValuesSupported            []string                             `json:"acr_values_supported,omitempty"`
	ConditionalProperties         []discovery.ConditionalAPIProperties `json:"conditional_properties,omitempty"`
	CBPIIDebtorAccount            discovery.CBPIIDebtorAccount         `json:"cbpii_debtor_account"`
}

func (GlobalConfiguration) Validate added in v1.1.0

func (c GlobalConfiguration) Validate() error

Validate - used by https://github.com/go-ozzo/ozzo-validation to validate struct.

type Journey

type Journey interface {
	SetDiscoveryModel(discoveryModel *discovery.Model) (discovery.ValidationFailures, error)
	DiscoveryModel() (discovery.Model, error)
	SetFilteredManifests(manifest.Scripts)
	FilteredManifests() (manifest.Scripts, error)
	TestCases() (generation.SpecRun, error)
	CollectToken(code, state, scope string) error
	AllTokenCollected() bool
	RunTests() error
	StopTestRun()
	NewDaemonController()
	Results() executors.DaemonController
	SetConfig(config JourneyConfig) error
	ConditionalProperties() []discovery.ConditionalAPIProperties
	Events() events.Events
	TLSVersionResult() map[string]*discovery.TLSValidationResult
}

Journey represents all possible steps for a user test conformance journey

Happy path journey would look like: 1. SetCertificates - sets configuration to run test cases 2. SetDiscoveryModel - this validates and if successful set this as your discovery model 3. TestCases - Generates test cases, generates permission set requirements to run tests and starts a token collector 3.1 CollectToken - collects all tokens required to RunTest 4. RunTest - Runs triggers a background run on all generated test from previous steps, needs all token to be already collected 5. Results - returns a background process control, so we can monitor on finished tests

type JourneyConfig

type JourneyConfig struct {
	ResponseType string

	AcrValuesSupported []string
	// contains filtered or unexported fields
}

JourneyConfig main configuration variables

func MakeJourneyConfig

func MakeJourneyConfig(config *GlobalConfiguration) (JourneyConfig, error)

type MockJourney

type MockJourney struct {
	mock.Mock
}

MockJourney is an autogenerated mock type for the Journey type

func (*MockJourney) AllTokenCollected

func (_m *MockJourney) AllTokenCollected() bool

AllTokenCollected provides a mock function with given fields:

func (*MockJourney) CollectToken

func (_m *MockJourney) CollectToken(code string, state string, scope string) error

CollectToken provides a mock function with given fields: code, state, scope

func (*MockJourney) ConditionalProperties added in v1.2.0

func (_m *MockJourney) ConditionalProperties() []discovery.ConditionalAPIProperties

ConditionalProperties provides a mock function with given fields:

func (*MockJourney) DiscoveryModel added in v1.1.0

func (_m *MockJourney) DiscoveryModel() (discovery.Model, error)

DiscoveryModel provides a mock function with given fields:

func (*MockJourney) Events

func (_m *MockJourney) Events() events.Events

Events provides a mock function with given fields:

func (*MockJourney) FilteredManifests added in v1.1.7

func (_m *MockJourney) FilteredManifests() (manifest.Scripts, error)

FilteredManifests provides a mock function with given fields:

func (*MockJourney) NewDaemonController

func (_m *MockJourney) NewDaemonController()

NewDaemonController provides a mock function with given fields:

func (*MockJourney) Results

func (_m *MockJourney) Results() executors.DaemonController

Results provides a mock function with given fields:

func (*MockJourney) RunTests

func (_m *MockJourney) RunTests() error

RunTests provides a mock function with given fields:

func (*MockJourney) SetConfig

func (_m *MockJourney) SetConfig(config JourneyConfig) error

SetConfig provides a mock function with given fields: config

func (*MockJourney) SetDiscoveryModel

func (_m *MockJourney) SetDiscoveryModel(discoveryModel *discovery.Model) (discovery.ValidationFailures, error)

SetDiscoveryModel provides a mock function with given fields: discoveryModel

func (*MockJourney) SetFilteredManifests added in v1.1.7

func (_m *MockJourney) SetFilteredManifests(_a0 manifest.Scripts)

SetFilteredManifests provides a mock function with given fields: _a0

func (*MockJourney) StopTestRun

func (_m *MockJourney) StopTestRun()

StopTestRun provides a mock function with given fields:

func (*MockJourney) TLSVersionResult added in v1.1.17

func (_m *MockJourney) TLSVersionResult() map[string]*discovery.TLSValidationResult

TLSVersionResult provides a mock function with given fields:

func (*MockJourney) TestCases

func (_m *MockJourney) TestCases() (generation.SpecRun, error)

TestCases provides a mock function with given fields:

type PostDiscoveryModelResponse

type PostDiscoveryModelResponse struct {
	TokenEndpoints                                map[string]string   `json:"token_endpoints"`
	TokenEndpointAuthMethods                      map[string][]string `json:"token_endpoint_auth_methods"`
	DefaultTokenEndpointAuthMethod                map[string]string   `json:"default_token_endpoint_auth_method"`
	RequestObjectSigningAlgValuesSupported        map[string][]string `json:"request_object_signing_alg_values_supported"`
	DefaultRequestObjectSigningAlgValuesSupported map[string]string   `json:"default_request_object_signing_alg_values_supported"`
	AuthorizationEndpoints                        map[string]string   `json:"authorization_endpoints"`
	Issuers                                       map[string]string   `json:"issuers"`
	DefaultTxnFromDateTime                        string              `json:"default_transaction_from_date"`
	DefaultTxnToDateTime                          string              `json:"default_transaction_to_date"`
	ResponseTypesSupported                        []string            `json:"response_types_supported"`
	AcrValuesSupported                            []string            `json:"acr_values_supported"`
}

type RedirectError

type RedirectError struct {
	ErrorDescription string `json:"error_description" form:"error_description" query:"error_description"`
	Error            string `json:"error" form:"error" query:"error"`
	State            string `json:"state" form:"state" query:"state"`
}

type RedirectFragment

type RedirectFragment struct {
	Code    string `json:"code" form:"code" query:"code"`
	Scope   string `json:"scope" form:"scope" query:"scope"`
	IDToken string `json:"id_token" form:"id_token" query:"id_token"`
	State   string `json:"state" form:"state" query:"state"`
}

type RedirectQuery

type RedirectQuery struct {
	Code    string `json:"code" form:"code" query:"code"`
	Scope   string `json:"scope" form:"scope" query:"scope"`
	IDToken string `json:"id_token" form:"id_token" query:"id_token"`
	State   string `json:"state" form:"state" query:"state"`
}

type ResponseType added in v1.1.1

type ResponseType = interface{}

Needs to be a interface{} slice, see the official test for an example https://github.com/go-ozzo/ozzo-validation/blob/master/in_test.go

type Server

type Server struct {
	*echo.Echo // Wrap (using composition) *echo.Echo, allows us to pretend Server is echo.Echo.
	// contains filtered or unexported fields
}

Server - wraps *echo.Echo.

func NewServer

func NewServer(journey Journey, logger *logrus.Entry, version version.Checker) *Server

NewServer returns new echo.Echo server.

type StoppedEvent

type StoppedEvent struct {
	Stopped bool `json:"stopped"`
}

type SupportedRequestSignAlg added in v1.1.1

type SupportedRequestSignAlg interface{}

Needs to be a interface{} slice, see the official test for an example https://github.com/go-ozzo/ozzo-validation/blob/master/in_test.go

type TestCaseResultWebSocketEvent

type TestCaseResultWebSocketEvent struct {
	Type string           `json:"type"`
	Test results.TestCase `json:"test"`
}

type TestCasesCompletedWebSocketEvent

type TestCasesCompletedWebSocketEvent struct {
	Type  string `json:"type"`
	Value bool   `json:"value"`
}

type VersionResponse

type VersionResponse struct {
	Version string `json:"version"`
	Msg     string `json:"message"`
	Update  bool   `json:"update"`
}

VersionResponse is defined as a response object for /version API calls

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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