auth

package
v0.0.0-...-7a6a509 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Username = "username"
	Scopes   = "scopes"
)

Variables

This section is empty.

Functions

func CanRead

func CanRead(c echo.Context) bool

func CanWrite

func CanWrite(c echo.Context) bool

func IsAdmin

func IsAdmin(c echo.Context) bool

func IsAdminReadOnly

func IsAdminReadOnly(c echo.Context) bool

func IsGlobalAuditor

func IsGlobalAuditor(c echo.Context) bool

func NewJWTMiddleware

func NewJWTMiddleware(keyFunc jwt.Keyfunc) echo.MiddlewareFunc

func NewRequiresReadMiddleware

func NewRequiresReadMiddleware() echo.MiddlewareFunc

func NewRequiresWriteMiddleware

func NewRequiresWriteMiddleware() echo.MiddlewareFunc

func NewSuccessHandler

func NewSuccessHandler() middleware.JWTSuccessHandler

Types

type CFClaims

type CFClaims struct {
	Audience  []string `json:"aud"`
	ClientID  string   `json:"client_id,omitempty"`
	ExpiresAt int64    `json:"exp,omitempty"`
	ID        string   `json:"jti,omitempty"`
	IssuedAt  int64    `json:"iat,omitempty"`
	Issuer    string   `json:"iss,omitempty"`
	Subject   string   `json:"sub,omitempty"`
	UserID    string   `json:"user_id"`
	Username  string   `json:"user_name"`
	Scopes    []string `json:"scope"`
}

func (*CFClaims) Valid

func (c *CFClaims) Valid() error

type Scope

type Scope string
const (
	Read          Scope = "cloud_controller.read"
	Write         Scope = "cloud_controller.write"
	Admin         Scope = "cloud_controller.admin"
	AdminReadOnly Scope = "cloud_controller.admin_read_only"
	GlobalAuditor Scope = "cloud_controller.global_auditor"
)

Jump to

Keyboard shortcuts

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