authentication

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJwtClaims added in v1.1.0

func GenerateJwtClaims() (jwtClaims map[string]interface{})

GenerateJwtClaims creates a jwtClaim needed to generate a token

func GenerateTokenFromDefaults added in v1.1.0

func GenerateTokenFromDefaults(surveyURL string, accountServiceURL string, accountServiceLogOutURL string, urlValues url.Values) (token string, error string)

GenerateTokenFromDefaults coverts a set of DEFAULT values into a JWT

func GenerateTokenFromPost added in v1.1.0

func GenerateTokenFromPost(postValues url.Values) (string, string)

GenerateTokenFromPost coverts a set of POST values into a JWT

func GetDefaultValues added in v1.1.0

func GetDefaultValues() map[string]string

GetDefaultValues Returns a map of default values for metadata keys

Types

type KeyLoadError

type KeyLoadError struct {
	// Op is the operation which caused the error, such as
	// "read", "parse" or "cast".
	Op string

	// Err is a description of the error that occurred during the operation.
	Err string
}

KeyLoadError describes an error that can occur during key loading

func (*KeyLoadError) Error

func (e *KeyLoadError) Error() string

type Metadata added in v1.1.0

type Metadata struct {
	Name      string `json:"name"`
	Validator string `json:"validator"`
	Default   string `json:"default"`
}

Metadata is a representation of the metadata within the schema with an additional `Default` value

func GetRequiredMetadata added in v1.1.0

func GetRequiredMetadata(launcherSchema surveys.LauncherSchema) ([]Metadata, error)

GetRequiredMetadata Gets the required metadata from a schema

type PrivateKeyResult added in v1.1.0

type PrivateKeyResult struct {
	// contains filtered or unexported fields
}

PrivateKeyResult is a wrapper for the private key and the kid that identifies it

type PublicKeyResult added in v1.1.0

type PublicKeyResult struct {
	// contains filtered or unexported fields
}

PublicKeyResult is a wrapper for the public key and the kid that identifies it

type QuestionnaireSchema added in v1.1.0

type QuestionnaireSchema struct {
	EqID     string     `json:"eq_id"`
	FormType string     `json:"form_type"`
	Metadata []Metadata `json:"metadata"`
}

QuestionnaireSchema is a minimal representation of a questionnaire schema used for extracting the eq_id and form_type

type TokenError

type TokenError struct {
	// Err is a description of the error that occurred.
	Desc string

	// From is optionally the original error from which this one was caused.
	From error
}

TokenError describes an error that can occur during JWT generation

func (*TokenError) Error

func (e *TokenError) Error() string

Jump to

Keyboard shortcuts

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