scopes

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//READ is used to address read operation
	READ = "read"
	//WRITE is is used to address write operation
	WRITE = "write"
)

Variables

This section is empty.

Functions

func FilterRead

func FilterRead(data interface{}, valueOf reflect.Value, scopesAllowed []string)

FilterRead is used to filter output to onlly output what client can see based on scopes

func IsOperationAllowed

func IsOperationAllowed(
	data interface{},
	fieldName string,
	operation string,
	scopesAllowed []string) bool

IsOperationAllowed checks if the operation a a field of a struct is allowed

func MatchScopes

func MatchScopes(scopeA, scopeB string) bool

MatchScopes matches two scopes using Wildcard Scope Matching Strategy (asymetric)

func ScopeInAllowed

func ScopeInAllowed(scope string, allowedScopes []string) bool

ScopeInAllowed is used to check if scope is allowed based on allowed scopes list

Types

This section is empty.

Jump to

Keyboard shortcuts

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