xauth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(origin, toCheck Scope) bool

Match determines if a scope 'toCheck' matches the 'origin' scope. The origin might be more specific than the 'toCheck' scope.

func MatchScopes

func MatchScopes(originScopes, request Scopes) bool

MatchScopes checks if the 'request' scopes matches 'origin' scopes in a hierarchical way.

func SplitScopes

func SplitScopes(scope string) []string

SplitScopes splits the scope stored in the oauth query or token.

Types

type Scope

type Scope struct {
	Domain    string
	SubScopes []string
}

Scope is the authorization scope unmarshaled into computable form.

func ParseScope

func ParseScope(scope string) Scope

ParseScope parses the string scope into a authorization scope.

func (*Scope) String

func (s *Scope) String() string

String formats the scope into a string format.

type Scopes

type Scopes []Scope

Scopes is a slice of auth scopes that allows basic operation on checking and comparing multiple scopes.

func ParseScopes

func ParseScopes(inputScopes []string) Scopes

ParseScopes parses the scope into hierarchical structure.

func (Scopes) Sort

func (s Scopes) Sort()

Sort sorts the scopes at first by the common domain, than by each sub scope.

Jump to

Keyboard shortcuts

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