pkg

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ConfActingPartyCN = "actingPartyCn"

ConfActingPartyCN is the config key to provide the Acting party common name

View Source
const ConfAddress = "address"

ConfAddress is the config key for the address the http server listens on

View Source
const ConfContractValidators = "contractValidators"

ConfContractValidators is the config key for defining which contract validators to use

View Source
const ConfEnableCORS = "enableCORS"
View Source
const ConfMode = "mode"

ConfMode is the config name for the engine mode

View Source
const JwtBearerGrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer"

JwtBearerGrantType defines the grant-type to use in the access token request

View Source
const PublicURL = "publicUrl"

PublicURL is the config key for the public URL the http/irma server can be discovered

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Config AuthConfig

	OAuth services.OAuthClient

	Contract services.ContractClient

	Crypto   nutscrypto.Client
	Registry registry.RegistryClient
	// contains filtered or unexported fields
}

Auth is the main struct of the Auth service

func AuthInstance

func AuthInstance() *Auth

AuthInstance returns the singleton Auth instance. If this instance does not exists, it creates a new one.

func NewAuthInstance added in v0.15.0

func NewAuthInstance(config AuthConfig, cryptoClient nutscrypto.Client, registryClient registry.RegistryClient) *Auth

NewAuthInstance accepts a AuthConfig with several Nuts Engines and returns an instance of Auth

func (*Auth) Configure

func (auth *Auth) Configure() (err error)

Configure the Auth struct by creating a validator and create an Irma server

func (*Auth) ContractClient added in v0.16.0

func (auth *Auth) ContractClient() services.ContractClient

ContractClient returns an instance of ContractClient

func (Auth) ContractNotary added in v0.16.0

func (auth Auth) ContractNotary() services.ContractNotary

ContractNotary returns an implementation of the ContractNotary interface.

func (*Auth) OAuthClient added in v0.16.0

func (auth *Auth) OAuthClient() services.OAuthClient

OAuthClient returns an instance of OAuthClient

type AuthClient

type AuthClient interface {
	// OAuthClient returns an instance of OAuthClient
	OAuthClient() services.OAuthClient
	// ContractClient returns an instance of ContractClient
	ContractClient() services.ContractClient
	// ContractNotary returns an instance of ContractNotary
	ContractNotary() services.ContractNotary
}

AuthClient is the interface which should be implemented for clients or mocks

type AuthConfig

type AuthConfig struct {
	Mode string
	// Address to bind the http server to. Default localhost:1323
	Address                   string
	PublicUrl                 string
	IrmaConfigPath            string
	IrmaSchemeManager         string
	SkipAutoUpdateIrmaSchemas bool
	ActingPartyCn             string
	EnableCORS                bool
	ContractValidators        []string
	ContractValidDuration     time.Duration
}

AuthConfig holds all the configuration params

func DefaultAuthConfig added in v0.15.0

func DefaultAuthConfig() AuthConfig

DefaultAuthConfig returns an instance of AuthConfig with the default values.

Directories

Path Synopsis
uzi

Jump to

Keyboard shortcuts

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