Version: v0.5.6 Latest Latest

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

Go to latest
Published: May 18, 2021 License: BSD-3-Clause Imports: 35 Imported by: 0




View Source
const (
	CookieKeySession        = "mokey-sessck"
	CookieKeyState          = "state"
	CookieKeyAuthenticated  = "authenticated"
	CookieKeySID            = "sid"
	CookieKeyUser           = "user"
	CookieKeyWYAF           = "wyaf"
	CookieKeyGlobus         = "globus"
	CookieKeyGlobusUsername = "globus_username"
	ContextKeyUser          = "user"
	ContextKeyIPAClient     = "ipa"
	ContextKeyApi           = "apikey"


This section is empty.


func CacheControl added in v0.5.5

func CacheControl(next echo.HandlerFunc) echo.HandlerFunc

func HTTPErrorHandler

func HTTPErrorHandler(err error, c echo.Context)

Render custom error templates if available

func LoginRequired

func LoginRequired(next echo.HandlerFunc) echo.HandlerFunc

LoginRequired ensure the user has logged in and has a valid FreeIPA session. Stores the ipa.UserRecord in the request context

func Path

func Path(path string) string

func RateLimit

func RateLimit(next echo.HandlerFunc) echo.HandlerFunc

RateLimit middleware using redis for rate limiting requests

func Run

func Run() error

Start web server

func URI

func URI(c echo.Context, name string) string


type FakeTLSTransport added in v0.5.3

type FakeTLSTransport struct {
	T http.RoundTripper

func (*FakeTLSTransport) RoundTrip added in v0.5.3

func (ftt *FakeTLSTransport) RoundTrip(req *http.Request) (*http.Response, error)

type GlobusIDTokenClaims

type GlobusIDTokenClaims struct {
	Aud                         string `json:"aud"`
	IdentityProviderDisplayName string `json:"identity_provider_display_name"`
	Sub                         string `json:"sub"`
	ISS                         string `json:"iss"`
	PreferredUsername           string `json:"preferred_username"`
	AtHash                      string `json:"at_hash"`
	IdentityProvider            string `json:"identity_provider"`
	Exp                         int    `json:"exp"`
	IAt                         int    `json:"iat"`
	Organization                string `json:"organization"`
	Email                       string `json:"email"`
	Name                        string `json:"name"`

type GlobusIdentities

type GlobusIdentities struct {
	Identities []*GlobusIdentity `json:"identities"`
	Included   struct {
		IdentityProviders []*GlobusIdentityProvider `json:"identity_providers"`
	} `json:"included"`

type GlobusIdentity

type GlobusIdentity struct {
	Active           bool     `json:"active"`
	Aud              []string `json:"aud"`
	ClientID         string   `json:"client_id"`
	Email            string   `json:"email"`
	Exp              int      `json:"exp"`
	IAt              int      `json:"iat"`
	NBF              int      `json:"nbf"`
	IdentitiesSet    []string `json:"identities_set"`
	IdentityProvider string   `json:"identity_provider"`
	ISS              string   `json:"iss"`
	Name             string   `json:"name"`
	Scope            string   `json:"scope"`
	Sub              string   `json:"sub"`
	Status           string   `json:"status"`
	TokenType        string   `json:"token_type"`
	Username         string   `json:"username"`
	Organization     string   `json:"organization"`
	ID               string   `json:"id"`

func (*GlobusIdentity) CleanUsername

func (g *GlobusIdentity) CleanUsername() string

type GlobusIdentityProvider

type GlobusIdentityProvider struct {
	Name      string   `json:"name"`
	ShortName string   `json:"short_name"`
	ID        string   `json:"id"`
	Domains   []string `json:"domains"`

type Handler

type Handler struct {
	// contains filtered or unexported fields

func NewHandler

func NewHandler(db model.Datastore) (*Handler, error)

func (*Handler) AddSSHPubKey

func (h *Handler) AddSSHPubKey(c echo.Context) error

func (*Handler) ApiKey

func (h *Handler) ApiKey(c echo.Context) error

func (*Handler) Captcha

func (h *Handler) Captcha(c echo.Context) error

Captcha handler displays captcha image

func (*Handler) ChangeGet added in v0.5.6

func (h *Handler) ChangeGet(c echo.Context) error

func (*Handler) ChangePassword

func (h *Handler) ChangePassword(c echo.Context) error

func (*Handler) ChangePost added in v0.5.6

func (h *Handler) ChangePost(c echo.Context) error

func (*Handler) ConsentGet

func (h *Handler) ConsentGet(c echo.Context) error

func (*Handler) ConsentPost

func (h *Handler) ConsentPost(c echo.Context) error

func (*Handler) CreateAccount

func (h *Handler) CreateAccount(c echo.Context) error

Create new user account POST handler

func (*Handler) ForgotPassword

func (h *Handler) ForgotPassword(c echo.Context) error

func (*Handler) GlobusRedirect

func (h *Handler) GlobusRedirect(c echo.Context) error

func (*Handler) GlobusSignup

func (h *Handler) GlobusSignup(c echo.Context) error

func (*Handler) HydraError

func (h *Handler) HydraError(c echo.Context) error

func (*Handler) Index

func (h *Handler) Index(c echo.Context) error

func (*Handler) LoginGet

func (h *Handler) LoginGet(c echo.Context) error

func (*Handler) LoginOAuthGet

func (h *Handler) LoginOAuthGet(c echo.Context) error

func (*Handler) LoginOAuthPost

func (h *Handler) LoginOAuthPost(c echo.Context) error

func (*Handler) LoginPost

func (h *Handler) LoginPost(c echo.Context) error

func (*Handler) Logout

func (h *Handler) Logout(c echo.Context) error

func (*Handler) ModifyOTPTokens

func (h *Handler) ModifyOTPTokens(c echo.Context) error

func (*Handler) NewSSHPubKey

func (h *Handler) NewSSHPubKey(c echo.Context) error

func (*Handler) OTPTokens

func (h *Handler) OTPTokens(c echo.Context) error

func (*Handler) ResetPassword

func (h *Handler) ResetPassword(c echo.Context) error

func (*Handler) SSHPubKey

func (h *Handler) SSHPubKey(c echo.Context) error

func (*Handler) SetupAccount

func (h *Handler) SetupAccount(c echo.Context) error

func (*Handler) SetupRoutes

func (h *Handler) SetupRoutes(e *echo.Echo)

func (*Handler) Signup

func (h *Handler) Signup(c echo.Context) error

Signup form GET handler

func (*Handler) TwoFactorAuth

func (h *Handler) TwoFactorAuth(c echo.Context) error

type TemplateRenderer

type TemplateRenderer struct {
	// contains filtered or unexported fields

Template renderer

func NewTemplateRenderer

func NewTemplateRenderer(dir string) (*TemplateRenderer, error)

Create a new template renderer. dir is the path to template files

func (*TemplateRenderer) Render

func (t *TemplateRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error

Render renders a template

Jump to

Keyboard shortcuts

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