token

package
v3.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2017 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package token implements a some utility related to token.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeScope

func DecodeScope(encoded string) (scope.Scope, error)

DecodeScope returns the decoded scope.

func EncodeScope

func EncodeScope(decoded scope.Scope) (string, error)

EncodeScope returns the encoded scope.

func EncodeScopeIndex

func EncodeScopeIndex(decoded uint) string

EncodeScopeIndex encodes the scope identified by the given index.

func ServeError

func ServeError(writer http.ResponseWriter, response Error, code int)

ServeError serves an error when authenticating with the bearer token.

Types

type Error

type Error struct {
	util.Error
	Scope string `json:"scope"`
}

Error is a strucutre representing a error when authenticating with token, with the expected scope.

Directories

Path Synopsis
Package backend implements the backend of the token server of API v0.
Package backend implements the backend of the token server of API v0.

Jump to

Keyboard shortcuts

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