authentication

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJwtClaims

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

GenerateJwtClaims creates a jwtClaim needed to generate a token

func GenerateTokenFromDefaults

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

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

GenerateTokenFromPost converts a set of POST values into a JWT

func GetDefaultValues

func GetDefaultValues() map[string]string

GetDefaultValues Returns a map of default values for metadata keys

func TransformSchemaParamsToName added in v1.1.0

func TransformSchemaParamsToName(postValues url.Values) string

TransformSchemaParamsToName Returns a schema name from business schema parameters

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

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

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

func GetRequiredMetadata

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

GetRequiredMetadata Gets the required metadata from a schema

type PrivateKeyResult

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

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

type PublicKeyResult

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

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

type QuestionnaireSchema

type QuestionnaireSchema struct {
	Metadata   []Metadata `json:"metadata"`
	SchemaName string     `json:"schema_name"`
}

QuestionnaireSchema is a minimal representation of a questionnaire schema used for extracting the metadata and questionnaire identifiers

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