Documentation ¶
Index ¶
- func GenerateJwtClaims() (jwtClaims map[string]interface{})
- func GenerateTokenFromDefaults(surveyURL string, accountServiceURL string, accountServiceLogOutURL string, ...) (token string, error string)
- func GenerateTokenFromPost(postValues url.Values) (string, string)
- func GetDefaultValues() map[string]string
- func TransformSchemaParamsToName(postValues url.Values) string
- type KeyLoadError
- type Metadata
- type PrivateKeyResult
- type PublicKeyResult
- type QuestionnaireSchema
- type TokenError
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 ¶
GenerateTokenFromPost converts a set of POST values into a JWT
func GetDefaultValues ¶
GetDefaultValues Returns a map of default values for metadata keys
func TransformSchemaParamsToName ¶ added in v1.1.0
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