middleware

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

README

Middlewares

  • The default middleware is TokenMiddleware, which expects an access token, that can be sent to AAI in return for GA4GH visas.
  • One may create custom middlewares in this middleware package, and register them to the availableMiddlewares in config.go, and adding a case for them in main.go.
  • A middleware for runtime can then be selected with the app.middleware config.
  • For custom middlewares, it is important, that they use the storeDatasets function available in middleware.go to set the permissions for accessing data.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetDatasets = func(c *gin.Context) session.DatasetCache {
	var datasetCache session.DatasetCache
	cached, exists := c.Get(datasetsKey)
	if exists {
		datasetCache = cached.(session.DatasetCache)
	}
	log.Debugf("returning %v from request context", cached)

	return datasetCache
}

GetDatasets extracts the dataset list from the request context

Functions

func TokenMiddleware

func TokenMiddleware() gin.HandlerFunc

TokenMiddleware performs access token verification and validation JWTs are verified and validated by the app, opaque tokens are sent to AAI for verification Successful auth results in list of authorised datasets

Types

This section is empty.

Jump to

Keyboard shortcuts

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