Documentation
¶
Index ¶
Constants ¶
const ConfActingPartyCN = "actingPartyCn"
ConfActingPartyCN is the config key to provide the Acting party common name
const ConfAddress = "address"
ConfAddress is the config key for the address the http server listens on
const ConfContractValidators = "contractValidators"
ConfContractValidators is the config key for defining which contract validators to use
const ConfEnableCORS = "enableCORS"
const ConfMode = "mode"
ConfMode is the config name for the engine mode
const JwtBearerGrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer"
JwtBearerGrantType defines the grant-type to use in the access token request
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 ¶
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.