go-swagger: github.com/go-swagger/go-swagger/examples/composed-auth/auth Index | Files

package auth

import "github.com/go-swagger/go-swagger/examples/composed-auth/auth"


Package Files


func HasRole Uses

func HasRole(token string, scopes []string) (*models.Principal, error)

HasRole tells if the Bearer token is a JWT signed by us with a claim to be member of an authorization scope. We verify that the claimed role is one of the passed scopes

func IsRegistered Uses

func IsRegistered(user, pass string) (*models.Principal, error)

IsRegistered determines if the user is properly registered, i.e if a valid username:password pair has been provided

func IsReseller Uses

func IsReseller(token string) (*models.Principal, error)

IsReseller tells if the API key is a JWT signed by us with a claim to be a reseller

Package auth imports 5 packages (graph) and is imported by 1 packages. Updated 2019-11-06. Refresh now. Tools for package owners.