auth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPermissions

func GetPermissions(visas Visas) ([]string, error)

GetPermissions parses visas and finds matching dataset names from the database, returning a list of matches

func GetToken

func GetToken(header string) (string, int, error)

GetToken parses the token string from header

func VerifyJWT

func VerifyJWT(o OIDCDetails, token string) (jwt.Token, error)

VerifyJWT verifies the token signature

Types

type JKU

type JKU struct {
	URL string `json:"jku"`
}

type OIDCDetails

type OIDCDetails struct {
	Issuer   string `json:"issue"`
	Userinfo string `json:"userinfo_endpoint"`
	JWK      string `json:"jwks_uri"`
}

OIDCDetails is used to draw the response bytes to a struct

var Details OIDCDetails

Details stores an OIDCDetails struct

func GetOIDCDetails

func GetOIDCDetails(url string) (OIDCDetails, error)

GetOIDCDetails requests OIDC configuration information

type Visa

type Visa struct {
	Type    string `json:"type"`
	Dataset string `json:"value"`
}

Visa is used to draw the dataset name out of the visa

type Visas

type Visas struct {
	Visa []string `json:"ga4gh_passport_v1"`
}

Visas is used to draw the response bytes to a struct

func GetVisas

func GetVisas(o OIDCDetails, token string) (*Visas, error)

GetVisas requests the list of visas from userinfo endpoint

Jump to

Keyboard shortcuts

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