server

package
v0.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJourney

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

NewJourney creates an instance for a user journey

func NewWebSocketUpgrader

func NewWebSocketUpgrader() *websocket.Upgrader

NewWebSocketUpgrader creates a new websocket.Ugprader.

func PrintRoutesInfo

func PrintRoutesInfo(server *Server, logger *logrus.Entry)

Types

type AllCollectedEvent

type AllCollectedEvent struct {
	Stopped bool `json:"collected"`
}

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"`
	ClientID              string `json:"client_id" validate:"not_empty"`
	ClientSecret          string `json:"client_secret" validate:"not_empty"`
	TokenEndpoint         string `json:"token_endpoint" validate:"valid_url"`
	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"`
	Issuer                string `json:"issuer" validate:"valid_url"`
	RedirectURL           string `json:"redirect_url" validate:"valid_url"`
}

type Journey

type Journey interface {
	SetDiscoveryModel(discoveryModel *discovery.Model) (discovery.ValidationFailures, error)
	TestCases() (generation.TestCasesRun, error)
	CollectToken(code, state, scope string) error
	AllTokenCollected() bool
	RunTests() error
	StopTestRun()
	Results() executors.DaemonController
	SetConfig(signing, transport authentication.Certificate, clientID, clientSecret, tokenEndpoint, authorizationEndpoint, resourceBaseURL, xXFAPIFinancialID, issuer, redirectURL string)
}

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 PostDiscoveryModelResponse

type PostDiscoveryModelResponse struct {
	TokenEndpoints         map[string]string `json:"token_endpoints"`
	AuthorizationEndpoints map[string]string `json:"authorization_endpoints"`
	Issuers                map[string]string `json:"issuers"`
}

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 ResultEvent

type ResultEvent struct {
	Test results.TestCase `json:"test"`
}

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(logger *logrus.Entry, checker model.ConditionalityChecker, version version.Checker) *Server

NewServer returns new echo.Echo server.

type StoppedEvent

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

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